choosy 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.4.3 (March 29, 2011)
2
+
3
+ Fixes:
4
+
5
+ - The 'parsimonious' operation on SuperCommands now allows 'help' to take an argument.
6
+
1
7
  ## 0.4.0 (March 28, 2011)
2
8
 
3
9
  Fixes:
data/lib/VERSION.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
- date: 28/03/2011
2
+ date: 29/03/2011
3
3
  version:
4
- tiny: 2
4
+ tiny: 3
5
5
  major: 0
6
6
  minor: 4
@@ -75,7 +75,8 @@ module Choosy
75
75
 
76
76
  def parse_command(args, terminals)
77
77
  command_name = args.shift
78
- command_builder = @super_command.command_builders[command_name.to_sym]
78
+ command_sym = command_name.to_sym
79
+ command_builder = @super_command.command_builders[command_sym]
79
80
  if command_builder.nil?
80
81
  if command_name =~ /^-/
81
82
  raise Choosy::SuperParseError.new("unrecognized option: '#{command_name}'")
@@ -85,7 +86,11 @@ module Choosy
85
86
  end
86
87
 
87
88
  command = command_builder.entity
88
- parser = Parser.new(command, false, terminals)
89
+ parser = if command_sym == :help
90
+ Parser.new(command, false, [])
91
+ else
92
+ Parser.new(command, false, terminals)
93
+ end
89
94
  command_result = Choosy::ParseResult.new(command, true)
90
95
  parser.parse!(args, command_result)
91
96
 
@@ -128,6 +128,16 @@ module Choosy
128
128
  @p.command(:bar).parse!('bar', '--version')
129
129
  }.should raise_error(Choosy::VersionCalled)
130
130
  end
131
+
132
+ it "should call 'help' with the appropriate args when defined" do
133
+ @p.super.alter do
134
+ command :help
135
+ end
136
+
137
+ attempting {
138
+ @p.command(:bar).parse!('help', 'bar')
139
+ }.should raise_error(Choosy::HelpCalled, :bar)
140
+ end
131
141
  end
132
142
  end
133
143
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 4
8
- - 2
9
- version: 0.4.2
8
+ - 3
9
+ version: 0.4.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Gabe McArthur
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-03-28 00:00:00 -07:00
17
+ date: 2011-03-29 00:00:00 -07:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency