acfs 0.48.0 → 0.48.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/acfs/service/middleware/stack.rb +38 -9
- data/lib/acfs/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c4bc9142d3a83a09440042357b748849c822016
|
4
|
+
data.tar.gz: 9e21e07911af3cedbedb3d33ada6588e38095ce2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fcae3ab559b7f106f2b2c3dfa8e6bb41ebaba3ba9ec0278fd81280c9946b5cf67003cd33c68144a9d9d94a264bed4174dd4796eef3b02a31cb3f7a5423467bc7
|
7
|
+
data.tar.gz: 4c1358d8aec1e99f7f4d19075862ec76f75e1b38f92cf18eeea2a5a5e98815fa86646f1177e3554feeb4df29d17dd539b803c53d2afee2270ba7d55ea0f7e68e
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 1.0.0
|
4
|
+
|
5
|
+
* Switch to first non-development major as it's long time used in production.
|
6
|
+
* Fix NewRelic RPM inference with middleware stack inherited from `ActionDispatch::MiddlewareStack`.
|
7
|
+
|
3
8
|
## 0.48.0
|
4
9
|
|
5
10
|
* Remove #attribute_types broke since f7e4109 (Sep 2013, v0.23)
|
@@ -1,28 +1,57 @@
|
|
1
|
-
require 'action_dispatch/middleware/stack'
|
2
|
-
|
3
1
|
module Acfs
|
4
2
|
class Service
|
5
3
|
module Middleware
|
6
|
-
class Stack
|
4
|
+
class Stack
|
5
|
+
include Enumerable
|
6
|
+
|
7
7
|
MUTEX = Mutex.new
|
8
8
|
IDENTITY = -> (i) { i }
|
9
9
|
|
10
|
+
attr_reader :middlewares
|
11
|
+
|
12
|
+
def initialize
|
13
|
+
@middlewares = []
|
14
|
+
end
|
15
|
+
|
16
|
+
def call(request)
|
17
|
+
build! unless @app
|
18
|
+
|
19
|
+
@app.call request
|
20
|
+
end
|
21
|
+
|
10
22
|
def build!
|
23
|
+
return if @app
|
24
|
+
|
11
25
|
MUTEX.synchronize do
|
12
|
-
return if @
|
26
|
+
return if @app
|
13
27
|
|
14
|
-
@
|
28
|
+
@app = build
|
15
29
|
end
|
16
30
|
end
|
17
31
|
|
18
32
|
def build(app = IDENTITY)
|
19
|
-
|
33
|
+
middlewares.reverse.inject(app) do |next_middleware, current_middleware|
|
34
|
+
klass, args, block = current_middleware
|
35
|
+
args ||= []
|
36
|
+
|
37
|
+
if klass.is_a?(Class)
|
38
|
+
klass.new(next_middleware, *args, &block)
|
39
|
+
elsif klass.respond_to?(:call)
|
40
|
+
lambda do |env|
|
41
|
+
next_middleware.call(klass.call(env, *args))
|
42
|
+
end
|
43
|
+
else
|
44
|
+
fail "Invalid middleware, doesn't respond to `call`: #{klass.inspect}"
|
45
|
+
end
|
46
|
+
end
|
20
47
|
end
|
21
48
|
|
22
|
-
def
|
23
|
-
|
49
|
+
def insert(index, klass, *args, &block)
|
50
|
+
middlewares.insert(index, [klass, args, block])
|
51
|
+
end
|
24
52
|
|
25
|
-
|
53
|
+
def each
|
54
|
+
middlewares.each { |x| yield x.first }
|
26
55
|
end
|
27
56
|
|
28
57
|
def clear
|
data/lib/acfs/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acfs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.48.
|
4
|
+
version: 0.48.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Graichen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -228,7 +228,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
228
228
|
version: '0'
|
229
229
|
requirements: []
|
230
230
|
rubyforge_project:
|
231
|
-
rubygems_version: 2.
|
231
|
+
rubygems_version: 2.5.1
|
232
232
|
signing_key:
|
233
233
|
specification_version: 4
|
234
234
|
summary: An abstract API base client for service oriented application.
|
@@ -271,4 +271,3 @@ test_files:
|
|
271
271
|
- spec/support/response.rb
|
272
272
|
- spec/support/service.rb
|
273
273
|
- spec/support/shared/find_callbacks.rb
|
274
|
-
has_rdoc:
|