boson 1.2.2 → 1.2.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,6 @@
1
+ == 1.2.3
2
+ * Fix help command with no args
3
+
1
4
  == 1.2.2
2
5
  * Fix required arg command failing hard with no args
3
6
  * Fix bug with Command#option_command? not being available to plugins
data/README.md CHANGED
@@ -213,7 +213,7 @@ Motivation for the new boson is all the damn executables I'm making.
213
213
  ## Credits
214
214
  Boson stands on the shoulders of these people and their ideas:
215
215
 
216
- * Contributors: @mirell, @martinos
216
+ * Contributors: @mirell, @martinos, @celldee
217
217
  * Yehuda Katz for Thor and its awesome option parser (Boson::OptionParser).
218
218
  * Daniel Berger for his original work on thor's option parser.
219
219
  * Chris Wanstrath for inspiring Boson's libraries with Rip's packages.
@@ -91,9 +91,13 @@ module Boson
91
91
  # Defines default commands that are available to executables i.e. Runner.start
92
92
  class DefaultCommandsRunner < Runner
93
93
  desc "Displays help for a command"
94
- def help(cmd)
95
- (cmd_obj = Command.find(cmd)) ? Runner.current.display_command_help(cmd_obj) :
96
- self.class.no_command_error(cmd)
94
+ def help(cmd = nil)
95
+ if cmd.nil?
96
+ Runner.current.display_help
97
+ else
98
+ (cmd_obj = Command.find(cmd)) ? Runner.current.display_command_help(cmd_obj) :
99
+ self.class.no_command_error(cmd)
100
+ end
97
101
  end
98
102
  end
99
103
  end
@@ -1,3 +1,3 @@
1
1
  module Boson
2
- VERSION = '1.2.2'
2
+ VERSION = '1.2.3'
3
3
  end
@@ -130,6 +130,10 @@ STR
130
130
  with("my_command: Could not find command \"invalid\"")
131
131
  my_command('help invalid')
132
132
  end
133
+
134
+ it 'prints general help if no command' do
135
+ my_command('help').should == default_usage
136
+ end
133
137
  end
134
138
 
135
139
  describe "for COMMAND -h" do
@@ -285,7 +289,7 @@ STR
285
289
  describe "extend Runner" do
286
290
  it "can extend help" do
287
291
  extended_command('help help').should == <<-STR
288
- Usage: extended_command help CMD
292
+ Usage: extended_command help [CMD]
289
293
 
290
294
  Description:
291
295
  Displays help for a command
@@ -295,7 +299,7 @@ STR
295
299
 
296
300
  it "can extend a command's --help" do
297
301
  extended_command('help -h').should == <<-STR
298
- Usage: extended_command help CMD
302
+ Usage: extended_command help [CMD]
299
303
 
300
304
  Description:
301
305
  Displays help for a command
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: boson
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-06 00:00:00.000000000 Z
12
+ date: 2012-04-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mocha
16
- requirement: &70276150893880 !ruby/object:Gem::Requirement
16
+ requirement: &70264415462180 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.10.4
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70276150893880
24
+ version_requirements: *70264415462180
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: bacon
27
- requirement: &70276150893300 !ruby/object:Gem::Requirement
27
+ requirement: &70264415461540 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.1.0
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70276150893300
35
+ version_requirements: *70264415461540
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: mocha-on-bacon
38
- requirement: &70276150892780 !ruby/object:Gem::Requirement
38
+ requirement: &70264415461100 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70276150892780
46
+ version_requirements: *70264415461100
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: bacon-bits
49
- requirement: &70276150892060 !ruby/object:Gem::Requirement
49
+ requirement: &70264415460600 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70276150892060
57
+ version_requirements: *70264415460600
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: bahia
60
- requirement: &70276150891360 !ruby/object:Gem::Requirement
60
+ requirement: &70264415459800 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,7 +65,7 @@ dependencies:
65
65
  version: 0.5.0
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70276150891360
68
+ version_requirements: *70264415459800
69
69
  description: Boson is a modular command/task framework. Thanks to its rich set of
70
70
  plugins, it differentiates itself from rake and thor by being usable from irb and
71
71
  the commandline, having optional automated views generated by hirb and allowing