thehenster-resque-scheduler 1.0.8 → 1.0.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -21,7 +21,7 @@ module ResqueScheduler
21
21
  to_time = to_time.to_time if to_time.respond_to?(:to_time)
22
22
  distance_in_minutes = (((to_time - from_time).abs)/60).round
23
23
  distance_in_seconds = ((to_time - from_time).abs).round
24
-
24
+
25
25
  case distance_in_minutes
26
26
  when 0..1
27
27
  return (distance_in_minutes == 0) ? 'less than a minute' : '1 minute' unless include_seconds
@@ -33,7 +33,7 @@ module ResqueScheduler
33
33
  when 40..59 then 'less than a minute'
34
34
  else '1 minute'
35
35
  end
36
-
36
+
37
37
  when 2..44 then "#{distance_in_minutes} minutes"
38
38
  when 45..89 then 'about 1 hour'
39
39
  when 90..1439 then "about #{(distance_in_minutes.to_f / 60.0).round} hours"
@@ -17,8 +17,12 @@
17
17
  <th>Just Once</th>
18
18
  <th>Arguments</th>
19
19
  </tr>
20
- <% ary = Resque.schedule.to_a.sort{|a,b| a['name'] <=> b['name'] } %>
21
- <% ary.each do |name, config| %>
20
+ <% ary = Resque.schedule.to_a.sort{|a,b| a[0] <=> b[0] } %>
21
+ <% ary.each do |e| %>
22
+ <%
23
+ name = e[0]
24
+ config = e[1]
25
+ %>
22
26
  <tr>
23
27
  <td>
24
28
  <form action="<%= url "/schedule/requeue" %>" method="post">
@@ -29,11 +33,11 @@
29
33
  <td><%= h name %></td>
30
34
  <td><%= h config['description'] %></td>
31
35
  <td style="white-space:nowrap"><%= h config['cron'] %></td>
32
- <td><%= distance_of_time_in_words(Time.now, Rufus::CronLine.new(config['cron']).next_time, true) %><br /><span style="color:#888;font-size:85%;"><%= (Rufus::CronLine.new(config['cron']).next_time) %></span></td>
36
+ <td><%= distance_of_time_in_words(Time.now, Rufus::CronLine.new(config['cron']).next_time, true) rescue nil %><br /><span style="color:#888;font-size:85%;"><%= (Rufus::CronLine.new(config['cron']).next_time) %></span></td>
33
37
  <td><%= h config['class'] %></td>
34
38
  <td><%= h config['queue'] || queue_from_class_name(config['class']) %></td>
35
39
  <td><%= h config['just_once'].inspect %></td>
36
40
  <td><%= h config['args'].inspect %></td>
37
41
  </tr>
38
42
  <% end %>
39
- </table>
43
+ </table>
@@ -1,3 +1,3 @@
1
1
  module ResqueScheduler
2
- Version = '1.0.8'
2
+ Version = '1.0.9'
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 0
8
- - 8
9
- version: 1.0.8
8
+ - 9
9
+ version: 1.0.9
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ben VandenBos