gestopft 0.0.3 → 0.0.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/gestopft.rb +1 -1
- data/lib/gestopft/app.rb +3 -3
- data/spec/gestopft/option_spec.rb +6 -0
- data/spec/gestopft_spec.rb +15 -0
- metadata +5 -5
data/lib/gestopft.rb
CHANGED
data/lib/gestopft/app.rb
CHANGED
@@ -17,8 +17,8 @@ class Gestopft::App
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def self.run(argv=ARGV)
|
20
|
-
new(argv).parse_arg.dispatch
|
21
|
-
|
20
|
+
(app = new(argv)).parse_arg.dispatch
|
21
|
+
app
|
22
22
|
end
|
23
23
|
|
24
24
|
def self.commands
|
@@ -96,7 +96,7 @@ Commands:
|
|
96
96
|
end
|
97
97
|
|
98
98
|
def __default__
|
99
|
-
|
99
|
+
STDOUT.puts help_message
|
100
100
|
end
|
101
101
|
end
|
102
102
|
|
data/spec/gestopft_spec.rb
CHANGED
@@ -79,5 +79,20 @@ describe Gestopft::App do
|
|
79
79
|
subject.commands.should be_empty
|
80
80
|
end
|
81
81
|
end
|
82
|
+
|
83
|
+
context "when given some options" do
|
84
|
+
before do
|
85
|
+
subject.module_eval do
|
86
|
+
option :verbose
|
87
|
+
option :dry_run
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
it "automatically generate short options" do
|
92
|
+
subject.expectation.sort.map {|i|
|
93
|
+
i.option_name
|
94
|
+
}.should.include(%w(-v -d))
|
95
|
+
end
|
96
|
+
end
|
82
97
|
end
|
83
98
|
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: gestopft
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.4
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- aereal
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
13
|
+
date: 2011-04-22 00:00:00 +09:00
|
14
14
|
default_executable:
|
15
15
|
dependencies: []
|
16
16
|
|
@@ -26,12 +26,12 @@ files:
|
|
26
26
|
- README.rdoc
|
27
27
|
- .autotest
|
28
28
|
- .rspec
|
29
|
+
- lib/gestopft/app.rb
|
29
30
|
- lib/gestopft/core_ext/array.rb
|
30
|
-
- lib/gestopft/core_ext/symbol.rb
|
31
31
|
- lib/gestopft/core_ext/string.rb
|
32
|
-
- lib/gestopft/
|
33
|
-
- lib/gestopft/option.rb
|
32
|
+
- lib/gestopft/core_ext/symbol.rb
|
34
33
|
- lib/gestopft/core_ext.rb
|
34
|
+
- lib/gestopft/option.rb
|
35
35
|
- lib/gestopft.rb
|
36
36
|
- spec/gestopft/option_spec.rb
|
37
37
|
- spec/gestopft_spec.rb
|