stateful_jobs 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +18 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +147 -0
- data/Rakefile +2 -0
- data/app/assets/javascripts/stateful_jobs.js.coffee +65 -0
- data/lib/stateful_jobs.rb +14 -0
- data/lib/stateful_jobs/controller.rb +41 -0
- data/lib/stateful_jobs/engine.rb +11 -0
- data/lib/stateful_jobs/job.rb +9 -0
- data/lib/stateful_jobs/job/base.rb +22 -0
- data/lib/stateful_jobs/job/dispatcher.rb +31 -0
- data/lib/stateful_jobs/model.rb +36 -0
- data/lib/stateful_jobs/routing.rb +59 -0
- data/lib/stateful_jobs/version.rb +3 -0
- data/lib/stateful_jobs/view_helpers.rb +29 -0
- data/spec/controllers/test_runs_controller_spec.rb +47 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/javascripts/application.js +15 -0
- data/spec/dummy/app/assets/javascripts/test.js +2 -0
- data/spec/dummy/app/assets/javascripts/tests.js +2 -0
- data/spec/dummy/app/assets/stylesheets/application.css +13 -0
- data/spec/dummy/app/assets/stylesheets/test.css +4 -0
- data/spec/dummy/app/assets/stylesheets/tests.css +4 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/controllers/test_runs_controller.rb +7 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/helpers/tests_helper.rb +2 -0
- data/spec/dummy/app/jobs/execute_job.rb +6 -0
- data/spec/dummy/app/mailers/.gitkeep +0 -0
- data/spec/dummy/app/models/.gitkeep +0 -0
- data/spec/dummy/app/models/test_run.rb +10 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/app/views/test/index.html.erb +2 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +59 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/production.rb +67 -0
- data/spec/dummy/config/environments/test.rb +37 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/inflections.rb +15 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/resque.rb +1 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +61 -0
- data/spec/dummy/db/migrate/20130228143735_create_test_runs.rb +10 -0
- data/spec/dummy/db/schema.rb +23 -0
- data/spec/dummy/lib/assets/.gitkeep +0 -0
- data/spec/dummy/log/.gitkeep +0 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +25 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/lib/stateful_jobs_job_dispatcher_spec.rb +126 -0
- data/spec/lib/stateful_jobs_job_spec.rb +23 -0
- data/spec/models/test_run_spec.rb +77 -0
- data/spec/spec_helper.rb +35 -0
- data/stateful_jobs.gemspec +36 -0
- metadata +246 -0
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
2
|
+
ENV["RAILS_ENV"] ||= 'test'
|
3
|
+
|
4
|
+
require File.expand_path("../dummy/config/environment.rb", __FILE__)
|
5
|
+
require 'stateful_jobs'
|
6
|
+
require 'rspec/rails'
|
7
|
+
require 'rspec/autorun'
|
8
|
+
|
9
|
+
# Requires supporting ruby files with custom matchers and macros, etc,
|
10
|
+
# in spec/support/ and its subdirectories.
|
11
|
+
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
|
12
|
+
|
13
|
+
RSpec.configure do |config|
|
14
|
+
# == Mock Framework
|
15
|
+
#
|
16
|
+
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
|
17
|
+
#
|
18
|
+
# config.mock_with :mocha
|
19
|
+
# config.mock_with :flexmock
|
20
|
+
# config.mock_with :rr
|
21
|
+
config.mock_with :rspec
|
22
|
+
|
23
|
+
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
24
|
+
# config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
25
|
+
|
26
|
+
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
27
|
+
# examples within a transaction, remove the following line or assign false
|
28
|
+
# instead of true.
|
29
|
+
config.use_transactional_fixtures = true
|
30
|
+
|
31
|
+
# If true, the base class of anonymous controllers will be inferred
|
32
|
+
# automatically. This will be the default behavior in future versions of
|
33
|
+
# rspec-rails.
|
34
|
+
config.infer_base_class_for_anonymous_controllers = false
|
35
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
require File.expand_path('../lib/stateful_jobs/version', __FILE__)
|
4
|
+
|
5
|
+
Gem::Specification.new do |gem|
|
6
|
+
gem.authors = ["metascape. / Kjell Schlitt"]
|
7
|
+
gem.email = ["kjell.schlitt@metascape.de"]
|
8
|
+
gem.summary = "StatefulJobs allows you to integrate your background jobs in a very stateful and responsive way into your rails app"
|
9
|
+
gem.homepage = "http://metascape.de"
|
10
|
+
|
11
|
+
gem.files = `git ls-files`.split($\)
|
12
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
13
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
14
|
+
gem.name = "stateful_jobs"
|
15
|
+
gem.require_paths = ["lib"]
|
16
|
+
gem.version = StatefulJobs::VERSION
|
17
|
+
|
18
|
+
gem.add_dependency 'rails'
|
19
|
+
gem.add_dependency 'resque'
|
20
|
+
|
21
|
+
gem.add_development_dependency 'rspec-rails'
|
22
|
+
gem.add_development_dependency 'sqlite3-ruby'
|
23
|
+
gem.add_development_dependency 'resque'
|
24
|
+
|
25
|
+
gem.description = <<description
|
26
|
+
StatefulJobs is a Resque based library which allows you to integrate responsive background jobs in a very easy way. StatefulJobs wraps an ActiveRecord Model around a set of jobs and adds a polling mechanism to your frontend to get your users noticed about the state of their tasks.
|
27
|
+
|
28
|
+
Very useful for:
|
29
|
+
|
30
|
+
* background jobs which provide its state to the frontend
|
31
|
+
* background jobs which need user interaction between several steps
|
32
|
+
* a set of jobs which share process information
|
33
|
+
|
34
|
+
All these jobs can either be implemented as a separate Class or inline with just a handy Proc.
|
35
|
+
description
|
36
|
+
end
|
metadata
ADDED
@@ -0,0 +1,246 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: stateful_jobs
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- metascape. / Kjell Schlitt
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-03-06 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rails
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: resque
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: rspec-rails
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: sqlite3-ruby
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: resque
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
type: :development
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
description: ! " StatefulJobs is a Resque based library which allows you to integrate
|
95
|
+
responsive background jobs in a very easy way. StatefulJobs wraps an ActiveRecord
|
96
|
+
Model around a set of jobs and adds a polling mechanism to your frontend to get
|
97
|
+
your users noticed about the state of their tasks.\n\n Very useful for:\n\n *
|
98
|
+
background jobs which provide its state to the frontend\n * background jobs which
|
99
|
+
need user interaction between several steps\n * a set of jobs which share process
|
100
|
+
information\n\n All these jobs can either be implemented as a separate Class
|
101
|
+
or inline with just a handy Proc.\n"
|
102
|
+
email:
|
103
|
+
- kjell.schlitt@metascape.de
|
104
|
+
executables: []
|
105
|
+
extensions: []
|
106
|
+
extra_rdoc_files: []
|
107
|
+
files:
|
108
|
+
- .gitignore
|
109
|
+
- Gemfile
|
110
|
+
- LICENSE
|
111
|
+
- README.md
|
112
|
+
- Rakefile
|
113
|
+
- app/assets/javascripts/stateful_jobs.js.coffee
|
114
|
+
- lib/stateful_jobs.rb
|
115
|
+
- lib/stateful_jobs/controller.rb
|
116
|
+
- lib/stateful_jobs/engine.rb
|
117
|
+
- lib/stateful_jobs/job.rb
|
118
|
+
- lib/stateful_jobs/job/base.rb
|
119
|
+
- lib/stateful_jobs/job/dispatcher.rb
|
120
|
+
- lib/stateful_jobs/model.rb
|
121
|
+
- lib/stateful_jobs/routing.rb
|
122
|
+
- lib/stateful_jobs/version.rb
|
123
|
+
- lib/stateful_jobs/view_helpers.rb
|
124
|
+
- spec/controllers/test_runs_controller_spec.rb
|
125
|
+
- spec/dummy/Rakefile
|
126
|
+
- spec/dummy/app/assets/javascripts/application.js
|
127
|
+
- spec/dummy/app/assets/javascripts/test.js
|
128
|
+
- spec/dummy/app/assets/javascripts/tests.js
|
129
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
130
|
+
- spec/dummy/app/assets/stylesheets/test.css
|
131
|
+
- spec/dummy/app/assets/stylesheets/tests.css
|
132
|
+
- spec/dummy/app/controllers/application_controller.rb
|
133
|
+
- spec/dummy/app/controllers/test_runs_controller.rb
|
134
|
+
- spec/dummy/app/helpers/application_helper.rb
|
135
|
+
- spec/dummy/app/helpers/tests_helper.rb
|
136
|
+
- spec/dummy/app/jobs/execute_job.rb
|
137
|
+
- spec/dummy/app/mailers/.gitkeep
|
138
|
+
- spec/dummy/app/models/.gitkeep
|
139
|
+
- spec/dummy/app/models/test_run.rb
|
140
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
141
|
+
- spec/dummy/app/views/test/index.html.erb
|
142
|
+
- spec/dummy/config.ru
|
143
|
+
- spec/dummy/config/application.rb
|
144
|
+
- spec/dummy/config/boot.rb
|
145
|
+
- spec/dummy/config/database.yml
|
146
|
+
- spec/dummy/config/environment.rb
|
147
|
+
- spec/dummy/config/environments/development.rb
|
148
|
+
- spec/dummy/config/environments/production.rb
|
149
|
+
- spec/dummy/config/environments/test.rb
|
150
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
151
|
+
- spec/dummy/config/initializers/inflections.rb
|
152
|
+
- spec/dummy/config/initializers/mime_types.rb
|
153
|
+
- spec/dummy/config/initializers/resque.rb
|
154
|
+
- spec/dummy/config/initializers/secret_token.rb
|
155
|
+
- spec/dummy/config/initializers/session_store.rb
|
156
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
157
|
+
- spec/dummy/config/locales/en.yml
|
158
|
+
- spec/dummy/config/routes.rb
|
159
|
+
- spec/dummy/db/migrate/20130228143735_create_test_runs.rb
|
160
|
+
- spec/dummy/db/schema.rb
|
161
|
+
- spec/dummy/lib/assets/.gitkeep
|
162
|
+
- spec/dummy/log/.gitkeep
|
163
|
+
- spec/dummy/public/404.html
|
164
|
+
- spec/dummy/public/422.html
|
165
|
+
- spec/dummy/public/500.html
|
166
|
+
- spec/dummy/public/favicon.ico
|
167
|
+
- spec/dummy/script/rails
|
168
|
+
- spec/lib/stateful_jobs_job_dispatcher_spec.rb
|
169
|
+
- spec/lib/stateful_jobs_job_spec.rb
|
170
|
+
- spec/models/test_run_spec.rb
|
171
|
+
- spec/spec_helper.rb
|
172
|
+
- stateful_jobs.gemspec
|
173
|
+
homepage: http://metascape.de
|
174
|
+
licenses: []
|
175
|
+
post_install_message:
|
176
|
+
rdoc_options: []
|
177
|
+
require_paths:
|
178
|
+
- lib
|
179
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
180
|
+
none: false
|
181
|
+
requirements:
|
182
|
+
- - ! '>='
|
183
|
+
- !ruby/object:Gem::Version
|
184
|
+
version: '0'
|
185
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
186
|
+
none: false
|
187
|
+
requirements:
|
188
|
+
- - ! '>='
|
189
|
+
- !ruby/object:Gem::Version
|
190
|
+
version: '0'
|
191
|
+
requirements: []
|
192
|
+
rubyforge_project:
|
193
|
+
rubygems_version: 1.8.24
|
194
|
+
signing_key:
|
195
|
+
specification_version: 3
|
196
|
+
summary: StatefulJobs allows you to integrate your background jobs in a very stateful
|
197
|
+
and responsive way into your rails app
|
198
|
+
test_files:
|
199
|
+
- spec/controllers/test_runs_controller_spec.rb
|
200
|
+
- spec/dummy/Rakefile
|
201
|
+
- spec/dummy/app/assets/javascripts/application.js
|
202
|
+
- spec/dummy/app/assets/javascripts/test.js
|
203
|
+
- spec/dummy/app/assets/javascripts/tests.js
|
204
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
205
|
+
- spec/dummy/app/assets/stylesheets/test.css
|
206
|
+
- spec/dummy/app/assets/stylesheets/tests.css
|
207
|
+
- spec/dummy/app/controllers/application_controller.rb
|
208
|
+
- spec/dummy/app/controllers/test_runs_controller.rb
|
209
|
+
- spec/dummy/app/helpers/application_helper.rb
|
210
|
+
- spec/dummy/app/helpers/tests_helper.rb
|
211
|
+
- spec/dummy/app/jobs/execute_job.rb
|
212
|
+
- spec/dummy/app/mailers/.gitkeep
|
213
|
+
- spec/dummy/app/models/.gitkeep
|
214
|
+
- spec/dummy/app/models/test_run.rb
|
215
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
216
|
+
- spec/dummy/app/views/test/index.html.erb
|
217
|
+
- spec/dummy/config.ru
|
218
|
+
- spec/dummy/config/application.rb
|
219
|
+
- spec/dummy/config/boot.rb
|
220
|
+
- spec/dummy/config/database.yml
|
221
|
+
- spec/dummy/config/environment.rb
|
222
|
+
- spec/dummy/config/environments/development.rb
|
223
|
+
- spec/dummy/config/environments/production.rb
|
224
|
+
- spec/dummy/config/environments/test.rb
|
225
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
226
|
+
- spec/dummy/config/initializers/inflections.rb
|
227
|
+
- spec/dummy/config/initializers/mime_types.rb
|
228
|
+
- spec/dummy/config/initializers/resque.rb
|
229
|
+
- spec/dummy/config/initializers/secret_token.rb
|
230
|
+
- spec/dummy/config/initializers/session_store.rb
|
231
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
232
|
+
- spec/dummy/config/locales/en.yml
|
233
|
+
- spec/dummy/config/routes.rb
|
234
|
+
- spec/dummy/db/migrate/20130228143735_create_test_runs.rb
|
235
|
+
- spec/dummy/db/schema.rb
|
236
|
+
- spec/dummy/lib/assets/.gitkeep
|
237
|
+
- spec/dummy/log/.gitkeep
|
238
|
+
- spec/dummy/public/404.html
|
239
|
+
- spec/dummy/public/422.html
|
240
|
+
- spec/dummy/public/500.html
|
241
|
+
- spec/dummy/public/favicon.ico
|
242
|
+
- spec/dummy/script/rails
|
243
|
+
- spec/lib/stateful_jobs_job_dispatcher_spec.rb
|
244
|
+
- spec/lib/stateful_jobs_job_spec.rb
|
245
|
+
- spec/models/test_run_spec.rb
|
246
|
+
- spec/spec_helper.rb
|