evrone-common-rack-builder 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/evrone/common/rack/builder.rb +2 -20
- data/lib/evrone/common/rack/builder/version.rb +1 -1
- data/spec/lib/builder_spec.rb +1 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ba65815360612b54d14c38a0685f7a15ccd7d3f
|
4
|
+
data.tar.gz: c42815371b5ae2ba3f49b8d660bd20e6adaff0f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64715343c10daad4d70c7b4706c5d25050b1b96c2d1074d9514b72940e35249814236866ae2425f4b89af052f780e64b7cc83e54e1acae9c6b764bda2298d40d
|
7
|
+
data.tar.gz: db06381bd7e796df611ebe26573d2adf68f060e9b0374a3e0fd5dfcdacd8a8882b69aa09e439b6c51c6d7a6b564559d99ab9dbc88e4efe1759320cf791d96f1d
|
@@ -41,26 +41,8 @@ module Evrone
|
|
41
41
|
@use << proc { |app| middleware.new(app, *args, &block) }
|
42
42
|
end
|
43
43
|
|
44
|
-
|
45
|
-
|
46
|
-
#
|
47
|
-
# run lambda { |env| [200, { "Content-Type" => "text/plain" }, ["OK"]] }
|
48
|
-
#
|
49
|
-
# However this could also be a class:
|
50
|
-
#
|
51
|
-
# class Heartbeat
|
52
|
-
# def self.call(env)
|
53
|
-
# [200, { "Content-Type" => "text/plain" }, ["OK"]]
|
54
|
-
# end
|
55
|
-
# end
|
56
|
-
#
|
57
|
-
# run Heartbeat
|
58
|
-
def run(app)
|
59
|
-
@run = app
|
60
|
-
end
|
61
|
-
|
62
|
-
def to_app
|
63
|
-
app = @run
|
44
|
+
def to_app(app)
|
45
|
+
app ||= @run
|
64
46
|
fail "missing run or map statement" unless app
|
65
47
|
@use.reverse.inject(app) { |a,e| e[a] }
|
66
48
|
end
|
data/spec/lib/builder_spec.rb
CHANGED
@@ -29,8 +29,7 @@ describe Evrone::Common::Rack::Builder do
|
|
29
29
|
it "should be work" do
|
30
30
|
env = []
|
31
31
|
app = ->(c){ c << 'run' }
|
32
|
-
builder.
|
33
|
-
rs = builder.call env
|
32
|
+
rs = builder.to_app(app).call env
|
34
33
|
expect(rs).to eq %w{ first.begin last.begin run last.end first.end }
|
35
34
|
end
|
36
35
|
end
|