acfs 1.6.0 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1 -0
  3. data/README.md +16 -19
  4. data/acfs.gemspec +2 -0
  5. data/lib/acfs/adapter/typhoeus.rb +6 -4
  6. data/lib/acfs/configuration.rb +13 -3
  7. data/lib/acfs/errors.rb +1 -1
  8. data/lib/acfs/global.rb +2 -2
  9. data/lib/acfs/location.rb +1 -1
  10. data/lib/acfs/operation.rb +1 -1
  11. data/lib/acfs/request/callbacks.rb +1 -1
  12. data/lib/acfs/request.rb +1 -1
  13. data/lib/acfs/resource/attributes/uuid.rb +1 -1
  14. data/lib/acfs/resource/locatable.rb +2 -2
  15. data/lib/acfs/resource/query_methods.rb +2 -2
  16. data/lib/acfs/runner.rb +15 -15
  17. data/lib/acfs/stub.rb +34 -29
  18. data/lib/acfs/version.rb +2 -2
  19. data/spec/acfs/adapter/typhoeus_spec.rb +1 -1
  20. data/spec/acfs/collection_spec.rb +66 -41
  21. data/spec/acfs/configuration_spec.rb +22 -12
  22. data/spec/acfs/global_spec.rb +9 -7
  23. data/spec/acfs/middleware/json_spec.rb +8 -8
  24. data/spec/acfs/middleware/{msgpack_spec.rb → message_pack_spec.rb} +6 -6
  25. data/spec/acfs/operation_spec.rb +3 -2
  26. data/spec/acfs/request/callbacks_spec.rb +19 -10
  27. data/spec/acfs/request_spec.rb +15 -19
  28. data/spec/acfs/resource/attributes/boolean_spec.rb +32 -32
  29. data/spec/acfs/resource/attributes/date_time_spec.rb +16 -8
  30. data/spec/acfs/resource/attributes/dict_spec.rb +15 -9
  31. data/spec/acfs/resource/attributes/float_spec.rb +20 -10
  32. data/spec/acfs/resource/attributes/integer_spec.rb +10 -5
  33. data/spec/acfs/resource/attributes/list_spec.rb +13 -8
  34. data/spec/acfs/resource/attributes/uuid_spec.rb +12 -6
  35. data/spec/acfs/resource/attributes_spec.rb +33 -32
  36. data/spec/acfs/resource/dirty_spec.rb +6 -3
  37. data/spec/acfs/resource/initialization_spec.rb +4 -5
  38. data/spec/acfs/resource/loadable_spec.rb +3 -1
  39. data/spec/acfs/resource/locatable_spec.rb +24 -18
  40. data/spec/acfs/resource/{persistance_spec.rb → persistence_spec.rb} +114 -82
  41. data/spec/acfs/resource/query_methods_spec.rb +143 -110
  42. data/spec/acfs/resource/validation_spec.rb +34 -27
  43. data/spec/acfs/response/formats_spec.rb +8 -8
  44. data/spec/acfs/response/status_spec.rb +16 -9
  45. data/spec/acfs/runner_spec.rb +10 -8
  46. data/spec/acfs/service/middleware_spec.rb +3 -3
  47. data/spec/acfs/service_spec.rb +5 -4
  48. data/spec/acfs/singleton_resource_spec.rb +2 -1
  49. data/spec/acfs/stub_spec.rb +57 -53
  50. data/spec/acfs_spec.rb +111 -93
  51. data/spec/spec_helper.rb +1 -1
  52. data/spec/support/response.rb +2 -2
  53. data/spec/support/service.rb +1 -1
  54. data/spec/support/shared/find_callbacks.rb +14 -10
  55. metadata +9 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 46dc13b234cd5b704b67a731292b06ad8b32ee3fafb0a7a0af2a1003824e6df8
4
- data.tar.gz: a35249f8e2a7a6cc49351b62c75b3fe641b26691132f4fb70b0a183ab041a380
3
+ metadata.gz: 3cbc57dd595fa4242fa029498d90ca5a497216d2003674296209b679b84a6df2
4
+ data.tar.gz: 31a009d88f2a028e2fc11513b68dd011f5cfa0b7f11a83238f167e807c365b35
5
5
  SHA512:
6
- metadata.gz: 07132ad9797084fccd7fdeb31cc9f51572ddda1eb9dc88aaf875cd244000d15823223d3c6c503f0af7ac4cc1f59cb0b748eea75d8592323b807001e82c93d781
7
- data.tar.gz: 6d6d15b6841820ae2ee672eec742b417113523ce613f1a7c7d493eeed50232b0915d7edcbf3df1b7060c5ced484bb82f59904e34fe6e17f70babe3b5ddf0a4e7
6
+ metadata.gz: ba37a7c96e65b8774879835d93ccf43a5c91bcd77ce9cf604937544f0897ebf307ffbbf914d5e7304eb90e6f62139e37eb52b2e6406db4e86d454ef45bb4423b
7
+ data.tar.gz: 976193afda7d9e6d5bbdc3eef3ec7235a90abcaf23e79f055735cb663400c02448a683e734b9f3212b2a27c101fabad4055f0a0c5dff23a517885a7bda4cea43
data/CHANGELOG.md CHANGED
@@ -6,6 +6,7 @@
6
6
  ---
7
7
 
8
8
  ### New
9
+ * Support for Ruby 3.1 and Rails 7.0
9
10
 
10
11
  ### Changes
11
12
 
data/README.md CHANGED
@@ -8,14 +8,16 @@
8
8
 
9
9
  Acfs is a library to develop API client libraries for single services within a larger service oriented application.
10
10
 
11
- Acfs covers model and service abstraction, convenient query and filter methods, full middleware stack for pre-processing requests and responses on a per service level and automatic request queuing and parallel processing. See Usage for more.
11
+ Acfs covers model and service abstraction, convenient query and filter methods, full middleware stack for pre-processing requests and responses, as well as automatic request queuing and parallel processing.
12
12
 
13
13
 
14
14
  ## Installation
15
15
 
16
16
  Add this line to your application's Gemfile:
17
17
 
18
- gem 'acfs', '~> 1.3'
18
+ ```ruby
19
+ gem 'acfs', '~> 1.7'
20
+ ```
19
21
 
20
22
  And then execute:
21
23
 
@@ -121,7 +123,7 @@ Acfs.run # This call will fire all request as parallel as possible.
121
123
  @friends[0].name # => "Miraculix"
122
124
  ```
123
125
 
124
- Use `.find_by` to get first element only. `.find_by` will call the `index`-Action and return the first resource. Optionally passed params will be sent as `GET` parameters and can be used for filtering in the service's controller.
126
+ Use `.find_by` to get first element only. `.find_by` will call the `index`-Action and return the first resource. Optionally passed parameters will be sent as `GET` parameters and can be used for filtering in the service's controller.
125
127
  ```ruby
126
128
  @user = User.find_by age: 24
127
129
 
@@ -179,7 +181,7 @@ my_single.save # sends PUT request to /single
179
181
  my_single.delete # sends DELETE request to /single
180
182
  ```
181
183
 
182
- You also can pass parameters to the find call, these will sent as GET params to the index action:
184
+ You also can pass parameters to the find call. They will be sent as query parameters to the index action:
183
185
 
184
186
  ```ruby
185
187
  my_single = Single.find name: 'Max'
@@ -189,9 +191,7 @@ Acfs.run # sends GET request with param to /single?name=Max
189
191
 
190
192
  ## Resource Inheritance
191
193
 
192
- Acfs provides a resource inheritance similar to ActiveRecord Single Table Inheritance. If a
193
- `type` attribute exists and is a valid subclass of your resource they will be converted
194
- to you subclassed resources:
194
+ Acfs provides a resource inheritance similar to ActiveRecord Single Table Inheritance. If a `type` attribute exists and is a valid subclass of your resource they will be converted to you subclassed resources:
195
195
 
196
196
  ```ruby
197
197
  class Computer < Acfs::Resource
@@ -202,8 +202,7 @@ class Pc < Computer end
202
202
  class Mac < Computer end
203
203
  ```
204
204
 
205
- With the following response on `GET /computers` the collection will contain the appropriate
206
- subclass resources:
205
+ With the following response on `GET /computers` the collection will contain the appropriate subclass resources:
207
206
 
208
207
  ```json
209
208
  [
@@ -248,9 +247,9 @@ it 'should find user number one' do
248
247
  user = MyUser.find 1
249
248
  Acfs.run
250
249
 
251
- expect(user.id).to be == 1
252
- expect(user.name).to be == 'John Smith'
253
- expect(user.age).to be == 32
250
+ expect(user.id).to eq 1
251
+ expect(user.name).to eq 'John Smith'
252
+ expect(user.age).to eq 32
254
253
 
255
254
  expect(@stub).to be_called
256
255
  expect(@stub).to_not be_called 5.times
@@ -265,8 +264,8 @@ end
265
264
  it 'should allow stub resource creation' do
266
265
  session = Session.create! ident: 'john@exmaple.org', password: 's3cr3t'
267
266
 
268
- expect(session.id).to be == 'longhash'
269
- expect(session.user).to be == 1
267
+ expect(session.id).to eq 'longhash'
268
+ expect(session.user).to eq 1
270
269
  end
271
270
  ```
272
271
 
@@ -287,9 +286,7 @@ end
287
286
 
288
287
  ## Instrumentation
289
288
 
290
- Acfs supports [instrumentation via active support][1].
291
-
292
- Acfs expose to following events
289
+ Acfs supports [instrumentation via active support][1] and exposes the following events:
293
290
 
294
291
  * `acfs.operation.complete(operation, response)`: Acfs operation completed
295
292
  * `acfs.runner.sync_run(operation)`: Run operation right now skipping queue.
@@ -297,7 +294,7 @@ Acfs expose to following events
297
294
  * `acfs.before_run`: directly before `acfs.run`
298
295
  * `acfs.run`: Run all queued operations.
299
296
 
300
- Read [official guide][2] to see to to subscribe.
297
+ Read the [official guide][2] on how to subscribe to these events.
301
298
 
302
299
  [1]: http://guides.rubyonrails.org/active_support_instrumentation.html
303
300
  [2]: http://guides.rubyonrails.org/active_support_instrumentation.html#subscribing-to-an-event
@@ -318,4 +315,4 @@ Read [official guide][2] to see to to subscribe.
318
315
 
319
316
  MIT License
320
317
 
321
- Copyright (c) 2013-2020 Jan Graichen. MIT license, see LICENSE for more details.
318
+ Copyright (c) 2013-2022 Jan Graichen. MIT license, see LICENSE for more details.
data/acfs.gemspec CHANGED
@@ -16,6 +16,8 @@ Gem::Specification.new do |spec|
16
16
  An abstract API base client for service oriented application.
17
17
  SUMMARY
18
18
 
19
+ spec.metadata['rubygems_mfa_required'] = 'true'
20
+
19
21
  spec.files = Dir['**/*'].grep(%r{
20
22
  ^((bin|lib|test|spec|features)/|
21
23
  .*\.gemspec|.*LICENSE.*|.*README.*|.*CHANGELOG.*)
@@ -7,7 +7,7 @@ module Acfs
7
7
  DEFAULT_OPTIONS = {
8
8
  tcp_keepalive: true,
9
9
  tcp_keepidle: 5,
10
- tcp_keepintvl: 5
10
+ tcp_keepintvl: 5,
11
11
  }.freeze
12
12
 
13
13
  # Adapter for Typhoeus.
@@ -16,8 +16,10 @@ module Acfs
16
16
  def initialize(**kwargs)
17
17
  super
18
18
 
19
+ extra_opts = kwargs.delete(:opts)
20
+
19
21
  @opts = DEFAULT_OPTIONS
20
- @opts = @opts.merge(opts) if (opts = kwargs.delete(:opts))
22
+ @opts = @opts.merge(extra_opts) if extra_opts
21
23
  @kwargs = kwargs
22
24
  end
23
25
 
@@ -50,9 +52,9 @@ module Acfs
50
52
  params: req.params,
51
53
  headers: req.headers.merge(
52
54
  'Expect' => '',
53
- 'Transfer-Encoding' => ''
55
+ 'Transfer-Encoding' => '',
54
56
  ),
55
- body: req.body
57
+ body: req.body,
56
58
  }
57
59
 
58
60
  request = ::Typhoeus::Request.new(req.url, **@opts, **opts)
@@ -28,7 +28,7 @@ module Acfs
28
28
  #
29
29
  def configure(&block)
30
30
  if block.arity.positive?
31
- block.call self
31
+ yield self
32
32
  else
33
33
  instance_eval(&block)
34
34
  end
@@ -70,8 +70,8 @@ module Acfs
70
70
  # @return [undefined]
71
71
  #
72
72
  def load(filename)
73
- config = YAML.safe_load(File.read(filename), [], [], true)
74
- env = ENV['RACK_ENV'] || ENV['RAILS_ENV'] || 'development'
73
+ config = load_yaml_file(filename)
74
+ env = ENV['RACK_ENV'] || ENV['RAILS_ENV'] || 'development'
75
75
 
76
76
  config = config[env] if config.key? env
77
77
  config.each do |key, value|
@@ -116,5 +116,15 @@ module Acfs
116
116
  @current = configuration if configuration.is_a? Configuration
117
117
  end
118
118
  end
119
+
120
+ private
121
+
122
+ def load_yaml_file(path)
123
+ if YAML.respond_to?(:safe_load_file)
124
+ YAML.safe_load_file(path, aliases: true)
125
+ else
126
+ YAML.safe_load(File.read(path), [], [], true)
127
+ end
128
+ end
119
129
  end
120
130
  end
data/lib/acfs/errors.rb CHANGED
@@ -5,7 +5,7 @@ module Acfs
5
5
  #
6
6
  class Error < StandardError
7
7
  def initialize(opts = {}, message = nil)
8
- opts.merge! message: message if message
8
+ opts[:message] = message if message
9
9
  super opts[:message]
10
10
  end
11
11
  end
data/lib/acfs/global.rb CHANGED
@@ -71,12 +71,12 @@ module Acfs
71
71
  def add_callback(resource, &block)
72
72
  unless resource.respond_to?(:__callbacks__)
73
73
  raise ArgumentError.new 'Given resource is not an Acfs resource ' \
74
- "delegator but a: #{resource.class.name}"
74
+ "delegator but a: #{resource.class.name}"
75
75
  end
76
76
  return false if block.nil?
77
77
 
78
78
  if resource.nil? || resource.loaded?
79
- block.call resource
79
+ yield resource
80
80
  else
81
81
  resource.__callbacks__ << block
82
82
  end
data/lib/acfs/location.rb CHANGED
@@ -30,7 +30,7 @@ module Acfs
30
30
 
31
31
  def str
32
32
  uri = raw.dup
33
- uri.path = "/#{struct.map(&method(:lookup_variable)).join('/')}"
33
+ uri.path = "/#{struct.map {|s| lookup_variable(s) }.join('/')}"
34
34
  uri.to_s
35
35
  end
36
36
 
@@ -56,7 +56,7 @@ module Acfs
56
56
 
57
57
  def request
58
58
  request = ::Acfs::Request.new url, method: method, params: params,
59
- data: data, operation: self
59
+ data: data, operation: self
60
60
  request.on_complete do |response|
61
61
  ::ActiveSupport::Notifications.instrument 'acfs.operation.complete',
62
62
  operation: self,
@@ -21,7 +21,7 @@ module Acfs
21
21
  # @return [ Acfs::Request ] The request itself.
22
22
  #
23
23
  def on_complete(&block)
24
- callbacks.insert 0, block if block_given?
24
+ callbacks.insert 0, block if block
25
25
  self
26
26
  end
27
27
 
data/lib/acfs/request.rb CHANGED
@@ -22,7 +22,7 @@ module Acfs
22
22
 
23
23
  @operation = options.delete(:operation) || nil
24
24
 
25
- on_complete(&block) if block_given?
25
+ on_complete(&block) if block
26
26
  end
27
27
 
28
28
  def data?
@@ -35,7 +35,7 @@ module Acfs::Resource::Attributes
35
35
  def cast_value(value)
36
36
  if value.blank?
37
37
  nil
38
- elsif value.to_s =~ UUID_REGEXP
38
+ elsif UUID_REGEXP.match?(value.to_s)
39
39
  value
40
40
  else
41
41
  raise TypeError.new "Invalid UUID: `#{value}'"
@@ -116,8 +116,8 @@ class Acfs::Resource
116
116
  return nil if need_primary_key? && !primary_key?
117
117
 
118
118
  self.class.service
119
- .location(self.class, **opts, action: :read)
120
- .build(attributes).str
119
+ .location(self.class, **opts, action: :read)
120
+ .build(attributes).str
121
121
  end
122
122
 
123
123
  # @api private
@@ -139,7 +139,7 @@ class Acfs::Resource
139
139
  find_by params do |m|
140
140
  if m.nil?
141
141
  raise Acfs::ResourceNotFound.new message: 'Received erroneous ' \
142
- "response: no `#{name}` with params #{params} found"
142
+ "response: no `#{name}` with params #{params} found"
143
143
  end
144
144
  block&.call m
145
145
  end
@@ -210,7 +210,7 @@ class Acfs::Resource
210
210
  model = Acfs::Util::ResourceDelegator.new new
211
211
 
212
212
  opts[:params] ||= {}
213
- opts[:params].merge! id: id unless id.nil?
213
+ opts[:params][:id] = id unless id.nil?
214
214
 
215
215
  model.__callbacks__ << block unless block.nil?
216
216
 
data/lib/acfs/runner.rb CHANGED
@@ -17,16 +17,16 @@ module Acfs
17
17
  # Process an operation. Synchronous operations will be run
18
18
  # and parallel operations will be queued.
19
19
  #
20
- def process(op)
21
- ::ActiveSupport::Notifications.instrument 'acfs.operation.before_process', operation: op
22
- op.synchronous? ? run(op) : enqueue(op)
20
+ def process(operation)
21
+ ::ActiveSupport::Notifications.instrument('acfs.operation.before_process', operation: operation)
22
+ operation.synchronous? ? run(operation) : enqueue(operation)
23
23
  end
24
24
 
25
25
  # Run operation right now skipping queue.
26
26
  #
27
- def run(op)
28
- ::ActiveSupport::Notifications.instrument 'acfs.runner.sync_run', operation: op do
29
- op_request(op) {|req| adapter.run req }
27
+ def run(operation)
28
+ ::ActiveSupport::Notifications.instrument('acfs.runner.sync_run', operation: operation) do
29
+ operation_request(operation) {|req| adapter.run req }
30
30
  end
31
31
  end
32
32
 
@@ -38,12 +38,12 @@ module Acfs
38
38
 
39
39
  # Enqueue operation to be run later.
40
40
  #
41
- def enqueue(op)
42
- ::ActiveSupport::Notifications.instrument 'acfs.runner.enqueue', operation: op do
41
+ def enqueue(operation)
42
+ ::ActiveSupport::Notifications.instrument('acfs.runner.enqueue', operation: operation) do
43
43
  if running?
44
- op_request(op) {|req| adapter.queue req }
44
+ operation_request(operation) {|req| adapter.queue req }
45
45
  else
46
- queue << op
46
+ queue << operation
47
47
  end
48
48
  end
49
49
  end
@@ -82,15 +82,15 @@ module Acfs
82
82
  end
83
83
 
84
84
  def enqueue_operations
85
- while (op = queue.shift)
86
- op_request(op) {|req| adapter.queue req }
85
+ while (operation = queue.shift)
86
+ operation_request(operation) {|req| adapter.queue req }
87
87
  end
88
88
  end
89
89
 
90
- def op_request(op)
91
- return if Acfs::Stub.enabled? && Acfs::Stub.stubbed(op)
90
+ def operation_request(operation)
91
+ return if Acfs::Stub.enabled? && Acfs::Stub.stubbed(operation)
92
92
 
93
- req = op.service.prepare op.request
93
+ req = operation.service.prepare(operation.request)
94
94
  return unless req.is_a? Acfs::Request
95
95
 
96
96
  req = prepare req
data/lib/acfs/stub.rb CHANGED
@@ -21,11 +21,11 @@ module Acfs
21
21
  end
22
22
  end
23
23
 
24
- def accept?(op)
25
- return opts[:with].call(op) if opts[:with].respond_to?(:call)
24
+ def accept?(operation)
25
+ return opts[:with].call(operation) if opts[:with].respond_to?(:call)
26
26
 
27
- params = op.full_params.stringify_keys
28
- data = op.data.stringify_keys
27
+ params = operation.full_params.stringify_keys
28
+ data = operation.data.stringify_keys
29
29
  with = opts[:with]
30
30
 
31
31
  return true if with.nil?
@@ -33,10 +33,10 @@ module Acfs
33
33
  case opts.fetch(:match, :inclusion)
34
34
  when :legacy
35
35
  return true if with.empty? && params.empty? && data.empty?
36
- if with.reject {|_, v| v.nil? } == params.reject {|_, v| v.nil? }
36
+ if with.compact == params.compact
37
37
  return true
38
38
  end
39
- if with.reject {|_, v| v.nil? } == data.reject {|_, v| v.nil? }
39
+ if with.compact == data.compact
40
40
  return true
41
41
  end
42
42
 
@@ -58,22 +58,25 @@ module Acfs
58
58
  count.nil? ? calls.any? : calls.size == count
59
59
  end
60
60
 
61
- def call(op)
62
- calls << op
61
+ def call(operation)
62
+ calls << operation
63
63
 
64
64
  err = opts[:raise]
65
65
  data = opts[:return]
66
66
 
67
67
  if err
68
- raise_error op, err, opts[:return]
68
+ raise_error(operation, err, opts[:return])
69
69
  elsif data
70
- data = data.call(op) if data.respond_to?(:call)
70
+ data = data.call(operation) if data.respond_to?(:call)
71
71
 
72
- response = Acfs::Response.new op.request,
72
+ response = Acfs::Response.new(
73
+ operation.request,
73
74
  headers: opts[:headers] || {},
74
75
  status: opts[:status] || 200,
75
- data: data || {}
76
- op.call data, response
76
+ data: data || {},
77
+ )
78
+
79
+ operation.call(data, response)
77
80
  else
78
81
  raise ArgumentError.new 'Unsupported stub.'
79
82
  end
@@ -81,15 +84,17 @@ module Acfs
81
84
 
82
85
  private
83
86
 
84
- def raise_error(op, name, data)
87
+ def raise_error(operation, name, data)
85
88
  raise name if name.is_a? Class
86
89
 
87
90
  data.stringify_keys! if data.respond_to?(:stringify_keys!)
88
91
 
89
- op.handle_failure ::Acfs::Response.new(
90
- op.request,
91
- status: Rack::Utils.status_code(name),
92
- data: data
92
+ operation.handle_failure(
93
+ ::Acfs::Response.new(
94
+ operation.request,
95
+ status: Rack::Utils.status_code(name),
96
+ data: data,
97
+ ),
93
98
  )
94
99
  end
95
100
 
@@ -140,35 +145,35 @@ module Acfs
140
145
  @stubs ||= {}
141
146
  end
142
147
 
143
- def stub_for(op)
144
- return false unless (classes = stubs[op.resource])
145
- return false unless (stubs = classes[op.action])
148
+ def stub_for(operation)
149
+ return false unless (classes = stubs[operation.resource])
150
+ return false unless (stubs = classes[operation.action])
146
151
 
147
- accepted_stubs = stubs.select {|stub| stub.accept? op }
152
+ accepted_stubs = stubs.select {|stub| stub.accept?(operation) }
148
153
 
149
154
  if accepted_stubs.size > 1
150
- raise AmbiguousStubError.new stubs: accepted_stubs, operation: op
155
+ raise AmbiguousStubError.new(stubs: accepted_stubs, operation: operation)
151
156
  end
152
157
 
153
158
  accepted_stubs.first
154
159
  end
155
160
 
156
- def stubbed(op)
157
- stub = stub_for op
161
+ def stubbed(operation)
162
+ stub = stub_for(operation)
158
163
  unless stub
159
164
  return false if allow_requests?
160
165
 
161
166
  raise RealRequestsNotAllowedError.new <<~ERROR
162
- No stub found for `#{op.action}' on `#{op.resource.name}' \
163
- with params `#{op.full_params.inspect}', data `#{op.data.inspect}' \
164
- and id `#{op.id}'.
167
+ No stub found for `#{operation.action}' on `#{operation.resource.name}' \
168
+ with params `#{operation.full_params.inspect}', data `#{operation.data.inspect}' \
169
+ and id `#{operation.id}'.
165
170
 
166
171
  Available stubs:
167
172
  #{pretty_print}
168
173
  ERROR
169
174
  end
170
175
 
171
- stub.call op
176
+ stub.call(operation)
172
177
  true
173
178
  end
174
179
 
data/lib/acfs/version.rb CHANGED
@@ -3,11 +3,11 @@
3
3
  module Acfs
4
4
  module VERSION
5
5
  MAJOR = 1
6
- MINOR = 6
6
+ MINOR = 7
7
7
  PATCH = 0
8
8
  STAGE = nil
9
9
 
10
- STRING = [MAJOR, MINOR, PATCH, STAGE].reject(&:nil?).join('.')
10
+ STRING = [MAJOR, MINOR, PATCH, STAGE].compact.join('.')
11
11
 
12
12
  def self.to_s
13
13
  STRING
@@ -20,7 +20,7 @@ describe Acfs::Adapter::Typhoeus do
20
20
  adapter.queue request2
21
21
 
22
22
  expect { adapter.start }.to raise_error(/404-[12]/)
23
- expect { adapter.start }.to_not raise_error
23
+ expect { adapter.start }.not_to raise_error
24
24
  end
25
25
 
26
26
  it 'raises timeout' do