external_services 0.2.4 → 0.3.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3bb6cfd9b9015c02de0f4a4cbde0c8e998370079bbcea2c76dbaeb006c3c19d6
4
- data.tar.gz: c6a2719336d34b5a5731bcba73529e40547c725a1aaa236dde2b226aa14d4938
3
+ metadata.gz: 78fd3591dc6aabbbbcc337d7ddbe280656c172cc5f12845cffe71cf966edead6
4
+ data.tar.gz: d2bef2cdb63bcd5fffa2c5855a75b5feb1f97dc4b72724b9ecacca0b80d13e57
5
5
  SHA512:
6
- metadata.gz: 0efa87a106b4bba92f953a4ce5e8416885892cc7e16f035bb688e4e736470548fdb71ffa567a51034e5ea885cac387fac70af6a35396537d8c151940ae70a4bf
7
- data.tar.gz: d118e1daf478352dde4a919f98c3fe3869ac70223ef888451946a330729ec3066a40928f9d3bdbc3ca935466b9ad0968ed9d71a8f8f8c2f84464e5edd0369934
6
+ metadata.gz: f4ef134ce088983588b94d21417723ea8b3edafc2c317adf99944325259bbe6e85ca106d16cab0f51701d41ff8d8fd585cf845e1bee07d5e10b9fa3fe99fcf96
7
+ data.tar.gz: dac4c7f82850a64347613c849fff44c459df1ba0823c9cea33c28862ddbdc4ae0716b76812b42e5b7753f7802fce145f8ad4a65dce093198b49de239c6bcf855
data/Gemfile CHANGED
@@ -13,5 +13,5 @@ gem 'rubocop', '~> 0.48', require: false
13
13
 
14
14
  gem 'pry-rails'
15
15
 
16
- gem 'factory_girl_rails'
16
+ gem 'factory_bot_rails'
17
17
  gem 'rspec-rails'
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- external_services (0.2.4)
4
+ external_services (0.3.0)
5
5
  faraday (>= 0.9)
6
6
  faraday_middleware (>= 0.10)
7
7
  rails (>= 4.2.5, < 6.0)
@@ -9,169 +9,175 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- actioncable (5.1.5)
13
- actionpack (= 5.1.5)
12
+ actioncable (5.2.0)
13
+ actionpack (= 5.2.0)
14
14
  nio4r (~> 2.0)
15
- websocket-driver (~> 0.6.1)
16
- actionmailer (5.1.5)
17
- actionpack (= 5.1.5)
18
- actionview (= 5.1.5)
19
- activejob (= 5.1.5)
15
+ websocket-driver (>= 0.6.1)
16
+ actionmailer (5.2.0)
17
+ actionpack (= 5.2.0)
18
+ actionview (= 5.2.0)
19
+ activejob (= 5.2.0)
20
20
  mail (~> 2.5, >= 2.5.4)
21
21
  rails-dom-testing (~> 2.0)
22
- actionpack (5.1.5)
23
- actionview (= 5.1.5)
24
- activesupport (= 5.1.5)
22
+ actionpack (5.2.0)
23
+ actionview (= 5.2.0)
24
+ activesupport (= 5.2.0)
25
25
  rack (~> 2.0)
26
26
  rack-test (>= 0.6.3)
27
27
  rails-dom-testing (~> 2.0)
28
28
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
29
- actionview (5.1.5)
30
- activesupport (= 5.1.5)
29
+ actionview (5.2.0)
30
+ activesupport (= 5.2.0)
31
31
  builder (~> 3.1)
32
32
  erubi (~> 1.4)
33
33
  rails-dom-testing (~> 2.0)
34
34
  rails-html-sanitizer (~> 1.0, >= 1.0.3)
35
- activejob (5.1.5)
36
- activesupport (= 5.1.5)
35
+ activejob (5.2.0)
36
+ activesupport (= 5.2.0)
37
37
  globalid (>= 0.3.6)
38
- activemodel (5.1.5)
39
- activesupport (= 5.1.5)
40
- activerecord (5.1.5)
41
- activemodel (= 5.1.5)
42
- activesupport (= 5.1.5)
43
- arel (~> 8.0)
44
- activesupport (5.1.5)
38
+ activemodel (5.2.0)
39
+ activesupport (= 5.2.0)
40
+ activerecord (5.2.0)
41
+ activemodel (= 5.2.0)
42
+ activesupport (= 5.2.0)
43
+ arel (>= 9.0)
44
+ activestorage (5.2.0)
45
+ actionpack (= 5.2.0)
46
+ activerecord (= 5.2.0)
47
+ marcel (~> 0.3.1)
48
+ activesupport (5.2.0)
45
49
  concurrent-ruby (~> 1.0, >= 1.0.2)
46
- i18n (~> 0.7)
50
+ i18n (>= 0.7, < 2)
47
51
  minitest (~> 5.1)
48
52
  tzinfo (~> 1.1)
49
53
  addressable (2.4.0)
50
- arel (8.0.0)
54
+ arel (9.0.0)
51
55
  ast (2.4.0)
52
- backports (3.6.8)
56
+ backports (3.11.3)
53
57
  builder (3.2.3)
54
- childprocess (0.8.0)
58
+ childprocess (0.9.0)
55
59
  ffi (~> 1.0, >= 1.0.11)
56
- coderay (1.1.1)
60
+ coderay (1.1.2)
57
61
  concurrent-ruby (1.0.5)
58
- crass (1.0.3)
59
- diff-lcs (1.2.5)
60
- erubi (1.7.0)
61
- ethon (0.9.0)
62
+ crass (1.0.4)
63
+ diff-lcs (1.3)
64
+ erubi (1.7.1)
65
+ ethon (0.11.0)
62
66
  ffi (>= 1.3.0)
63
- factory_girl (4.7.0)
67
+ factory_bot (4.8.2)
64
68
  activesupport (>= 3.0.0)
65
- factory_girl_rails (4.7.0)
66
- factory_girl (~> 4.7.0)
69
+ factory_bot_rails (4.8.2)
70
+ factory_bot (~> 4.8.2)
67
71
  railties (>= 3.0.0)
68
- faraday (0.9.2)
72
+ faraday (0.15.0)
69
73
  multipart-post (>= 1.2, < 3)
70
- faraday_middleware (0.10.0)
71
- faraday (>= 0.7.4, < 0.10)
72
- ffi (1.9.18)
73
- gh (0.14.0)
74
- addressable
74
+ faraday_middleware (0.12.2)
75
+ faraday (>= 0.7.4, < 1.0)
76
+ ffi (1.9.23)
77
+ gh (0.15.1)
78
+ addressable (~> 2.4.0)
75
79
  backports
76
80
  faraday (~> 0.8)
77
81
  multi_json (~> 1.0)
78
- net-http-persistent (>= 2.7)
82
+ net-http-persistent (~> 2.9)
79
83
  net-http-pipeline
80
84
  globalid (0.4.1)
81
85
  activesupport (>= 4.2.0)
82
- highline (1.7.8)
83
- i18n (0.9.5)
86
+ highline (1.7.10)
87
+ i18n (1.0.1)
84
88
  concurrent-ruby (~> 1.0)
85
89
  iniparse (1.4.4)
86
- json (2.0.2)
90
+ json (2.1.0)
87
91
  launchy (2.4.3)
88
92
  addressable (~> 2.3)
89
- loofah (2.2.0)
93
+ loofah (2.2.2)
90
94
  crass (~> 1.0.2)
91
95
  nokogiri (>= 1.5.9)
92
96
  mail (2.7.0)
93
97
  mini_mime (>= 0.1.1)
94
- method_source (0.8.2)
98
+ marcel (0.3.2)
99
+ mimemagic (~> 0.3.2)
100
+ method_source (0.9.0)
101
+ mimemagic (0.3.2)
95
102
  mini_mime (1.0.0)
96
103
  mini_portile2 (2.3.0)
97
104
  minitest (5.11.3)
98
- multi_json (1.12.1)
105
+ multi_json (1.13.1)
99
106
  multipart-post (2.0.0)
100
107
  net-http-persistent (2.9.4)
101
108
  net-http-pipeline (1.0.1)
102
- nio4r (2.2.0)
109
+ nio4r (2.3.0)
103
110
  nokogiri (1.8.2)
104
111
  mini_portile2 (~> 2.3.0)
105
- overcommit (0.41.0)
112
+ overcommit (0.45.0)
106
113
  childprocess (~> 0.6, >= 0.6.3)
107
114
  iniparse (~> 1.4)
108
115
  parallel (1.12.1)
109
- parser (2.5.0.2)
116
+ parser (2.5.1.0)
110
117
  ast (~> 2.4.0)
111
118
  powerpack (0.1.1)
112
- pry (0.10.4)
119
+ pry (0.11.3)
113
120
  coderay (~> 1.1.0)
114
- method_source (~> 0.8.1)
115
- slop (~> 3.4)
116
- pry-rails (0.3.4)
117
- pry (>= 0.9.10)
121
+ method_source (~> 0.9.0)
122
+ pry-rails (0.3.6)
123
+ pry (>= 0.10.4)
118
124
  pusher-client (0.6.2)
119
125
  json
120
126
  websocket (~> 1.0)
121
- rack (2.0.4)
122
- rack-test (0.8.2)
127
+ rack (2.0.5)
128
+ rack-test (1.0.0)
123
129
  rack (>= 1.0, < 3)
124
- rails (5.1.5)
125
- actioncable (= 5.1.5)
126
- actionmailer (= 5.1.5)
127
- actionpack (= 5.1.5)
128
- actionview (= 5.1.5)
129
- activejob (= 5.1.5)
130
- activemodel (= 5.1.5)
131
- activerecord (= 5.1.5)
132
- activesupport (= 5.1.5)
130
+ rails (5.2.0)
131
+ actioncable (= 5.2.0)
132
+ actionmailer (= 5.2.0)
133
+ actionpack (= 5.2.0)
134
+ actionview (= 5.2.0)
135
+ activejob (= 5.2.0)
136
+ activemodel (= 5.2.0)
137
+ activerecord (= 5.2.0)
138
+ activestorage (= 5.2.0)
139
+ activesupport (= 5.2.0)
133
140
  bundler (>= 1.3.0)
134
- railties (= 5.1.5)
141
+ railties (= 5.2.0)
135
142
  sprockets-rails (>= 2.0.0)
136
143
  rails-dom-testing (2.0.3)
137
144
  activesupport (>= 4.2.0)
138
145
  nokogiri (>= 1.6)
139
- rails-html-sanitizer (1.0.3)
140
- loofah (~> 2.0)
141
- railties (5.1.5)
142
- actionpack (= 5.1.5)
143
- activesupport (= 5.1.5)
146
+ rails-html-sanitizer (1.0.4)
147
+ loofah (~> 2.2, >= 2.2.2)
148
+ railties (5.2.0)
149
+ actionpack (= 5.2.0)
150
+ activesupport (= 5.2.0)
144
151
  method_source
145
152
  rake (>= 0.8.7)
146
153
  thor (>= 0.18.1, < 2.0)
147
154
  rainbow (3.0.0)
148
155
  rake (10.5.0)
149
- rspec-core (3.5.2)
150
- rspec-support (~> 3.5.0)
151
- rspec-expectations (3.5.0)
156
+ rspec-core (3.7.1)
157
+ rspec-support (~> 3.7.0)
158
+ rspec-expectations (3.7.0)
152
159
  diff-lcs (>= 1.2.0, < 2.0)
153
- rspec-support (~> 3.5.0)
154
- rspec-mocks (3.5.0)
160
+ rspec-support (~> 3.7.0)
161
+ rspec-mocks (3.7.0)
155
162
  diff-lcs (>= 1.2.0, < 2.0)
156
- rspec-support (~> 3.5.0)
157
- rspec-rails (3.5.1)
163
+ rspec-support (~> 3.7.0)
164
+ rspec-rails (3.7.2)
158
165
  actionpack (>= 3.0)
159
166
  activesupport (>= 3.0)
160
167
  railties (>= 3.0)
161
- rspec-core (~> 3.5.0)
162
- rspec-expectations (~> 3.5.0)
163
- rspec-mocks (~> 3.5.0)
164
- rspec-support (~> 3.5.0)
165
- rspec-support (3.5.0)
166
- rubocop (0.52.1)
168
+ rspec-core (~> 3.7.0)
169
+ rspec-expectations (~> 3.7.0)
170
+ rspec-mocks (~> 3.7.0)
171
+ rspec-support (~> 3.7.0)
172
+ rspec-support (3.7.1)
173
+ rubocop (0.55.0)
167
174
  parallel (~> 1.10)
168
- parser (>= 2.4.0.2, < 3.0)
175
+ parser (>= 2.5)
169
176
  powerpack (~> 0.1)
170
177
  rainbow (>= 2.2.2, < 4.0)
171
178
  ruby-progressbar (~> 1.7)
172
179
  unicode-display_width (~> 1.0, >= 1.0.1)
173
180
  ruby-progressbar (1.9.0)
174
- slop (3.6.0)
175
181
  sprockets (3.7.1)
176
182
  concurrent-ruby (~> 1.0)
177
183
  rack (> 1, < 3)
@@ -179,10 +185,10 @@ GEM
179
185
  actionpack (>= 4.0)
180
186
  activesupport (>= 4.0)
181
187
  sprockets (>= 3.0.0)
182
- sqlite3 (1.3.11)
188
+ sqlite3 (1.3.13)
183
189
  thor (0.20.0)
184
190
  thread_safe (0.3.6)
185
- travis (1.8.2)
191
+ travis (1.8.8)
186
192
  backports
187
193
  faraday (~> 0.9)
188
194
  faraday_middleware (~> 0.9, >= 0.9.1)
@@ -195,9 +201,9 @@ GEM
195
201
  ethon (>= 0.8.0)
196
202
  tzinfo (1.2.5)
197
203
  thread_safe (~> 0.1)
198
- unicode-display_width (1.3.0)
199
- websocket (1.2.3)
200
- websocket-driver (0.6.5)
204
+ unicode-display_width (1.3.2)
205
+ websocket (1.2.5)
206
+ websocket-driver (0.7.0)
201
207
  websocket-extensions (>= 0.1.0)
202
208
  websocket-extensions (0.1.3)
203
209
 
@@ -207,7 +213,7 @@ PLATFORMS
207
213
  DEPENDENCIES
208
214
  bundler (~> 1.12)
209
215
  external_services!
210
- factory_girl_rails
216
+ factory_bot_rails
211
217
  overcommit
212
218
  pry-rails
213
219
  rake (~> 10.0)
@@ -217,4 +223,4 @@ DEPENDENCIES
217
223
  travis (~> 1.8, >= 1.8.2)
218
224
 
219
225
  BUNDLED WITH
220
- 1.16.0
226
+ 1.16.1
@@ -5,7 +5,10 @@ module ExternalServices
5
5
  belongs_to :subject, polymorphic: true
6
6
  serialize :extra_data, JSON
7
7
 
8
- after_update :on_first_sync, if: -> { external_id_was.nil? && external_id_changed? }
8
+ after_update :on_first_sync, if: proc { # Rails 5.1+ support
9
+ (respond_to?(:saved_change_to_external_id?) ? saved_change_to_external_id? : external_id_changed? ) &&
10
+ (respond_to?(:external_id_before_last_save) ? external_id_before_last_save.nil? : external_id_was)
11
+ }
9
12
 
10
13
  def self.to_sym
11
14
  to_s.demodulize.underscore.to_sym
@@ -12,7 +12,7 @@ module ExternalServices
12
12
  unless options[:only_api_actions] == true
13
13
  service_class = get_service_class(name, options)
14
14
  service_assoc = :"#{name}_service"
15
- has_one service_assoc, class_name: service_class, as: :subject, dependent: :destroy, autosave: true
15
+ has_one service_assoc, class_name: service_class.to_s, as: :subject, dependent: :destroy, autosave: true
16
16
 
17
17
  define_external_service_getset name, options
18
18
  define_external_service_sync_methods name, options
@@ -106,10 +106,12 @@ module ExternalServices
106
106
  before_destroy :halt_on_external_services_syncing
107
107
  end
108
108
 
109
- after_save :"#{name}_on_create", if: :id_changed?
109
+ after_save :"#{name}_on_create", if: proc { # Rails 5.1+ support
110
+ respond_to?(:saved_change_to_id?) ? saved_change_to_id? : id_changed?
111
+ }
110
112
 
111
- after_save :"#{name}_on_update", if: proc {
112
- !id_changed?
113
+ after_save :"#{name}_on_update", if: proc {# Rails 5.1+ support
114
+ !(respond_to?(:saved_change_to_id?) ? saved_change_to_id? : id_changed?)
113
115
  }
114
116
 
115
117
  after_destroy :"#{name}_on_destroy"
@@ -5,7 +5,7 @@ module ExternalServices
5
5
 
6
6
  config.generators do |g|
7
7
  g.test_framework :rspec
8
- g.fixture_replacement :factory_girl, dir: 'spec/factories'
8
+ g.fixture_replacement :factory_bot, dir: 'spec/factories'
9
9
  end
10
10
  end
11
11
  end
@@ -1,3 +1,3 @@
1
1
  module ExternalServices
2
- VERSION = '0.2.4'.freeze
2
+ VERSION = '0.3.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: external_services
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergey Gnuskov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-02-26 00:00:00.000000000 Z
11
+ date: 2018-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday