acfs 0.42.0 → 0.43.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 +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +8 -9
- data/acfs.gemspec +3 -3
- data/lib/acfs.rb +0 -2
- data/lib/acfs/adapter/base.rb +0 -2
- data/lib/acfs/adapter/typhoeus.rb +6 -9
- data/lib/acfs/collection.rb +3 -3
- data/lib/acfs/collections/paginatable.rb +16 -16
- data/lib/acfs/configuration.rb +3 -5
- data/lib/acfs/errors.rb +8 -7
- data/lib/acfs/global.rb +1 -1
- data/lib/acfs/location.rb +11 -11
- data/lib/acfs/middleware/base.rb +1 -2
- data/lib/acfs/middleware/json.rb +0 -1
- data/lib/acfs/middleware/logger.rb +0 -2
- data/lib/acfs/middleware/print.rb +0 -2
- data/lib/acfs/middleware/serializer.rb +3 -6
- data/lib/acfs/operation.rb +3 -4
- data/lib/acfs/request.rb +2 -3
- data/lib/acfs/request/callbacks.rb +2 -3
- data/lib/acfs/resource.rb +34 -5
- data/lib/acfs/{model → resource}/attributes.rb +70 -46
- data/lib/acfs/{model → resource}/attributes/base.rb +10 -6
- data/lib/acfs/resource/attributes/boolean.rb +33 -0
- data/lib/acfs/resource/attributes/date_time.rb +32 -0
- data/lib/acfs/{model → resource}/attributes/dict.rb +1 -3
- data/lib/acfs/{model → resource}/attributes/float.rb +3 -6
- data/lib/acfs/{model → resource}/attributes/integer.rb +3 -6
- data/lib/acfs/{model → resource}/attributes/list.rb +2 -5
- data/lib/acfs/{model → resource}/attributes/string.rb +4 -6
- data/lib/acfs/{model → resource}/attributes/uuid.rb +18 -8
- data/lib/acfs/resource/dirty.rb +47 -0
- data/lib/acfs/{model → resource}/initialization.rb +8 -10
- data/lib/acfs/{model → resource}/loadable.rb +3 -4
- data/lib/acfs/{model → resource}/locatable.rb +22 -23
- data/lib/acfs/{model → resource}/operational.rb +2 -3
- data/lib/acfs/resource/persistence.rb +257 -0
- data/lib/acfs/{model → resource}/query_methods.rb +81 -66
- data/lib/acfs/{model → resource}/service.rb +10 -9
- data/lib/acfs/resource/validation.rb +28 -0
- data/lib/acfs/response.rb +1 -2
- data/lib/acfs/response/formats.rb +1 -2
- data/lib/acfs/response/status.rb +3 -5
- data/lib/acfs/runner.rb +4 -5
- data/lib/acfs/service.rb +4 -6
- data/lib/acfs/service/middleware.rb +1 -3
- data/lib/acfs/singleton_resource.rb +11 -24
- data/lib/acfs/stub.rb +30 -22
- data/lib/acfs/util.rb +1 -1
- data/lib/acfs/version.rb +4 -2
- data/spec/acfs/adapter/typhoeus_spec.rb +4 -4
- data/spec/acfs/collection_spec.rb +33 -33
- data/spec/acfs/configuration_spec.rb +0 -1
- data/spec/acfs/global_spec.rb +3 -3
- data/spec/acfs/middleware/json_spec.rb +2 -2
- data/spec/acfs/middleware/msgpack_spec.rb +4 -4
- data/spec/acfs/request/callbacks_spec.rb +8 -8
- data/spec/acfs/request_spec.rb +5 -5
- data/spec/acfs/{model → resource}/attributes/boolean_spec.rb +2 -2
- data/spec/acfs/{model → resource}/attributes/date_time_spec.rb +7 -7
- data/spec/acfs/{model → resource}/attributes/dict_spec.rb +6 -6
- data/spec/acfs/{model → resource}/attributes/float_spec.rb +3 -3
- data/spec/acfs/{model → resource}/attributes/list_spec.rb +5 -5
- data/spec/acfs/{model → resource}/attributes/uuid_spec.rb +6 -6
- data/spec/acfs/{model → resource}/attributes_spec.rb +31 -17
- data/spec/acfs/{model → resource}/dirty_spec.rb +7 -5
- data/spec/acfs/{model → resource}/initialization_spec.rb +7 -7
- data/spec/acfs/{model → resource}/loadable_spec.rb +4 -3
- data/spec/acfs/{model → resource}/locatable_spec.rb +24 -14
- data/spec/acfs/{model → resource}/persistance_spec.rb +34 -34
- data/spec/acfs/{model → resource}/query_methods_spec.rb +171 -130
- data/spec/acfs/{model → resource}/validation_spec.rb +5 -6
- data/spec/acfs/response/formats_spec.rb +1 -1
- data/spec/acfs/response/status_spec.rb +1 -1
- data/spec/acfs/runner_spec.rb +2 -3
- data/spec/acfs/service/middleware_spec.rb +1 -1
- data/spec/acfs/service_spec.rb +3 -5
- data/spec/acfs/singleton_resource_spec.rb +3 -3
- data/spec/acfs/stub_spec.rb +52 -24
- data/spec/acfs_spec.rb +22 -19
- data/spec/spec_helper.rb +1 -1
- data/spec/support/hash.rb +9 -0
- data/spec/support/service.rb +4 -7
- data/spec/support/shared/find_callbacks.rb +7 -7
- metadata +52 -52
- data/lib/acfs/model.rb +0 -43
- data/lib/acfs/model/attributes/boolean.rb +0 -38
- data/lib/acfs/model/attributes/date_time.rb +0 -30
- data/lib/acfs/model/dirty.rb +0 -49
- data/lib/acfs/model/persistence.rb +0 -243
- data/lib/acfs/model/relations.rb +0 -10
- data/lib/acfs/model/validation.rb +0 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f1766a2689f9c913392aa1043fe386ecef50182
|
4
|
+
data.tar.gz: de21e2406b4178106c085594630a24fe6a591f99
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb2415918968e9bc642a3d4762acbfa3a4fb9222beb16b4f1eafe138a2aeb9e53dedcd7789b14908aff2428eb6948a800f3ebe59e138fef3e5aed03d089b775f
|
7
|
+
data.tar.gz: 57ac583c1f24ff0f1c12e9d4041496e96476675c8be3d60ace5d98c1f0cec270d6419d9edf7eff533c5e218db689368a4ee92ac58172370c8f12a27b9b754c5b
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# Acfs - *API client for services*
|
2
2
|
|
3
|
-
[](http://badge.fury.io/rb/acfs)
|
4
|
+
[](https://travis-ci.org/jgraichen/acfs)
|
5
|
+
[](https://coveralls.io/r/jgraichen/acfs)
|
6
|
+
[](https://codeclimate.com/github/jgraichen/acfs)
|
7
|
+
[](https://gemnasium.com/jgraichen/acfs)
|
8
|
+
[](http://rubydoc.info/github/jgraichen/acfs/master/frames)
|
9
9
|
|
10
10
|
Acfs is a library to develop API client libraries for single services within a larger service oriented application.
|
11
11
|
|
@@ -250,8 +250,8 @@ it 'should find user number one' do
|
|
250
250
|
expect(user.name).to be == 'John Smith'
|
251
251
|
expect(user.age).to be == 32
|
252
252
|
|
253
|
-
expect(@stub).to
|
254
|
-
expect(@stub).to_not
|
253
|
+
expect(@stub).to be_called
|
254
|
+
expect(@stub).to_not be_called 5.times
|
255
255
|
end
|
256
256
|
|
257
257
|
it 'should not find user number two' do
|
@@ -288,7 +288,6 @@ Acfs supports [instrumentation via active support][1].
|
|
288
288
|
|
289
289
|
Acfs expose to following events
|
290
290
|
|
291
|
-
* `acfs.operation.before_process(operation)`: Acfs operation about to process
|
292
291
|
* `acfs.operation.complete(operation, response)`: Acfs operation completed
|
293
292
|
* `acfs.runner.sync_run(operation)`: Run operation right now skipping queue.
|
294
293
|
* `acfs.runner.enqueue(operation)`: Enqueue operation to be run later.
|
data/acfs.gemspec
CHANGED
@@ -8,13 +8,13 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = Acfs::VERSION
|
9
9
|
spec.authors = ['Jan Graichen']
|
10
10
|
spec.email = %w(jg@altimos.de)
|
11
|
-
spec.description =
|
12
|
-
spec.summary =
|
11
|
+
spec.description = 'API Client For Services'
|
12
|
+
spec.summary = 'An abstract API base client for service oriented application.'
|
13
13
|
spec.homepage = 'https://github.com/jgraichen/acfs'
|
14
14
|
spec.license = 'MIT'
|
15
15
|
|
16
16
|
spec.files = Dir['**/*'].grep(%r{^((bin|lib|test|spec|features)/|.*\.gemspec|.*LICENSE.*|.*README.*|.*CHANGELOG.*)})
|
17
|
-
spec.executables = spec.files.grep(%r{^bin/}) {
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) {|f| File.basename(f) }
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = %w(lib)
|
20
20
|
|
data/lib/acfs.rb
CHANGED
@@ -15,7 +15,6 @@ module Acfs
|
|
15
15
|
require 'acfs/collection'
|
16
16
|
require 'acfs/configuration'
|
17
17
|
require 'acfs/location'
|
18
|
-
require 'acfs/model'
|
19
18
|
require 'acfs/operation'
|
20
19
|
require 'acfs/request'
|
21
20
|
require 'acfs/resource'
|
@@ -48,4 +47,3 @@ module Acfs
|
|
48
47
|
require 'acfs/adapter/typhoeus'
|
49
48
|
end
|
50
49
|
end
|
51
|
-
|
data/lib/acfs/adapter/base.rb
CHANGED
@@ -2,11 +2,9 @@ require 'typhoeus'
|
|
2
2
|
|
3
3
|
module Acfs
|
4
4
|
module Adapter
|
5
|
-
|
6
5
|
# Adapter for Typhoeus.
|
7
6
|
#
|
8
7
|
class Typhoeus < Base
|
9
|
-
|
10
8
|
def start
|
11
9
|
hydra.run
|
12
10
|
rescue
|
@@ -14,9 +12,7 @@ module Acfs
|
|
14
12
|
raise
|
15
13
|
end
|
16
14
|
|
17
|
-
|
18
|
-
hydra.abort
|
19
|
-
end
|
15
|
+
delegate :abort, to: :hydra
|
20
16
|
|
21
17
|
def run(request)
|
22
18
|
convert_request(request).run
|
@@ -26,7 +22,8 @@ module Acfs
|
|
26
22
|
hydra.queue convert_request request
|
27
23
|
end
|
28
24
|
|
29
|
-
|
25
|
+
protected
|
26
|
+
|
30
27
|
def hydra
|
31
28
|
@hydra ||= ::Typhoeus::Hydra.new
|
32
29
|
end
|
@@ -50,9 +47,9 @@ module Acfs
|
|
50
47
|
|
51
48
|
def convert_response(request, response)
|
52
49
|
Acfs::Response.new request,
|
53
|
-
|
54
|
-
|
55
|
-
|
50
|
+
status: response.code,
|
51
|
+
headers: response.headers,
|
52
|
+
body: response.body
|
56
53
|
end
|
57
54
|
end
|
58
55
|
end
|
data/lib/acfs/collection.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
require 'delegate'
|
2
2
|
|
3
|
-
require 'acfs/
|
3
|
+
require 'acfs/resource/loadable'
|
4
4
|
require 'acfs/collections/paginatable'
|
5
5
|
|
6
6
|
module Acfs
|
7
|
-
|
7
|
+
#
|
8
8
|
class Collection < ::Delegator
|
9
|
-
include
|
9
|
+
include Resource::Loadable
|
10
10
|
include Acfs::Util::Callbacks
|
11
11
|
include Collections::Paginatable
|
12
12
|
|
@@ -1,19 +1,14 @@
|
|
1
1
|
module Acfs::Collections
|
2
|
+
#
|
2
3
|
module Paginatable
|
3
4
|
extend ActiveSupport::Concern
|
4
5
|
|
5
6
|
included do
|
6
|
-
def self.operation(
|
7
|
+
def self.operation(_action, opts = {}, &_block)
|
7
8
|
opts[:url]
|
8
9
|
end
|
9
|
-
end
|
10
|
-
|
11
|
-
def total_pages
|
12
|
-
@total_pages
|
13
|
-
end
|
14
10
|
|
15
|
-
|
16
|
-
@current_page
|
11
|
+
attr_reader :total_pages, :current_page
|
17
12
|
end
|
18
13
|
|
19
14
|
def process_response(response)
|
@@ -38,20 +33,21 @@ module Acfs::Collections
|
|
38
33
|
end
|
39
34
|
|
40
35
|
def page(rel, &block)
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
raise ArgumentError.new "No relative page `#{rel}'."
|
45
|
-
end
|
36
|
+
return unless relations[rel]
|
37
|
+
|
38
|
+
@resource_class.all nil, url: relations[rel], &block
|
46
39
|
end
|
47
40
|
|
48
41
|
private
|
42
|
+
|
49
43
|
def relations
|
50
44
|
@relations ||= {}
|
51
45
|
end
|
52
46
|
|
53
47
|
def setup_headers(headers)
|
54
|
-
|
48
|
+
if headers['X-Total-Pages']
|
49
|
+
@total_pages = Integer(headers['X-Total-Pages'])
|
50
|
+
end
|
55
51
|
|
56
52
|
setup_links headers['Link'] if headers['Link']
|
57
53
|
end
|
@@ -59,13 +55,17 @@ module Acfs::Collections
|
|
59
55
|
def setup_links(links)
|
60
56
|
links.split(/,\s+/).each do |link|
|
61
57
|
if link =~ /^\s*<([^>]+)>.*\s+rel="([\w_-]+)".*$/
|
62
|
-
relations[
|
58
|
+
relations[Regexp.last_match[2]] = Regexp.last_match[1]
|
63
59
|
end
|
64
60
|
end
|
65
61
|
end
|
66
62
|
|
67
63
|
def setup_params(params)
|
68
|
-
@current_page =
|
64
|
+
@current_page = begin
|
65
|
+
Integer params.fetch(:page, 1)
|
66
|
+
rescue ArgumentError
|
67
|
+
params[:page]
|
68
|
+
end
|
69
69
|
end
|
70
70
|
end
|
71
71
|
end
|
data/lib/acfs/configuration.rb
CHANGED
@@ -2,7 +2,6 @@ require 'uri'
|
|
2
2
|
require 'yaml'
|
3
3
|
|
4
4
|
module Acfs
|
5
|
-
|
6
5
|
# Acfs configuration is used to locate services and get their base URLs.
|
7
6
|
#
|
8
7
|
class Configuration
|
@@ -28,7 +27,7 @@ module Acfs
|
|
28
27
|
if block.arity > 0
|
29
28
|
block.call self
|
30
29
|
else
|
31
|
-
instance_eval
|
30
|
+
instance_eval(&block)
|
32
31
|
end
|
33
32
|
end
|
34
33
|
|
@@ -64,10 +63,10 @@ module Acfs
|
|
64
63
|
# @return [undefined]
|
65
64
|
#
|
66
65
|
def load(filename)
|
67
|
-
config = YAML
|
66
|
+
config = YAML.load File.read filename
|
68
67
|
env = ENV['RACK_ENV'] || ENV['RAILS_ENV'] || 'development'
|
69
68
|
|
70
|
-
config = config[env] if config.
|
69
|
+
config = config[env] if config.key? env
|
71
70
|
config.each do |key, value|
|
72
71
|
case key
|
73
72
|
when 'services' then load_services value
|
@@ -88,7 +87,6 @@ module Acfs
|
|
88
87
|
end
|
89
88
|
|
90
89
|
class << self
|
91
|
-
|
92
90
|
# @api private
|
93
91
|
#
|
94
92
|
# Return current configuration object.
|
data/lib/acfs/errors.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
module Acfs
|
2
|
-
|
3
2
|
# Acfs base error.
|
4
3
|
#
|
5
4
|
class Error < StandardError
|
@@ -9,6 +8,8 @@ module Acfs
|
|
9
8
|
end
|
10
9
|
end
|
11
10
|
|
11
|
+
class UnsupportedOperation < StandardError; end
|
12
|
+
|
12
13
|
# Response error containing the responsible response object.
|
13
14
|
#
|
14
15
|
class ErroneousResponse < Error
|
@@ -21,20 +22,20 @@ module Acfs
|
|
21
22
|
message << ": #{response.code}"
|
22
23
|
if response.data
|
23
24
|
message << "\n with content:\n "
|
24
|
-
message << response.data.map{|k,v| "#{k.inspect}: #{v.inspect}"}.join("\n ")
|
25
|
+
message << response.data.map {|k, v| "#{k.inspect}: #{v.inspect}" }.join("\n ")
|
25
26
|
end
|
26
27
|
if response.headers.any?
|
27
28
|
message << "\n with headers:\n "
|
28
|
-
message << response.headers.map{|k,v| "#{k}: #{v}"}.join("\n ")
|
29
|
+
message << response.headers.map {|k, v| "#{k}: #{v}" }.join("\n ")
|
29
30
|
end
|
30
31
|
message << "\nbased on request: #{response.request.method.upcase} #{response.request.url} #{response.request.format}"
|
31
32
|
if response.request.data
|
32
33
|
message << "\n with content:\n "
|
33
|
-
message << response.request.data.map{|k,v| "#{k.inspect}: #{v.inspect}"}.join("\n ")
|
34
|
+
message << response.request.data.map {|k, v| "#{k.inspect}: #{v.inspect}" }.join("\n ")
|
34
35
|
end
|
35
36
|
if response.request.headers.any?
|
36
37
|
message << "\n with headers:\n "
|
37
|
-
message << response.request.headers.map{|k,v| "#{k}: #{v}"}.join("\n ")
|
38
|
+
message << response.request.headers.map {|k, v| "#{k}: #{v}" }.join("\n ")
|
38
39
|
end
|
39
40
|
end
|
40
41
|
super opts, message
|
@@ -50,7 +51,6 @@ module Acfs
|
|
50
51
|
|
51
52
|
super opts, 'Ambiguous stubs.'
|
52
53
|
end
|
53
|
-
|
54
54
|
end
|
55
55
|
|
56
56
|
# Resource not found error raised on a 404 response
|
@@ -58,13 +58,14 @@ module Acfs
|
|
58
58
|
class ResourceNotFound < ErroneousResponse
|
59
59
|
end
|
60
60
|
|
61
|
+
#
|
61
62
|
class InvalidResource < ErroneousResponse
|
62
63
|
attr_reader :errors, :resource
|
63
64
|
|
64
65
|
def initialize(opts = {})
|
65
66
|
@errors = opts.delete :errors
|
66
67
|
@resource = opts.delete :resource
|
67
|
-
opts[:message] ||= @errors.map{
|
68
|
+
opts[:message] ||= @errors.map {|k, v| "#{k}: #{v.join ', '}" }.join ', ' if @errors.is_a? Hash
|
68
69
|
opts[:message] ||= @errors.join ', ' if @errors.is_a? Array
|
69
70
|
super
|
70
71
|
end
|
data/lib/acfs/global.rb
CHANGED
data/lib/acfs/location.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
module Acfs
|
2
|
-
|
3
2
|
# @api private
|
4
3
|
#
|
5
4
|
# Describes a URL with placeholders.
|
@@ -7,17 +6,17 @@ module Acfs
|
|
7
6
|
class Location
|
8
7
|
attr_reader :arguments, :raw, :struct, :args
|
9
8
|
|
10
|
-
REGEXP= /^:([A-z][A-z0-9_]*)$/
|
9
|
+
REGEXP = /^:([A-z][A-z0-9_]*)$/
|
11
10
|
|
12
11
|
def initialize(uri, args = {})
|
13
12
|
@raw = URI.parse uri
|
14
13
|
@args = args
|
15
|
-
@struct = raw.path.split('/').reject(&:empty?).map{|s| s =~ REGEXP ?
|
16
|
-
@arguments = struct.select{|s| Symbol
|
14
|
+
@struct = raw.path.split('/').reject(&:empty?).map {|s| s =~ REGEXP ? Regexp.last_match[1].to_sym : s }
|
15
|
+
@arguments = struct.select {|s| s.is_a?(Symbol) }
|
17
16
|
end
|
18
17
|
|
19
18
|
def build(args = {})
|
20
|
-
unless Hash
|
19
|
+
unless args.is_a?(Hash)
|
21
20
|
raise ArgumentError.new "URI path arguments must be a hash, `#{args.inspect}' given."
|
22
21
|
end
|
23
22
|
|
@@ -25,8 +24,8 @@ module Acfs
|
|
25
24
|
end
|
26
25
|
|
27
26
|
def extract_from(*args)
|
28
|
-
args =
|
29
|
-
arguments.each{|key| collect[key] = extract_arg key, args }
|
27
|
+
args = {}.tap do |collect|
|
28
|
+
arguments.each {|key| collect[key] = extract_arg key, args }
|
30
29
|
end
|
31
30
|
|
32
31
|
build args
|
@@ -34,7 +33,7 @@ module Acfs
|
|
34
33
|
|
35
34
|
def str
|
36
35
|
uri = raw.dup
|
37
|
-
uri.path = URI.escape '/' + struct.map{|s| lookup_arg(s, args) }.join('/')
|
36
|
+
uri.path = URI.escape '/' + struct.map {|s| lookup_arg(s, args) }.join('/')
|
38
37
|
uri.to_s
|
39
38
|
end
|
40
39
|
|
@@ -44,16 +43,17 @@ module Acfs
|
|
44
43
|
alias_method :to_s, :raw_uri
|
45
44
|
|
46
45
|
private
|
46
|
+
|
47
47
|
def extract_arg(key, hashes)
|
48
48
|
hashes.each_with_index do |hash, index|
|
49
|
-
return (index == 0 ? hash.delete(key) : hash.fetch(key)) if hash.
|
49
|
+
return (index == 0 ? hash.delete(key) : hash.fetch(key)) if hash.key?(key)
|
50
50
|
end
|
51
51
|
|
52
52
|
nil
|
53
53
|
end
|
54
54
|
|
55
55
|
def lookup_arg(arg, args)
|
56
|
-
Symbol
|
56
|
+
arg.is_a?(Symbol) ? lookup_replacement(arg, args) : arg
|
57
57
|
end
|
58
58
|
|
59
59
|
def lookup_replacement(sym, args)
|
@@ -67,7 +67,7 @@ module Acfs
|
|
67
67
|
args.fetch(sym.to_s) do
|
68
68
|
args.fetch(sym) do
|
69
69
|
if args[:raise].nil? || args[:raise]
|
70
|
-
raise ArgumentError.new "URI path argument `#{sym}' missing on `#{
|
70
|
+
raise ArgumentError.new "URI path argument `#{sym}' missing on `#{self}'. Given: `#{args}.inspect'"
|
71
71
|
else
|
72
72
|
":#{sym}"
|
73
73
|
end
|
data/lib/acfs/middleware/base.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
module Acfs
|
2
2
|
module Middleware
|
3
|
-
|
4
3
|
# A base middleware that does not modify request or response.
|
5
4
|
# Can be used as super class for custom middleware implementations.
|
6
5
|
#
|
@@ -13,7 +12,7 @@ module Acfs
|
|
13
12
|
end
|
14
13
|
|
15
14
|
def call(request)
|
16
|
-
request.on_complete {
|
15
|
+
request.on_complete {|res, nxt| response(res, nxt) } if respond_to? :response
|
17
16
|
app.call(request)
|
18
17
|
end
|
19
18
|
end
|
data/lib/acfs/middleware/json.rb
CHANGED