tumugi 0.4.2 → 0.4.3
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 +14 -2
- data/lib/tumugi/mixin/parameterizable.rb +13 -4
- data/lib/tumugi/parameter/parameter.rb +2 -3
- data/lib/tumugi/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: e0da0502fdc3a3597274e65a853e7433393f07b1
|
4
|
+
data.tar.gz: 5f135e5d6dc31bbd0f61fae38de75febe63c9f97
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f50123341f96baf3c9b39e05dd1f3cc5730e0d36cc5f2b2c22b4cfc55b57778cf6c5813a663ebfd18b4615066c32c74af8d70bb7fc6afed283ae9c229441b405
|
7
|
+
data.tar.gz: 6e2db1837fd0edca19cbe15069569f9de41b8ff4d9ecd3ee9ec18a4336928c66e2a54e80532124f4ba784ae4d8bec037095d90fcbbf9b01a31a165b472bc88b3
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,18 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
-
## [0.4.
|
4
|
-
[Full Changelog](https://github.com/tumugi/tumugi/compare/v0.4.
|
3
|
+
## [0.4.3](https://github.com/tumugi/tumugi/tree/0.4.3) (2016-05-12)
|
4
|
+
[Full Changelog](https://github.com/tumugi/tumugi/compare/v0.4.2...0.4.3)
|
5
|
+
|
6
|
+
**Implemented enhancements:**
|
7
|
+
|
8
|
+
- Param set accept proc [\#45](https://github.com/tumugi/tumugi/pull/45) ([hakobera](https://github.com/hakobera))
|
9
|
+
|
10
|
+
**Fixed bugs:**
|
11
|
+
|
12
|
+
- Fix param\_set in subclass overrite parent class param [\#44](https://github.com/tumugi/tumugi/pull/44) ([hakobera](https://github.com/hakobera))
|
13
|
+
|
14
|
+
## [v0.4.2](https://github.com/tumugi/tumugi/tree/v0.4.2) (2016-05-10)
|
15
|
+
[Full Changelog](https://github.com/tumugi/tumugi/compare/v0.4.1...v0.4.2)
|
5
16
|
|
6
17
|
**Fixed bugs:**
|
7
18
|
|
@@ -9,6 +20,7 @@
|
|
9
20
|
|
10
21
|
**Merged pull requests:**
|
11
22
|
|
23
|
+
- Prepare release for v0.4.2 [\#43](https://github.com/tumugi/tumugi/pull/43) ([hakobera](https://github.com/hakobera))
|
12
24
|
- Fix parent class parameters are not visible in a subclass [\#42](https://github.com/tumugi/tumugi/pull/42) ([hakobera](https://github.com/hakobera))
|
13
25
|
|
14
26
|
## [v0.4.1](https://github.com/tumugi/tumugi/tree/v0.4.1) (2016-05-09)
|
@@ -11,10 +11,11 @@ module Tumugi
|
|
11
11
|
def initialize
|
12
12
|
super()
|
13
13
|
proxy = self.class.merged_parameter_proxy
|
14
|
-
params = proxy.params
|
14
|
+
params = proxy.params.dup
|
15
15
|
proxy.param_defaults.each do |name, value|
|
16
|
-
|
17
|
-
|
16
|
+
if params[name]
|
17
|
+
params[name] = params[name].merge_default_value(value)
|
18
|
+
end
|
18
19
|
end
|
19
20
|
params.each do |name, param|
|
20
21
|
unless proxy.param_auto_bind_enabled.nil?
|
@@ -56,7 +57,15 @@ module Tumugi
|
|
56
57
|
|
57
58
|
def param(name, opts={})
|
58
59
|
parameter_proxy(proxy_id).param(name, opts)
|
59
|
-
|
60
|
+
attr_writer name
|
61
|
+
define_method(name) do
|
62
|
+
val = self.instance_variable_get("@#{name}")
|
63
|
+
if val.instance_of?(Proc)
|
64
|
+
self.instance_exec(&val)
|
65
|
+
else
|
66
|
+
val
|
67
|
+
end
|
68
|
+
end
|
60
69
|
end
|
61
70
|
|
62
71
|
def param_set(name, value)
|
@@ -48,9 +48,8 @@ module Tumugi
|
|
48
48
|
@opts[:default] || nil
|
49
49
|
end
|
50
50
|
|
51
|
-
def
|
52
|
-
@opts
|
53
|
-
@opts[:default] = value
|
51
|
+
def merge_default_value(value)
|
52
|
+
self.class.new(@name, @opts.merge(required: false, default: value))
|
54
53
|
end
|
55
54
|
|
56
55
|
private
|
data/lib/tumugi/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tumugi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kazuyuki Honda
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parallel
|