parameters 0.4.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.yardopts +1 -1
- data/ChangeLog.md +10 -4
- data/lib/parameters/class_param.rb +1 -1
- data/lib/parameters/instance_param.rb +1 -1
- data/lib/parameters/options.rb +2 -5
- data/lib/parameters/types/type.rb +2 -2
- data/lib/parameters/version.rb +1 -1
- metadata +2 -2
data/.yardopts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
--
|
1
|
+
--markup markdown --title 'Parameters Documentation' --protected
|
data/ChangeLog.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
### 0.4.3 / 2012-06-11
|
2
|
+
|
3
|
+
* Allow defaulting Boolean parameters to `false`.
|
4
|
+
* Guard against `nil` arguments in {Parameters::Options}, when merging
|
5
|
+
values into Hash or Array parameters.
|
6
|
+
|
1
7
|
### 0.4.2 / 2012-05-28
|
2
8
|
|
3
9
|
* Fixed a typo in the gemspec, which incorrectly set
|
@@ -46,14 +52,14 @@
|
|
46
52
|
|
47
53
|
### 0.2.1 / 2010-05-05
|
48
54
|
|
49
|
-
* Added
|
55
|
+
* Added `Parameters::ClassMethods#included`, so that
|
50
56
|
{Parameters::ClassMethods} can be re-extended by mixin modules which
|
51
57
|
include {Parameters}.
|
52
|
-
* Added
|
58
|
+
* Added `Parameters::Param#coerce_hash`.
|
53
59
|
* Allow a `Proc` to be given as the coercion type for
|
54
|
-
|
60
|
+
`Parameters::Param#coerce_type`.
|
55
61
|
* Allow custom classes to be used for coercion types.
|
56
|
-
* Ruby 1.8.6 bug fixes for
|
62
|
+
* Ruby 1.8.6 bug fixes for `Parameters::Param#coerce_type`.
|
57
63
|
|
58
64
|
### 0.2.0 / 2010-02-18
|
59
65
|
|
data/lib/parameters/options.rb
CHANGED
@@ -155,7 +155,7 @@ module Parameters
|
|
155
155
|
opts.on(*args) do |value|
|
156
156
|
if param.value.nil?
|
157
157
|
param.value = value
|
158
|
-
|
158
|
+
elsif value
|
159
159
|
param.value.merge!(param.coerce(value))
|
160
160
|
end
|
161
161
|
end
|
@@ -163,7 +163,7 @@ module Parameters
|
|
163
163
|
opts.on(*args) do |value|
|
164
164
|
if param.value.nil?
|
165
165
|
param.value = value
|
166
|
-
|
166
|
+
elsif value
|
167
167
|
param.value += param.coerce(value)
|
168
168
|
end
|
169
169
|
end
|
@@ -180,9 +180,6 @@ module Parameters
|
|
180
180
|
# @param [Parameter] object
|
181
181
|
# The Class or Object which included Parameters.
|
182
182
|
#
|
183
|
-
# @param [OptionParser] opts
|
184
|
-
# The option parser to define the parameter options within.
|
185
|
-
#
|
186
183
|
# @yield [opts]
|
187
184
|
# If a block is given, it will be passed the newly created OptionParser.
|
188
185
|
#
|
@@ -65,7 +65,7 @@ module Parameters
|
|
65
65
|
#
|
66
66
|
# Determines if the instance of the type is related to another Type.
|
67
67
|
#
|
68
|
-
# @param [Type]
|
68
|
+
# @param [Type] other
|
69
69
|
# The other type class.
|
70
70
|
#
|
71
71
|
# @return [::Boolean]
|
@@ -85,7 +85,7 @@ module Parameters
|
|
85
85
|
#
|
86
86
|
# Compares the type to another instance or class type.
|
87
87
|
#
|
88
|
-
# @param [Type]
|
88
|
+
# @param [Type] other
|
89
89
|
# The other instance or class type.
|
90
90
|
#
|
91
91
|
# @return [::Boolean]
|
data/lib/parameters/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parameters
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-06-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rubygems-tasks
|