dj_mon 1.0.3 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +7 -3
- data/Rakefile +16 -8
- data/app/assets/javascripts/{dj_mon.js → dj_mon/dj_mon.js} +0 -0
- data/app/assets/stylesheets/{dj_mon.css → dj_mon/dj_mon.css} +0 -0
- data/app/controllers/dj_mon/dj_reports_controller.rb +2 -2
- data/app/models/dj_mon/dj_report.rb +23 -23
- data/app/views/dj_mon/dj_reports/index.html.haml +7 -7
- data/app/views/layouts/dj_mon.html.haml +8 -7
- data/lib/dj_mon/backend.rb +3 -2
- data/lib/dj_mon/backend/activerecord.rb +1 -1
- data/lib/dj_mon/engine.rb +1 -1
- data/lib/dj_mon/version.rb +1 -1
- metadata +4 -4
data/README.md
CHANGED
@@ -25,13 +25,17 @@ Or install it yourself as:
|
|
25
25
|
|
26
26
|
## Note
|
27
27
|
|
28
|
-
Supports `activerecord` and `mongoid`.
|
28
|
+
* Supports `activerecord` and `mongoid`.
|
29
|
+
* Supports `ruby 1.8.7` or higher for `activerecord`. `delayed_job_mongoid` depends
|
30
|
+
on `mongoid 3.0` which needs ruby 1.9, so there is no support for `ruby
|
31
|
+
1.8.7` for that.
|
32
|
+
|
29
33
|
|
30
34
|
## Usage
|
31
35
|
|
32
36
|
If you are using Rails =< 3.1, or if `config.assets.initialize_on_precompile` is set to false, then add this to `config/environments/production.rb`.
|
33
37
|
|
34
|
-
config.assets.precompile += %w( dj_mon.js dj_mon.css)
|
38
|
+
config.assets.precompile += %w( dj_mon/dj_mon.js dj_mon/dj_mon.css)
|
35
39
|
|
36
40
|
Mount it in `routes.rb`
|
37
41
|
|
@@ -65,4 +69,4 @@ root:
|
|
65
69
|
rake test:prepare
|
66
70
|
rake
|
67
71
|
|
68
|
-

|
72
|
+

|
data/Rakefile
CHANGED
@@ -19,14 +19,22 @@ namespace :test do
|
|
19
19
|
t.libs = [ "test/dummy_active_record" ]
|
20
20
|
end
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
22
|
+
if RUBY_VERSION =~ /^1\.9/
|
23
|
+
|
24
|
+
desc "Run all tests for the Mongoid backend"
|
25
|
+
Rake::TestTask.new(:mongoid) do |t|
|
26
|
+
t.pattern = 'test/**/*_test.rb'
|
27
|
+
t.libs = [ "test/dummy_mongoid" ]
|
28
|
+
end
|
29
|
+
desc "Runs all tests"
|
30
|
+
task "all"=> [ :active_record, :mongoid ]
|
31
|
+
|
32
|
+
else
|
33
|
+
# delayed_job_mongoid needs ~> mongoid 3.0 which needs ruby 1.9.
|
34
|
+
desc "Runs active_record tests"
|
35
|
+
task "all"=> [ :active_record ]
|
27
36
|
|
28
|
-
|
29
|
-
task "all"=> [ :active_record, :mongoid ]
|
37
|
+
end
|
30
38
|
|
31
39
|
desc "Prepare environment for tests"
|
32
40
|
task :prepare do
|
@@ -37,7 +45,7 @@ namespace :test do
|
|
37
45
|
|
38
46
|
end
|
39
47
|
|
40
|
-
task default
|
48
|
+
task :default=> 'test:all'
|
41
49
|
|
42
50
|
Rake::RDocTask.new(:rdoc) do |rdoc|
|
43
51
|
rdoc.rdoc_dir = 'rdoc'
|
File without changes
|
File without changes
|
@@ -36,7 +36,7 @@ module DjMon
|
|
36
36
|
def retry
|
37
37
|
DjMon::Backend.retry params[:id]
|
38
38
|
respond_to do |format|
|
39
|
-
format.html { redirect_to root_url, notice
|
39
|
+
format.html { redirect_to root_url, :notice => "The job has been queued for a re-run" }
|
40
40
|
format.json { head(:ok) }
|
41
41
|
end
|
42
42
|
end
|
@@ -44,7 +44,7 @@ module DjMon
|
|
44
44
|
def destroy
|
45
45
|
DjMon::Backend.destroy params[:id]
|
46
46
|
respond_to do |format|
|
47
|
-
format.html { redirect_to root_url, notice
|
47
|
+
format.html { redirect_to root_url, :notice => "The job was deleted" }
|
48
48
|
format.json { head(:ok) }
|
49
49
|
end
|
50
50
|
end
|
@@ -10,17 +10,17 @@ module DjMon
|
|
10
10
|
|
11
11
|
def as_json(options={})
|
12
12
|
{
|
13
|
-
id
|
14
|
-
payload
|
15
|
-
priority
|
16
|
-
attempts
|
17
|
-
queue
|
18
|
-
last_error_summary
|
19
|
-
last_error
|
20
|
-
failed_at
|
21
|
-
run_at
|
22
|
-
created_at
|
23
|
-
failed
|
13
|
+
:id => delayed_job.id,
|
14
|
+
:payload => payload(delayed_job),
|
15
|
+
:priority => delayed_job.priority,
|
16
|
+
:attempts => delayed_job.attempts,
|
17
|
+
:queue => delayed_job.queue || "global",
|
18
|
+
:last_error_summary => delayed_job.last_error.to_s.truncate(30),
|
19
|
+
:last_error => delayed_job.last_error,
|
20
|
+
:failed_at => l_datetime(delayed_job.failed_at),
|
21
|
+
:run_at => l_datetime(delayed_job.run_at),
|
22
|
+
:created_at => l_datetime(delayed_job.created_at),
|
23
|
+
:failed => delayed_job.failed_at.present?
|
24
24
|
}
|
25
25
|
end
|
26
26
|
|
@@ -51,23 +51,23 @@ module DjMon
|
|
51
51
|
|
52
52
|
def dj_counts
|
53
53
|
{
|
54
|
-
all
|
55
|
-
failed
|
56
|
-
active
|
57
|
-
queued
|
54
|
+
:all => DjMon::Backend.all.size,
|
55
|
+
:failed => DjMon::Backend.failed.size,
|
56
|
+
:active => DjMon::Backend.active.size,
|
57
|
+
:queued => DjMon::Backend.queued.size
|
58
58
|
}
|
59
59
|
end
|
60
60
|
|
61
61
|
def settings
|
62
62
|
{
|
63
|
-
destroy_failed_jobs
|
64
|
-
sleep_delay
|
65
|
-
max_attempts
|
66
|
-
max_run_time
|
67
|
-
read_ahead
|
68
|
-
delay_jobs
|
69
|
-
delayed_job_version
|
70
|
-
dj_mon_version
|
63
|
+
:destroy_failed_jobs => Delayed::Worker.destroy_failed_jobs,
|
64
|
+
:sleep_delay => Delayed::Worker.sleep_delay,
|
65
|
+
:max_attempts => Delayed::Worker.max_attempts,
|
66
|
+
:max_run_time => Delayed::Worker.max_run_time,
|
67
|
+
:read_ahead => defined?(Delayed::Worker.read_ahead) ? Delayed::Worker.read_ahead : 5,
|
68
|
+
:delay_jobs => Delayed::Worker.delay_jobs,
|
69
|
+
:delayed_job_version => Gem.loaded_specs["delayed_job"].version.version,
|
70
|
+
:dj_mon_version => DjMon::VERSION
|
71
71
|
}
|
72
72
|
end
|
73
73
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
.lead
|
3
3
|
Delayed Jobs
|
4
4
|
.pull-right
|
5
|
-
= link_to "Get DJ Mon for iPhone", "http://itunes.apple.com/app/dj-mon/id552732872", target
|
5
|
+
= link_to "Get DJ Mon for iPhone", "http://itunes.apple.com/app/dj-mon/id552732872", :target => '_blank', :class => 'btn btn-mini'
|
6
6
|
|
7
7
|
%ul.nav.nav-tabs
|
8
8
|
%li.active
|
@@ -63,11 +63,11 @@
|
|
63
63
|
{{#failed}}
|
64
64
|
{{failed_at}}
|
65
65
|
|
66
|
-
= form_tag CGI.unescape(retry_dj_report_url(:id => "{{id}}")), method
|
67
|
-
= submit_tag 'Retry', class
|
66
|
+
= form_tag CGI.unescape(retry_dj_report_url(:id => "{{id}}")), :method => :post, :class => 'form-inline' do
|
67
|
+
= submit_tag 'Retry', :class => 'btn btn-info btn-mini'
|
68
68
|
|
69
|
-
= form_tag CGI.unescape(dj_report_url(:id => "{{id}}")), method
|
70
|
-
= submit_tag 'Delete', class
|
69
|
+
= form_tag CGI.unescape(dj_report_url(:id => "{{id}}")), :method => :delete, :class => 'form-inline' do
|
70
|
+
= submit_tag 'Delete', :class => 'btn btn-danger btn-mini'
|
71
71
|
|
72
72
|
{{/failed}}
|
73
73
|
|
@@ -76,7 +76,7 @@
|
|
76
76
|
%script#last_error_template{ :type=> "text/x-handlebars-template" }
|
77
77
|
.modal.hide
|
78
78
|
.modal-header
|
79
|
-
%button{ type
|
79
|
+
%button{ :type => "button", :class => "close", 'data-dismiss' => "modal" }
|
80
80
|
×
|
81
81
|
%h3
|
82
82
|
Last Error
|
@@ -84,4 +84,4 @@
|
|
84
84
|
%code
|
85
85
|
{{content}}
|
86
86
|
.modal-footer
|
87
|
-
= link_to "Close", '#', class
|
87
|
+
= link_to "Close", '#', :class => 'btn btn-primary', 'data-dismiss'=> 'modal'
|
@@ -1,7 +1,10 @@
|
|
1
1
|
!!! 5
|
2
2
|
%html
|
3
3
|
%head{:lang => "en"}
|
4
|
-
|
4
|
+
%meta{:name => "apple-itunes-app", :content => "app-id=552732872"}
|
5
|
+
= stylesheet_link_tag "dj_mon/dj_mon", :media => "screen, projection"
|
6
|
+
= javascript_include_tag "//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"
|
7
|
+
= javascript_include_tag "dj_mon/dj_mon"
|
5
8
|
= yield :head
|
6
9
|
|
7
10
|
%body
|
@@ -10,9 +13,9 @@
|
|
10
13
|
.navbar-inner
|
11
14
|
.container
|
12
15
|
.pull-left
|
13
|
-
= link_to "DJ Mon", dj_reports_url, class
|
16
|
+
= link_to "DJ Mon", dj_reports_url, :class => "brand"
|
14
17
|
.pull-right
|
15
|
-
= link_to "Settings", "#dj_settings_template", rel
|
18
|
+
= link_to "Settings", "#dj_settings_template", :rel => 'modal', 'data-content'=> "#{DjMon::DjReport.settings.to_json}", :id => 'settings', :class => 'btn btn-primary btn-mini'
|
16
19
|
|
17
20
|
.pull-right
|
18
21
|
#dj-counts-view
|
@@ -25,8 +28,6 @@
|
|
25
28
|
.container
|
26
29
|
= yield
|
27
30
|
|
28
|
-
= javascript_include_tag "//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"
|
29
|
-
= javascript_include_tag "dj_mon"
|
30
31
|
%script
|
31
32
|
var dj_counts_dj_reports_url = "#{dj_counts_dj_reports_url}"
|
32
33
|
|
@@ -43,7 +44,7 @@
|
|
43
44
|
%script#dj_settings_template{ :type=> "text/x-handlebars-template" }
|
44
45
|
.modal.hide
|
45
46
|
.modal-header
|
46
|
-
%button{ type
|
47
|
+
%button{ :type => "button", :class => "close", 'data-dismiss' => "modal" }
|
47
48
|
×
|
48
49
|
%h3
|
49
50
|
Settings
|
@@ -91,5 +92,5 @@
|
|
91
92
|
<code>{{content.delay_jobs}}</code>
|
92
93
|
|
93
94
|
.modal-footer
|
94
|
-
= link_to "Close", '#', class
|
95
|
+
= link_to "Close", '#', :class => 'btn btn-primary', 'data-dismiss'=> 'modal'
|
95
96
|
|
data/lib/dj_mon/backend.rb
CHANGED
data/lib/dj_mon/engine.rb
CHANGED
data/lib/dj_mon/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dj_mon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-09-
|
13
|
+
date: 2012-09-25 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|
@@ -115,8 +115,8 @@ executables: []
|
|
115
115
|
extensions: []
|
116
116
|
extra_rdoc_files: []
|
117
117
|
files:
|
118
|
-
- app/assets/javascripts/dj_mon.js
|
119
|
-
- app/assets/stylesheets/dj_mon.css
|
118
|
+
- app/assets/javascripts/dj_mon/dj_mon.js
|
119
|
+
- app/assets/stylesheets/dj_mon/dj_mon.css
|
120
120
|
- app/controllers/dj_mon/dj_reports_controller.rb
|
121
121
|
- app/models/dj_mon/dj_report.rb
|
122
122
|
- app/views/dj_mon/dj_reports/index.html.haml
|