diff --git a/lib/sidekiq_unique_jobs/web/helpers.rb b/lib/sidekiq_unique_jobs/web/helpers.rb index 0cb27403a..26696b30b 100644 --- a/lib/sidekiq_unique_jobs/web/helpers.rb +++ b/lib/sidekiq_unique_jobs/web/helpers.rb @@ -133,7 +133,7 @@ def redirect_to(subpath) # # @return [String] a html safe string with relative time information # - def relative_time(time) + def _relative_time(time) stamp = time.getutc.iso8601 %() end @@ -145,12 +145,12 @@ def relative_time(time) # # @return [String] a html safe string with relative time information # - def safe_relative_time(time) + def _safe_relative_time(time) return unless time time = parse_time(time) - relative_time(time) + _relative_time(time) end # diff --git a/lib/sidekiq_unique_jobs/web/views/changelogs.erb b/lib/sidekiq_unique_jobs/web/views/changelogs.erb index fe0e7009f..b4a0f5f9b 100644 --- a/lib/sidekiq_unique_jobs/web/views/changelogs.erb +++ b/lib/sidekiq_unique_jobs/web/views/changelogs.erb @@ -42,7 +42,7 @@ <% @changelogs.each do |changelog| %> - <%= safe_relative_time(changelog['time']) || "bogus" %> + <%= _safe_relative_time(changelog['time']) || "bogus" %> <%= changelog["digest"] %> <%= changelog["script"] %> <%= changelog["job_id"] %> diff --git a/lib/sidekiq_unique_jobs/web/views/lock.erb b/lib/sidekiq_unique_jobs/web/views/lock.erb index f8beba3b4..bce46d0d3 100644 --- a/lib/sidekiq_unique_jobs/web/views/lock.erb +++ b/lib/sidekiq_unique_jobs/web/views/lock.erb @@ -65,7 +65,7 @@ <% @lock.locked_jids(with_values: true).each do |job_id, time| %> <%= job_id %> - <%= safe_relative_time(time.to_f) %> + <%= _safe_relative_time(time.to_f) %>
<%= csrf_tag %> @@ -92,7 +92,7 @@ <% @lock.changelogs.each do |entry| %> - <%= safe_relative_time(entry["time"].to_f) %> + <%= _safe_relative_time(entry["time"].to_f) %> <%= entry["job_id"] %> <%= entry["message"] %> <%= entry["script"] %> diff --git a/lib/sidekiq_unique_jobs/web/views/locks.erb b/lib/sidekiq_unique_jobs/web/views/locks.erb index d53d97703..ed04dd577 100644 --- a/lib/sidekiq_unique_jobs/web/views/locks.erb +++ b/lib/sidekiq_unique_jobs/web/views/locks.erb @@ -46,7 +46,7 @@ <%= lock.key %> <%= lock.info["lock"] %> <%= lock.locked.count %> - <%= safe_relative_time(lock.created_at) %> + <%= _safe_relative_time(lock.created_at) %> <% end %> diff --git a/spec/sidekiq_unique_jobs/web/helpers_spec.rb b/spec/sidekiq_unique_jobs/web/helpers_spec.rb index 84bc17429..003317aab 100644 --- a/spec/sidekiq_unique_jobs/web/helpers_spec.rb +++ b/spec/sidekiq_unique_jobs/web/helpers_spec.rb @@ -19,8 +19,8 @@ def params let(:helper) { SidekiqUniqueJobs::WebHelpers.new } - describe "#safe_relative_time" do - subject(:safe_relative_time) { helper.safe_relative_time(time) } + describe "#_safe_relative_time" do + subject(:safe_relative_time) { helper._safe_relative_time(time) } let(:frozen_time) { Time.new(1982, 6, 8, 14, 15, 34) } let(:time) { Time.now.to_f }