dalliance 0.5.1 → 0.8.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +5 -5
  2. data/.circleci/config.yml +107 -0
  3. data/Appraisals +10 -14
  4. data/Gemfile +1 -1
  5. data/README.rdoc +13 -1
  6. data/dalliance.gemspec +4 -4
  7. data/gemfiles/rails_5.0.gemfile +1 -1
  8. data/gemfiles/rails_5.0.gemfile.lock +116 -89
  9. data/gemfiles/rails_5.1.gemfile +1 -1
  10. data/gemfiles/rails_5.1.gemfile.lock +115 -88
  11. data/gemfiles/{rails_4.2.gemfile → rails_5.2.gemfile} +2 -2
  12. data/gemfiles/rails_5.2.gemfile.lock +209 -0
  13. data/gemfiles/{rails_4.0.gemfile → rails_6.0.gemfile} +2 -2
  14. data/gemfiles/rails_6.0.gemfile.lock +225 -0
  15. data/gemfiles/{rails_3.2.gemfile → rails_6.1.gemfile} +2 -2
  16. data/gemfiles/rails_6.1.gemfile.lock +233 -0
  17. data/lib/dalliance.rb +83 -22
  18. data/lib/dalliance/engine.rb +1 -1
  19. data/lib/dalliance/progress_meter.rb +5 -5
  20. data/lib/dalliance/version.rb +2 -2
  21. data/lib/dalliance/workers/delayed_job.rb +20 -9
  22. data/lib/dalliance/workers/resque.rb +17 -9
  23. data/spec/dalliance/asynchronous_delayed_job_spec.rb +42 -0
  24. data/spec/dalliance/asynchronous_resque_spec.rb +54 -0
  25. data/spec/dalliance/dalliance_spec.rb +2 -2
  26. data/spec/dalliance/synchronous_spec.rb +56 -1
  27. data/spec/spec_helper.rb +2 -0
  28. data/spec/support/active_record.rb +7 -1
  29. metadata +60 -21
  30. data/gemfiles/rails_3.1.gemfile +0 -12
  31. data/gemfiles/rails_3.1.gemfile.lock +0 -149
  32. data/gemfiles/rails_3.2.gemfile.lock +0 -146
  33. data/gemfiles/rails_4.0.gemfile.lock +0 -134
  34. data/gemfiles/rails_4.1.gemfile +0 -12
  35. data/gemfiles/rails_4.1.gemfile.lock +0 -140
  36. data/gemfiles/rails_4.2.gemfile.lock +0 -168
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: b1b54f25395f325b86a3e0ddc050fd1ea2fe3ecf
4
- data.tar.gz: 37de1cafaf3e8a4876f07ed558f1d1c36caf32e6
2
+ SHA256:
3
+ metadata.gz: 287e36b49931e0fdf7ccf431d6d9358c6802d3020d7b9bbbf507600ef2eb21b3
4
+ data.tar.gz: 2fec96937b717e8feadc5a3ac946a5ef3907a23527ca1ecb2ba30ad89be067eb
5
5
  SHA512:
6
- metadata.gz: 404b031c57c507a14c3081871c9bb0ecc0c5a2fcb611e29321c63402665764841e60329e2349e12997c7e0fb5afb811b5b24cc135097209e6d6149331c9fb930
7
- data.tar.gz: f5eff30fc65c24297b33681d0b0dc06be3649a343ce26c39c164650e5faae7273e94441d2c214fe9cd046ab95995b049bdd210cd2492ea1fca83de88e214508d
6
+ metadata.gz: 9c04f97d5a480e7a5c49b9c6d0f9a52d81acd7643d2654a9b9934f62ebd7f6907545d0e2f71aa9f2a133d43bc4f49ef6c794eccd37f9b1dec5448ff7a458d59a
7
+ data.tar.gz: 3f4f2f7d6ab8721726b88232e6fa4d8282ba8ccb15544a4c765a062bb01d78a7d35b45e42a7e2bbd5d0a4efd1990cdf26ff1a894a28bc5ac7af77beabfe84566
@@ -0,0 +1,107 @@
1
+ version: 2.1
2
+
3
+ defaults: &defaults
4
+ working_directory: ~/app
5
+ docker:
6
+ - image: circleci/ruby:2.6.5
7
+ - image: redis
8
+ # - image: circleci/mysql:5.7
9
+ # environment:
10
+ # MYSQL_USER: root
11
+ # MYSQL_PASSWORD: ''
12
+
13
+ jobs:
14
+ build:
15
+ <<: *defaults
16
+ parallelism: 1
17
+ steps:
18
+ - checkout
19
+
20
+
21
+ - restore_cache:
22
+ keys:
23
+ - v2-bundle-{{ checksum "Gemfile.lock" }}
24
+ - run:
25
+ name: Bundle install
26
+ command: bundle check || bundle install --retry=3 --path vendor/bundle
27
+ - save_cache:
28
+ key: v2-bundle-{{ checksum "Gemfile.lock" }}
29
+ paths:
30
+ - vendor/bundle
31
+ - persist_to_workspace:
32
+ root: ~/
33
+ paths:
34
+ - app
35
+
36
+ test:
37
+ <<: *defaults
38
+ parallelism: 1
39
+ steps:
40
+ - attach_workspace:
41
+ at: ~/
42
+
43
+ - run: bundle --path vendor/bundle
44
+
45
+ # - run:
46
+ # name: Wait for DB
47
+ # command: dockerize -wait tcp://localhost:3306 -timeout 1m
48
+
49
+ - run:
50
+ name: Run RSpec tests
51
+ command: |
52
+ TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)"
53
+ echo $TEST_FILES
54
+ bundle exec rspec --profile 10 \
55
+ --format RspecJunitFormatter \
56
+ --out test_results/rspec.xml \
57
+ --format progress \
58
+ $TEST_FILES
59
+ - store_test_results:
60
+ path: test_results
61
+ - store_artifacts:
62
+ path: test_results
63
+
64
+ bundler_audit:
65
+ <<: *defaults
66
+ parallelism: 1
67
+ steps:
68
+ - attach_workspace:
69
+ at: ~/
70
+ - run: bundle --path vendor/bundle
71
+ - run:
72
+ name: Run bundler-audit
73
+ command: |
74
+ if [[ "${CIRCLE_NODE_INDEX}" == 0 ]]
75
+ then
76
+ bundle exec bundle-audit update && bundle exec bundle-audit check
77
+ fi
78
+
79
+ rubocop:
80
+ <<: *defaults
81
+ parallelism: 1
82
+ steps:
83
+ - attach_workspace:
84
+ at: ~/
85
+ - run: bundle --path vendor/bundle
86
+ - run:
87
+ name: Run rubocop
88
+ command: |
89
+ if [[ "${CIRCLE_NODE_INDEX}" == 0 ]]
90
+ then
91
+ bundle exec rubocop -D -l
92
+ fi
93
+
94
+ workflows:
95
+ version: 2
96
+ continuous_integration:
97
+ jobs:
98
+ - build
99
+ - test:
100
+ requires:
101
+ - build
102
+ - bundler_audit:
103
+ requires:
104
+ - build
105
+ - rubocop:
106
+ requires:
107
+ - build
data/Appraisals CHANGED
@@ -1,23 +1,19 @@
1
- appraise "rails-3.2" do
2
- gem "rails", "~> 3.2.0"
3
- end
4
-
5
- appraise "rails-4.0" do
6
- gem "rails", "~> 4.0.0"
1
+ appraise "rails-5.0" do
2
+ gem "rails", "~> 5.0.0"
7
3
  end
8
4
 
9
- appraise "rails-4.1" do
10
- gem "rails", "~> 4.1.0"
5
+ appraise "rails-5.1" do
6
+ gem "rails", "~> 5.1.0"
11
7
  end
12
8
 
13
- appraise "rails-4.2" do
14
- gem "rails", "~> 4.2.0"
9
+ appraise "rails-5.2" do
10
+ gem "rails", "~> 5.2.2"
15
11
  end
16
12
 
17
- appraise "rails-5.0" do
18
- gem "rails", "~> 5.0.0"
13
+ appraise "rails-6.0" do
14
+ gem "rails", "~> 6.0.0"
19
15
  end
20
16
 
21
- appraise "rails-5.1" do
22
- gem "rails", "~> 5.1.0"
17
+ appraise "rails-6.1" do
18
+ gem "rails", "~> 6.1.0"
23
19
  end
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source "http://rubygems.org"
1
+ source "https://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in dalliance.gemspec
4
4
  gemspec
data/README.rdoc CHANGED
@@ -19,7 +19,19 @@ In your model:
19
19
  process_method is the name of the method to invoke for background processing
20
20
  to kick it off just call dalliance_background_process
21
21
 
22
- Handle your migrations:
22
+ Models can also be re-processed to allow front-end users to reprocess without
23
+ needing to loop in PMs or developers:
24
+
25
+ class Model < ActiveRecord::Base
26
+ dalliance :process_method,
27
+ reprocess_method: :reprocessing_method
28
+ end
29
+
30
+ Keep in mind that a record that has not already been completely processed (eg in
31
+ a state of 'pending' or 'processing') cannot be reprocessed. Attempting to
32
+ reprocess the record will raise an error.
33
+
34
+ == Handle your migrations:
23
35
 
24
36
  rails g dalliance:progress_meter
25
37
 
data/dalliance.gemspec CHANGED
@@ -11,14 +11,12 @@ Gem::Specification.new do |s|
11
11
  s.summary = %q{ Wrapper for an ActiveRecord model with a single ascynhronous method }
12
12
  s.description = %q{ Background processing for ActiveRecord using a 'delayable' worker and a state_machine }
13
13
 
14
- s.rubyforge_project = "dalliance"
15
-
16
14
  s.files = `git ls-files`.split("\n")
17
15
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
16
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
17
  s.require_paths = ["lib"]
20
18
 
21
- s.add_dependency('rails', '>= 3.2', "< 5.2")
19
+ s.add_dependency('rails', '>= 5.0', "< 6.2")
22
20
 
23
21
  s.add_dependency('state_machine')
24
22
 
@@ -26,6 +24,8 @@ Gem::Specification.new do |s|
26
24
  s.add_development_dependency('delayed_job', '>= 3.0.0')
27
25
  s.add_development_dependency('delayed_job_active_record')
28
26
  s.add_development_dependency('sqlite3')
29
-
30
27
  s.add_development_dependency('resque')
28
+ s.add_development_dependency('bundler-audit')
29
+ s.add_development_dependency('rubocop', '~> 0.78')
30
+ s.add_development_dependency('rspec_junit_formatter')
31
31
  end
@@ -1,6 +1,6 @@
1
1
  # This file was generated by Appraisal
2
2
 
3
- source "http://rubygems.org"
3
+ source "https://rubygems.org"
4
4
 
5
5
  gem "appraisal"
6
6
  gem "rails", "~> 5.0.0"
@@ -1,48 +1,48 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- dalliance (0.4.0)
5
- rails (>= 3.2, <= 5.1.4)
4
+ dalliance (0.8.1)
5
+ rails (>= 5.0, < 6.2)
6
6
  state_machine
7
7
 
8
8
  GEM
9
- remote: http://rubygems.org/
9
+ remote: https://rubygems.org/
10
10
  specs:
11
- actioncable (5.0.0)
12
- actionpack (= 5.0.0)
13
- nio4r (~> 1.2)
11
+ actioncable (5.0.7.2)
12
+ actionpack (= 5.0.7.2)
13
+ nio4r (>= 1.2, < 3.0)
14
14
  websocket-driver (~> 0.6.1)
15
- actionmailer (5.0.0)
16
- actionpack (= 5.0.0)
17
- actionview (= 5.0.0)
18
- activejob (= 5.0.0)
15
+ actionmailer (5.0.7.2)
16
+ actionpack (= 5.0.7.2)
17
+ actionview (= 5.0.7.2)
18
+ activejob (= 5.0.7.2)
19
19
  mail (~> 2.5, >= 2.5.4)
20
20
  rails-dom-testing (~> 2.0)
21
- actionpack (5.0.0)
22
- actionview (= 5.0.0)
23
- activesupport (= 5.0.0)
21
+ actionpack (5.0.7.2)
22
+ actionview (= 5.0.7.2)
23
+ activesupport (= 5.0.7.2)
24
24
  rack (~> 2.0)
25
25
  rack-test (~> 0.6.3)
26
26
  rails-dom-testing (~> 2.0)
27
27
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
28
- actionview (5.0.0)
29
- activesupport (= 5.0.0)
28
+ actionview (5.0.7.2)
29
+ activesupport (= 5.0.7.2)
30
30
  builder (~> 3.1)
31
31
  erubis (~> 2.7.0)
32
32
  rails-dom-testing (~> 2.0)
33
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
34
- activejob (5.0.0)
35
- activesupport (= 5.0.0)
33
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
34
+ activejob (5.0.7.2)
35
+ activesupport (= 5.0.7.2)
36
36
  globalid (>= 0.3.6)
37
- activemodel (5.0.0)
38
- activesupport (= 5.0.0)
39
- activerecord (5.0.0)
40
- activemodel (= 5.0.0)
41
- activesupport (= 5.0.0)
37
+ activemodel (5.0.7.2)
38
+ activesupport (= 5.0.7.2)
39
+ activerecord (5.0.7.2)
40
+ activemodel (= 5.0.7.2)
41
+ activesupport (= 5.0.7.2)
42
42
  arel (~> 7.0)
43
- activesupport (5.0.0)
43
+ activesupport (5.0.7.2)
44
44
  concurrent-ruby (~> 1.0, >= 1.0.2)
45
- i18n (~> 0.7)
45
+ i18n (>= 0.7, < 2)
46
46
  minitest (~> 5.1)
47
47
  tzinfo (~> 1.1)
48
48
  appraisal (2.2.0)
@@ -50,117 +50,142 @@ GEM
50
50
  rake
51
51
  thor (>= 0.14.0)
52
52
  arel (7.1.4)
53
- builder (3.2.3)
54
- byebug (9.1.0)
55
- concurrent-ruby (1.0.5)
56
- crass (1.0.3)
57
- delayed_job (4.1.4)
58
- activesupport (>= 3.0, < 5.2)
59
- delayed_job_active_record (4.1.2)
60
- activerecord (>= 3.0, < 5.2)
53
+ ast (2.4.0)
54
+ builder (3.2.4)
55
+ bundler-audit (0.6.1)
56
+ bundler (>= 1.2.0, < 3)
57
+ thor (~> 0.18)
58
+ byebug (11.1.1)
59
+ concurrent-ruby (1.1.6)
60
+ crass (1.0.6)
61
+ delayed_job (4.1.8)
62
+ activesupport (>= 3.0, < 6.1)
63
+ delayed_job_active_record (4.1.4)
64
+ activerecord (>= 3.0, < 6.1)
61
65
  delayed_job (>= 3.0, < 5)
62
66
  diff-lcs (1.3)
63
67
  erubis (2.7.0)
64
- globalid (0.4.1)
68
+ globalid (0.4.2)
65
69
  activesupport (>= 4.2.0)
66
- i18n (0.9.1)
70
+ i18n (1.8.2)
67
71
  concurrent-ruby (~> 1.0)
68
- loofah (2.1.1)
72
+ jaro_winkler (1.5.4)
73
+ loofah (2.4.0)
69
74
  crass (~> 1.0.2)
70
75
  nokogiri (>= 1.5.9)
71
- mail (2.7.0)
76
+ mail (2.7.1)
72
77
  mini_mime (>= 0.1.1)
73
- method_source (0.9.0)
74
- mini_mime (1.0.0)
75
- mini_portile2 (2.3.0)
76
- minitest (5.11.1)
78
+ method_source (0.9.2)
79
+ mini_mime (1.0.2)
80
+ mini_portile2 (2.4.0)
81
+ minitest (5.14.0)
77
82
  mono_logger (1.1.0)
78
- multi_json (1.12.2)
79
- mustermann (1.0.1)
80
- nio4r (1.2.1)
81
- nokogiri (1.8.1)
82
- mini_portile2 (~> 2.3.0)
83
- rack (2.0.3)
84
- rack-protection (2.0.0)
83
+ multi_json (1.14.1)
84
+ mustermann (1.1.1)
85
+ ruby2_keywords (~> 0.0.1)
86
+ nio4r (2.5.2)
87
+ nokogiri (1.10.8)
88
+ mini_portile2 (~> 2.4.0)
89
+ parallel (1.19.1)
90
+ parser (2.7.0.3)
91
+ ast (~> 2.4.0)
92
+ rack (2.2.2)
93
+ rack-protection (2.0.8.1)
85
94
  rack
86
95
  rack-test (0.6.3)
87
96
  rack (>= 1.0)
88
- rails (5.0.0)
89
- actioncable (= 5.0.0)
90
- actionmailer (= 5.0.0)
91
- actionpack (= 5.0.0)
92
- actionview (= 5.0.0)
93
- activejob (= 5.0.0)
94
- activemodel (= 5.0.0)
95
- activerecord (= 5.0.0)
96
- activesupport (= 5.0.0)
97
- bundler (>= 1.3.0, < 2.0)
98
- railties (= 5.0.0)
97
+ rails (5.0.7.2)
98
+ actioncable (= 5.0.7.2)
99
+ actionmailer (= 5.0.7.2)
100
+ actionpack (= 5.0.7.2)
101
+ actionview (= 5.0.7.2)
102
+ activejob (= 5.0.7.2)
103
+ activemodel (= 5.0.7.2)
104
+ activerecord (= 5.0.7.2)
105
+ activesupport (= 5.0.7.2)
106
+ bundler (>= 1.3.0)
107
+ railties (= 5.0.7.2)
99
108
  sprockets-rails (>= 2.0.0)
100
109
  rails-dom-testing (2.0.3)
101
110
  activesupport (>= 4.2.0)
102
111
  nokogiri (>= 1.6)
103
- rails-html-sanitizer (1.0.3)
104
- loofah (~> 2.0)
105
- railties (5.0.0)
106
- actionpack (= 5.0.0)
107
- activesupport (= 5.0.0)
112
+ rails-html-sanitizer (1.3.0)
113
+ loofah (~> 2.3)
114
+ railties (5.0.7.2)
115
+ actionpack (= 5.0.7.2)
116
+ activesupport (= 5.0.7.2)
108
117
  method_source
109
118
  rake (>= 0.8.7)
110
119
  thor (>= 0.18.1, < 2.0)
111
- rake (12.3.0)
112
- redis (4.0.1)
113
- redis-namespace (1.6.0)
120
+ rainbow (3.0.0)
121
+ rake (13.0.1)
122
+ redis (4.1.3)
123
+ redis-namespace (1.7.0)
114
124
  redis (>= 3.0.4)
115
- resque (1.27.4)
125
+ resque (2.0.0)
116
126
  mono_logger (~> 1.0)
117
127
  multi_json (~> 1.0)
118
- redis-namespace (~> 1.3)
128
+ redis-namespace (~> 1.6)
119
129
  sinatra (>= 0.9.2)
120
130
  vegas (~> 0.1.2)
121
- rspec (3.7.0)
122
- rspec-core (~> 3.7.0)
123
- rspec-expectations (~> 3.7.0)
124
- rspec-mocks (~> 3.7.0)
125
- rspec-core (3.7.1)
126
- rspec-support (~> 3.7.0)
127
- rspec-expectations (3.7.0)
131
+ rexml (3.2.4)
132
+ rspec (3.9.0)
133
+ rspec-core (~> 3.9.0)
134
+ rspec-expectations (~> 3.9.0)
135
+ rspec-mocks (~> 3.9.0)
136
+ rspec-core (3.9.1)
137
+ rspec-support (~> 3.9.1)
138
+ rspec-expectations (3.9.0)
128
139
  diff-lcs (>= 1.2.0, < 2.0)
129
- rspec-support (~> 3.7.0)
130
- rspec-mocks (3.7.0)
140
+ rspec-support (~> 3.9.0)
141
+ rspec-mocks (3.9.1)
131
142
  diff-lcs (>= 1.2.0, < 2.0)
132
- rspec-support (~> 3.7.0)
133
- rspec-support (3.7.0)
134
- sinatra (2.0.0)
143
+ rspec-support (~> 3.9.0)
144
+ rspec-support (3.9.2)
145
+ rspec_junit_formatter (0.4.1)
146
+ rspec-core (>= 2, < 4, != 2.12.0)
147
+ rubocop (0.80.0)
148
+ jaro_winkler (~> 1.5.1)
149
+ parallel (~> 1.10)
150
+ parser (>= 2.7.0.1)
151
+ rainbow (>= 2.2.2, < 4.0)
152
+ rexml
153
+ ruby-progressbar (~> 1.7)
154
+ unicode-display_width (>= 1.4.0, < 1.7)
155
+ ruby-progressbar (1.10.1)
156
+ ruby2_keywords (0.0.2)
157
+ sinatra (2.0.8.1)
135
158
  mustermann (~> 1.0)
136
159
  rack (~> 2.0)
137
- rack-protection (= 2.0.0)
160
+ rack-protection (= 2.0.8.1)
138
161
  tilt (~> 2.0)
139
- sprockets (3.7.1)
162
+ sprockets (4.0.0)
140
163
  concurrent-ruby (~> 1.0)
141
164
  rack (> 1, < 3)
142
165
  sprockets-rails (3.2.1)
143
166
  actionpack (>= 4.0)
144
167
  activesupport (>= 4.0)
145
168
  sprockets (>= 3.0.0)
146
- sqlite3 (1.3.13)
169
+ sqlite3 (1.4.2)
147
170
  state_machine (1.2.0)
148
- thor (0.20.0)
171
+ thor (0.20.3)
149
172
  thread_safe (0.3.6)
150
- tilt (2.0.8)
151
- tzinfo (1.2.4)
173
+ tilt (2.0.10)
174
+ tzinfo (1.2.6)
152
175
  thread_safe (~> 0.1)
176
+ unicode-display_width (1.6.1)
153
177
  vegas (0.1.11)
154
178
  rack (>= 1.0.0)
155
179
  websocket-driver (0.6.5)
156
180
  websocket-extensions (>= 0.1.0)
157
- websocket-extensions (0.1.3)
181
+ websocket-extensions (0.1.4)
158
182
 
159
183
  PLATFORMS
160
184
  ruby
161
185
 
162
186
  DEPENDENCIES
163
187
  appraisal
188
+ bundler-audit
164
189
  byebug
165
190
  dalliance!
166
191
  delayed_job (>= 3.0.0)
@@ -168,7 +193,9 @@ DEPENDENCIES
168
193
  rails (~> 5.0.0)
169
194
  resque
170
195
  rspec (>= 3.0.0)
196
+ rspec_junit_formatter
197
+ rubocop (~> 0.78)
171
198
  sqlite3
172
199
 
173
200
  BUNDLED WITH
174
- 1.16.0
201
+ 1.17.3