abid 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/abid/play.rb +0 -14
- data/lib/abid/play_core.rb +20 -1
- data/lib/abid/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 420b0b4d396c11040c6ff76cb6c11cfcd002dac2
|
4
|
+
data.tar.gz: 32ffa75a6ba088fda3d027f1a00903be37859e91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf79d8b03440fd6bca0c1ff8c0e03402ea9f97cb4ae8c0d391ef98a447bee75ada478ab24672fb86c9cb493164d596b568e2e11d711603237d85b7d665acb0e1
|
7
|
+
data.tar.gz: c67971534d3a2d5e397a0c73c5ab49bdb147ef7376292372c90b4aa70f90e1268ce1c153e1f3c6e34a575737cd3ec75e596886ae56c22ead72d7e09e48f4549a
|
data/lib/abid/play.rb
CHANGED
@@ -12,20 +12,6 @@ module Abid
|
|
12
12
|
hooks.each { |k, v| child.hooks[k] = v.dup }
|
13
13
|
end
|
14
14
|
|
15
|
-
def params_spec
|
16
|
-
@params_spec ||= {}
|
17
|
-
end
|
18
|
-
|
19
|
-
def param(name, **param_spec)
|
20
|
-
define_method(name) { task.params[name] }
|
21
|
-
params_spec[name] = { significant: true }.merge(param_spec)
|
22
|
-
end
|
23
|
-
|
24
|
-
def undef_param(name)
|
25
|
-
params_spec.delete(name)
|
26
|
-
undef_method(name) if method_defined?(name)
|
27
|
-
end
|
28
|
-
|
29
15
|
def hooks
|
30
16
|
@hooks ||= Hash.new { |h, k| h[k] = [] }
|
31
17
|
end
|
data/lib/abid/play_core.rb
CHANGED
@@ -15,6 +15,20 @@ module Abid
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
+
def params_spec
|
19
|
+
@params_spec ||= {}
|
20
|
+
end
|
21
|
+
|
22
|
+
def param(name, **param_spec)
|
23
|
+
define_method(name) { task.params[name] }
|
24
|
+
params_spec[name] = { significant: true }.merge(param_spec)
|
25
|
+
end
|
26
|
+
|
27
|
+
def undef_param(name)
|
28
|
+
params_spec.delete(name)
|
29
|
+
undef_method(name) if method_defined?(name)
|
30
|
+
end
|
31
|
+
|
18
32
|
def include(*mod)
|
19
33
|
ms = mod.map do |m|
|
20
34
|
if m.is_a? Module
|
@@ -24,7 +38,12 @@ module Abid
|
|
24
38
|
|
25
39
|
fail "#{m} is not a mixin" unless mixin_task.is_a? MixinTask
|
26
40
|
|
27
|
-
mixin_task.mixin
|
41
|
+
mixin_task.mixin.tap do |mixin|
|
42
|
+
# inherit params_spec
|
43
|
+
mixin.params_spec.each do |k, v|
|
44
|
+
params_spec[k] ||= v
|
45
|
+
end
|
46
|
+
end
|
28
47
|
end
|
29
48
|
end
|
30
49
|
|
data/lib/abid/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: abid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hikaru Ojima
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
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: bundler
|