parameters 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.
data/.yardopts CHANGED
@@ -1 +1 @@
1
- --quiet --markup markdown --title 'Parameters Documentation' --protected
1
+ --markup markdown --title 'Parameters Documentation' --protected
@@ -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 {Parameters::ClassMethods#included}, so that
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 {Parameters::Param#coerce_hash}.
58
+ * Added `Parameters::Param#coerce_hash`.
53
59
  * Allow a `Proc` to be given as the coercion type for
54
- {Parameters::Param#coerce_type}.
60
+ `Parameters::Param#coerce_type`.
55
61
  * Allow custom classes to be used for coercion types.
56
- * Ruby 1.8.6 bug fixes for {Parameters::Param#coerce_type}.
62
+ * Ruby 1.8.6 bug fixes for `Parameters::Param#coerce_type`.
57
63
 
58
64
  ### 0.2.0 / 2010-02-18
59
65
 
@@ -30,7 +30,7 @@ module Parameters
30
30
  #
31
31
  # Sets the value of the class param.
32
32
  #
33
- # @param [Object] value
33
+ # @param [Object] new_value
34
34
  # The new value of the class param.
35
35
  #
36
36
  # @return [Object]
@@ -32,7 +32,7 @@ module Parameters
32
32
 
33
33
  @object = object
34
34
 
35
- if (self.value.nil? && value)
35
+ if (self.value.nil? && !value.nil?)
36
36
  self.value = case value
37
37
  when Proc
38
38
  if value.arity > 0
@@ -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
- else
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
- else
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] 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] type
88
+ # @param [Type] other
89
89
  # The other instance or class type.
90
90
  #
91
91
  # @return [::Boolean]
@@ -1,4 +1,4 @@
1
1
  module Parameters
2
2
  # The version of parameters
3
- VERSION = '0.4.2'
3
+ VERSION = '0.4.3'
4
4
  end
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.2
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-05-28 00:00:00.000000000 Z
12
+ date: 2012-06-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rubygems-tasks