dalliance 0.5.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 943354f91ade763470f952de5256f1fbbf4b07b6
4
- data.tar.gz: e2d5c5d82ad5948f30705bc3ef50d651dc0e1a08
2
+ SHA256:
3
+ metadata.gz: e585e16bce792017e3427f68b18d991a5cdb3650b33703d56f1703240cfa3e09
4
+ data.tar.gz: 432c266fa7e05719f8074f615b439d9b9ae94ac06d429b0ff13740fabbb5f0bb
5
5
  SHA512:
6
- metadata.gz: 6481b26be15752f9fe3596e137dcb6550f0ca96beaef055975cb73d5b8b0c87c3fcdf5aa18c20ff93a84e99e8e4a27be5d4062257729defd16885f4db797bd37
7
- data.tar.gz: 210ece123339e57ea8be27697d20a5c2f2c35b33dbfedb712d5385f46a3a3708976bfea7468a73ff6a0a446a1543422fa268205ea7b7c7ab2c821aca6abb93cb
6
+ metadata.gz: ab1f1ffb14924b56bcca0afe1601ac44489ed32a6bfbc56e4bc417f6849e26574c1c82204b8852db9853bb7437ac9939a9164d0a70e0accdc486136fb7f50398
7
+ data.tar.gz: 774cd874ad72796d024e2140889bc498332485ce5ec952a424f1ef03763cba580d302275923812882a5954f66a95f86079667b30db19ef37d986cb6b2f715f43
@@ -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,15 @@
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"
7
- end
8
-
9
- appraise "rails-4.1" do
10
- gem "rails", "~> 4.1.0"
11
- end
12
-
13
- appraise "rails-4.2" do
14
- gem "rails", "~> 4.2.0"
15
- end
16
-
17
1
  appraise "rails-5.0" do
18
2
  gem "rails", "~> 5.0.0"
19
3
  end
20
4
 
21
5
  appraise "rails-5.1" do
22
6
  gem "rails", "~> 5.1.0"
7
+ end
8
+
9
+ appraise "rails-5.2" do
10
+ gem "rails", "~> 5.2.2"
11
+ end
12
+
13
+ appraise "rails-6.0" do
14
+ gem "rails", "~> 6.0.0"
23
15
  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
@@ -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
 
@@ -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.1.4")
19
+ s.add_dependency('rails', '>= 5.0', "< 6.1")
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.7.0)
5
+ rails (>= 5.0, < 6.1)
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