clamp 0.1.3 → 0.1.4
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/lib/clamp/option.rb +5 -1
- data/lib/clamp/version.rb +1 -1
- data/spec/clamp/command_spec.rb +8 -0
- metadata +4 -4
data/lib/clamp/option.rb
CHANGED
@@ -47,7 +47,11 @@ module Clamp
|
|
47
47
|
def help
|
48
48
|
lhs = switches.join(", ")
|
49
49
|
lhs += " " + type unless flag?
|
50
|
-
|
50
|
+
rhs = description
|
51
|
+
if defined?(@default_value)
|
52
|
+
rhs += " (default: #{@default_value.inspect})"
|
53
|
+
end
|
54
|
+
[lhs, rhs]
|
51
55
|
end
|
52
56
|
|
53
57
|
private
|
data/lib/clamp/version.rb
CHANGED
data/spec/clamp/command_spec.rb
CHANGED
@@ -89,6 +89,14 @@ describe Clamp::Command do
|
|
89
89
|
@command.nodes.should == 2
|
90
90
|
end
|
91
91
|
|
92
|
+
describe "#help" do
|
93
|
+
|
94
|
+
it "describes the default value" do
|
95
|
+
@command.help.should include("number of nodes (default: 2)")
|
96
|
+
end
|
97
|
+
|
98
|
+
end
|
99
|
+
|
92
100
|
end
|
93
101
|
|
94
102
|
describe "with a block" do
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clamp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 4
|
10
|
+
version: 0.1.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Mike Williams
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-11-
|
18
|
+
date: 2010-11-30 00:00:00 +11:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|