schema_monkey 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/schema_monkey/tool/stack.rb +3 -3
- data/lib/schema_monkey/version.rb +1 -1
- data/spec/middleware_spec.rb +4 -4
- 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: fcf24614a0b60131f52dc7bdd8dae426dac1d814
|
4
|
+
data.tar.gz: 8767b57fb97dc4b5f7ff17129b0dd6ddb0850f5f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33210d7c9683c756deb46931f049b25bdd0efdd3aea15a5fd984e69fe8529f234e6c1a5ef61424628535c3414dcd3b79befe4a02c50c87e0ae695fb5d1a0f8e1
|
7
|
+
data.tar.gz: f573a50c27d09f31b0be37f86c278d6cc7b216370abfb06d015044c3c1b1ee210c33d71f052e1cf070edd4cd9690ad354b8920129400a2fa2859f0074a6cd074
|
@@ -8,7 +8,7 @@ module SchemaMonkey::Tool
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def self.is_hook?(mod)
|
11
|
-
return true if (mod.instance_methods & [:before, :around, :after, :
|
11
|
+
return true if (mod.instance_methods & [:before, :around, :after, :implement]).any?
|
12
12
|
return true if Module.const_lookup mod, "ENV"
|
13
13
|
false
|
14
14
|
end
|
@@ -37,8 +37,8 @@ module SchemaMonkey::Tool
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def call_implementation(env)
|
40
|
-
if hook = @hooks.select(&it.respond_to?(:
|
41
|
-
hook.
|
40
|
+
if hook = @hooks.select(&it.respond_to?(:implement)).last
|
41
|
+
hook.implement(env)
|
42
42
|
elsif @implementation
|
43
43
|
@implementation.call env
|
44
44
|
else
|
data/spec/middleware_spec.rb
CHANGED
@@ -27,13 +27,13 @@ describe SchemaMonkey::Middleware do
|
|
27
27
|
|
28
28
|
Given { SchemaMonkey.register make_client(1) }
|
29
29
|
|
30
|
-
Then { expect(env.result).to eq [:before1, :around_pre1, :
|
30
|
+
Then { expect(env.result).to eq [:before1, :around_pre1, :implement1, :around_post1, :after1 ] }
|
31
31
|
|
32
32
|
context "if register client2" do
|
33
33
|
|
34
34
|
Given { SchemaMonkey.register make_client(2) }
|
35
35
|
|
36
|
-
Then { expect(env.result).to eq [:before1, :before2, :around_pre1, :around_pre2, :
|
36
|
+
Then { expect(env.result).to eq [:before1, :before2, :around_pre1, :around_pre2, :implement2, :around_post2, :around_post1, :after1, :after2 ] }
|
37
37
|
end
|
38
38
|
end
|
39
39
|
end
|
@@ -84,8 +84,8 @@ describe SchemaMonkey::Middleware do
|
|
84
84
|
env.result << :"around_post#{n}"
|
85
85
|
end
|
86
86
|
|
87
|
-
def
|
88
|
-
env.result << :"
|
87
|
+
def implement(env)
|
88
|
+
env.result << :"implement#{n}"
|
89
89
|
end
|
90
90
|
end
|
91
91
|
end
|