gli 2.5.4 → 2.5.5

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source :rubygems
1
+ source 'http://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
@@ -78,6 +78,7 @@ Known to work on
78
78
  * 1.8.7
79
79
  * 1.9.2
80
80
  * 1.9.3
81
+ * 2.0.0
81
82
  * Ruby Enterprise Edition 1.8.7
82
83
  * Rubinius 1.0.1
83
84
  * JRuby 1.6.4
@@ -103,7 +103,7 @@ module GLI
103
103
  end
104
104
 
105
105
  # Gives you a switch in the current context
106
- def switch(name,aliases,desc,long_desc,negetable)
106
+ def switch(name,aliases,desc,long_desc,negatable)
107
107
  abstract!
108
108
  end
109
109
 
@@ -103,7 +103,7 @@ COMMANDS
103
103
  def format_subcommands(command)
104
104
  commands_array = @sorter.call(command.commands_declaration_order).map { |cmd|
105
105
  if command.get_default_command == cmd.name
106
- [cmd.names,cmd.description + " (default)"]
106
+ [cmd.names,String(cmd.description) + " (default)"]
107
107
  else
108
108
  [cmd.names,cmd.description]
109
109
  end
@@ -58,8 +58,8 @@ module GLI
58
58
  end
59
59
 
60
60
  # Gives you a switch in the current context
61
- def switch(name,aliases,desc,long_desc,negetable)
62
- if negetable
61
+ def switch(name,aliases,desc,long_desc,negatable)
62
+ if negatable
63
63
  name = "[no-]#{name}" if name.to_s.length > 1
64
64
  aliases = aliases.map { |_| _.to_s.length > 1 ? "[no-]#{_}" : _ }
65
65
  end
@@ -20,7 +20,7 @@ module GLI
20
20
  @default_value = false if options[:default_value].nil?
21
21
  @negatable = options[:negatable].nil? ? true : options[:negatable]
22
22
  if @default_value != false && @negatable == false
23
- raise "A switch with default #{@default_value} that isn't negetable is useless"
23
+ raise "A switch with default #{@default_value} that isn't negatable is useless"
24
24
  end
25
25
  end
26
26
 
@@ -1,5 +1,5 @@
1
1
  module GLI
2
2
  unless const_defined? :VERSION
3
- VERSION = '2.5.4' #:nodoc:
3
+ VERSION = '2.5.5' #:nodoc:
4
4
  end
5
5
  end
@@ -448,7 +448,7 @@ class TC_testGLI < Clean::Test::TestCase
448
448
  assert @switch_value == false,"Got: '#{@switch_value}', but expected false"
449
449
  end
450
450
 
451
- def test_switch_with_default_true_and_not_negetable_causes_exception
451
+ def test_switch_with_default_true_and_not_negatable_causes_exception
452
452
  @app.reset
453
453
  @app.on_error do |ex|
454
454
  raise ex
@@ -151,6 +151,34 @@ class TC_testHelp < Clean::Test::TestCase
151
151
  }
152
152
  end
153
153
 
154
+ test_that "omitting default_description doesn't blow up" do
155
+ Given {
156
+ app = TestApp.new
157
+ app.instance_eval do
158
+ command :top do |top|
159
+ top.command :list do |list|
160
+ list.action do |g,o,a|
161
+ end
162
+ end
163
+
164
+ top.command :new do |new|
165
+ new.action do |g,o,a|
166
+ end
167
+ end
168
+
169
+ top.default_command :list
170
+ end
171
+ end
172
+ @command = GLI::Commands::Help.new(app,@output,@error)
173
+ }
174
+ When {
175
+ @code = lambda { @command.execute({},{},['top']) }
176
+ }
177
+ Then {
178
+ assert_nothing_raised(&@code)
179
+ }
180
+ end
181
+
154
182
  private
155
183
 
156
184
  def a_GLI_app(omit_options=false)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gli
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.4
4
+ version: 2.5.5
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: 2013-01-22 00:00:00.000000000 Z
12
+ date: 2013-03-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -333,7 +333,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
333
333
  version: '0'
334
334
  segments:
335
335
  - 0
336
- hash: -1157408326756213175
336
+ hash: 4280558449703188921
337
337
  required_rubygems_version: !ruby/object:Gem::Requirement
338
338
  none: false
339
339
  requirements:
@@ -342,10 +342,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
342
342
  version: '0'
343
343
  segments:
344
344
  - 0
345
- hash: -1157408326756213175
345
+ hash: 4280558449703188921
346
346
  requirements: []
347
347
  rubyforge_project: gli
348
- rubygems_version: 1.8.23
348
+ rubygems_version: 1.8.25
349
349
  signing_key:
350
350
  specification_version: 3
351
351
  summary: Build command-suite CLI apps that are awesome.