acclaim 0.4.0 → 0.4.1
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/acclaim.version +1 -1
- data/lib/acclaim/option.rb +7 -6
- data/lib/acclaim/option/arity.rb +15 -7
- metadata +3 -3
data/acclaim.version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.1
|
data/lib/acclaim/option.rb
CHANGED
@@ -153,15 +153,16 @@ module Acclaim
|
|
153
153
|
|
154
154
|
# Generate human-readable string containing this option's data.
|
155
155
|
#
|
156
|
-
# @return [String]
|
156
|
+
# @return [String] human-readable representation of this option
|
157
|
+
# @since 0.4.0
|
157
158
|
def inspect
|
158
|
-
'#<%s %s (%s) %s = %
|
159
|
-
self.class
|
159
|
+
'#<%s %s (%s) %s = %p (%s) (1+ => %s) %s>' % [
|
160
|
+
self.class,
|
160
161
|
key,
|
161
162
|
names.join('|'),
|
162
|
-
type
|
163
|
-
default
|
164
|
-
arity
|
163
|
+
type,
|
164
|
+
default,
|
165
|
+
arity,
|
165
166
|
on_multiple,
|
166
167
|
if required? then :required else :optional end
|
167
168
|
]
|
data/lib/acclaim/option/arity.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
1
3
|
module Acclaim
|
2
4
|
class Option
|
3
5
|
|
@@ -84,18 +86,24 @@ module Acclaim
|
|
84
86
|
|
85
87
|
# Returns a string in the following format:
|
86
88
|
#
|
87
|
-
#
|
89
|
+
# minimum +optional
|
90
|
+
#
|
91
|
+
# The value of optional will be ∞ if this arity is not {#bound? bound}.
|
88
92
|
#
|
89
|
-
#
|
90
|
-
#
|
93
|
+
# @return [String] string representation of this arity
|
94
|
+
# @see #inspect
|
91
95
|
def to_s
|
92
|
-
"
|
96
|
+
"#{minimum} +#{unlimited? ? '∞' : optional}"
|
93
97
|
end
|
94
98
|
|
95
|
-
# Returns
|
96
|
-
#
|
99
|
+
# Returns a string in the following format:
|
100
|
+
#
|
101
|
+
# #<Acclaim::Option::Arity minimum +optional>
|
102
|
+
#
|
103
|
+
# @return [String] human-readable representation of this arity object
|
104
|
+
# @see #to_s
|
97
105
|
def inspect
|
98
|
-
"
|
106
|
+
"#<#{self.class} #{to_s}>"
|
99
107
|
end
|
100
108
|
|
101
109
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acclaim
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -168,7 +168,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
168
168
|
version: '0'
|
169
169
|
segments:
|
170
170
|
- 0
|
171
|
-
hash:
|
171
|
+
hash: 603733755456817877
|
172
172
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
173
173
|
none: false
|
174
174
|
requirements:
|
@@ -177,7 +177,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
177
177
|
version: '0'
|
178
178
|
segments:
|
179
179
|
- 0
|
180
|
-
hash:
|
180
|
+
hash: 603733755456817877
|
181
181
|
requirements: []
|
182
182
|
rubyforge_project:
|
183
183
|
rubygems_version: 1.8.24
|