resque-cleaner 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.2.5 (2011-05-05)
2
+
3
+ * BUGFIX: Pagination has been broken.
4
+ * Dump a list as JSON format.
5
+
1
6
  ## 0.2.4 (2011-04-19)
2
7
 
3
8
  * BUGFIX: "Select All" ignores exception filter.
@@ -57,5 +57,8 @@
57
57
  #main .cleaner ul.pagination li.summary{
58
58
  padding-right: 10px
59
59
  }
60
+ #main .cleaner div.dump{
61
+ float: right
62
+ }
60
63
 
61
64
 
@@ -45,6 +45,10 @@
45
45
  <li class="next"><a href="<%= @paginate.page_url(:next)%>">older&gt;&gt;</a></li>
46
46
  <% end %>
47
47
  <% end %>
48
+
48
49
  </ul>
50
+ <div class="dump">
51
+ <a href="<%= @dump_url%>" target="_blank">Dump</a>
52
+ </div>
49
53
  </div>
50
54
 
@@ -99,6 +99,8 @@ module ResqueCleaner
99
99
  end
100
100
  end
101
101
 
102
+ mime_type :json, 'application/json'
103
+
102
104
  get "/cleaner" do
103
105
  load_library
104
106
  load_cleaner_filter
@@ -131,7 +133,8 @@ module ResqueCleaner
131
133
 
132
134
  @failed = cleaner.select(&block).reverse
133
135
 
134
- url = "cleaner_list?c=#{@klass}&ex=#{@exception}f=#{@from}&t=#{@to}"
136
+ url = "cleaner_list?c=#{@klass}&ex=#{@exception}&f=#{@from}&t=#{@to}"
137
+ @dump_url = "cleaner_dump?c=#{@klass}&ex=#{@exception}&f=#{@from}&t=#{@to}"
135
138
  @paginate = Paginate.new(@failed, url, params[:p].to_i)
136
139
 
137
140
  @klasses = cleaner.stats_by_class.keys
@@ -163,6 +166,16 @@ module ResqueCleaner
163
166
  erb File.read(ResqueCleaner::Server.erb_path('cleaner_exec.erb'))
164
167
  end
165
168
 
169
+ get "/cleaner_dump" do
170
+ load_library
171
+ load_cleaner_filter
172
+
173
+ block = filter_block
174
+
175
+ content_type :json
176
+ JSON.pretty_generate(cleaner.select(&block))
177
+ end
178
+
166
179
  post "/cleaner_stale" do
167
180
  load_library
168
181
  cleaner.clear_stale
@@ -42,5 +42,9 @@ context "resque-web" do
42
42
  post "/cleaner_exec", :action => "clear", :sha1 => Digest::SHA1.hexdigest(@cleaner.select[0].to_json)
43
43
  assert_equal 9, @cleaner.select.size
44
44
  end
45
+ test "#cleaner_dump should respond with success" do
46
+ get "/cleaner_dump"
47
+ assert last_response.ok?, last_response.errors
48
+ end
45
49
  end
46
50
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resque-cleaner
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 4
10
- version: 0.2.4
9
+ - 5
10
+ version: 0.2.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Tatsuya Ono
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-19 00:00:00 +01:00
18
+ date: 2011-05-05 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency