mercenary 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b9f4dfe1178635732a9da7f3221db5cab85da88f
4
- data.tar.gz: d1ddfc45773425b1a91016111189625a4a6f8bc1
3
+ metadata.gz: ca6c5dbfbf851bbffdbfa00a4a68728173436c42
4
+ data.tar.gz: 03fb71ec3b1ec16047939a42958aa3d84717af02
5
5
  SHA512:
6
- metadata.gz: 43845c7d35b7cae824bc238a5bdfa340bb15ed4dde3444ffb4dee893acb104e5e769694aed071b0cf74a1c5657b019d402c21a2b6857b5fc3a368cb8ba3803dd
7
- data.tar.gz: d2398c2e216c6c5c2e286e3c254b0d7a65038bc6c4e50a6711b6fbb05fe8bbe3c9bd258b93e154a9ae496f2a11c3cec41cdfb528f7eec80894a2115baba93da4
6
+ metadata.gz: b3564cbdae68c98af758a76f97d676b1a97064236aec734710d598e84d6fe659e1bec49498957b0fa3bac7ef5e34a200f56b0cefeb81eb3e03894dbfbedb5a51
7
+ data.tar.gz: 68ae6947d6f430e1a67cd0a4ed63c440d0760bdb7eb9d97346e718f27756492a74990be05a92d2689bb36167e1be52648cc3a332e4749806e00c371cad9c6cff
@@ -1,3 +1,9 @@
1
+ ## 0.3.6 / 2016-04-07
2
+
3
+ ### Bug Fixes
4
+
5
+ * Presenter: Options should include those from parent command (#42)
6
+
1
7
  ## 0.3.5 / 2014-11-12
2
8
 
3
9
  ### Bug Fixes
@@ -13,95 +19,91 @@
13
19
 
14
20
  ### Bug Fixes
15
21
 
16
- * Use option object as key in the command's `@map` hash (#35)
22
+ * Use option object as key in the command's `@map` hash (#35)
17
23
 
18
24
  ## 0.3.3 / 2014-05-07
19
25
 
20
26
  ### Bug Fixes
21
27
 
22
- * The `--version` flag should not exit with code 1, but instead code 0. (#33)
28
+ * The `--version` flag should not exit with code 1, but instead code 0. (#33)
23
29
 
24
30
  ## 0.3.2 / 2014-03-18
25
31
 
26
32
  ### Bug Fixes
27
33
 
28
- * Remove duplicate commands from help output; show aliases w/command names
29
- (#29)
34
+ * Remove duplicate commands from help output; show aliases w/command names (#29)
30
35
 
31
36
  ## 0.3.1 / 2014-02-21
32
37
 
33
38
  ### Minor Enhancements
34
39
 
35
- * Add `-t/--trace` to list of options in help message (#19)
40
+ * Add `-t/--trace` to list of options in help message (#19)
36
41
 
37
42
  ### Bug Fixes
38
43
 
39
- * `Mercenary::Option` now accepts return values in the form of Class constants
40
- (#22)
44
+ * `Mercenary::Option` now accepts return values in the form of Class constants (#22)
41
45
 
42
46
  ## 0.3.0 / 2014-02-20
43
47
 
44
48
  ### Major Enhancements
45
49
 
46
- * Officially drop 1.8.7 support (#14)
47
- * Allow Commands to set their own versions (#17)
48
- * Show subcommands, options and usage in help and attach to all commands (#18)
49
- * Add `-t, --trace` to allow full exception backtrace to print, otherwise print
50
- just the error message (#19)
50
+ * Officially drop 1.8.7 support (#14)
51
+ * Allow Commands to set their own versions (#17)
52
+ * Show subcommands, options and usage in help and attach to all commands (#18)
53
+ * Add `-t, --trace` to allow full exception backtrace to print, otherwise print just the error message (#19)
51
54
 
52
55
  ### Minor Enhancements
53
56
 
54
- * Logging state is maintained throughout process (#12)
55
- * Tidy up Command#logger output (#21)
57
+ * Logging state is maintained throughout process (#12)
58
+ * Tidy up Command#logger output (#21)
56
59
 
57
60
  ### Development Fixes
58
61
 
59
- * Added specs for `Program` (#13)
62
+ * Added specs for `Program` (#13)
60
63
 
61
64
  ## 0.2.1 / 2013-12-25
62
65
 
63
66
  ### Bug Fixes
64
67
 
65
- * Added missing comma to fix '-v' and '--version' options (#9)
68
+ * Added missing comma to fix '-v' and '--version' options (#9)
66
69
 
67
70
  ## 0.2.0 / 2013-11-30
68
71
 
69
72
  ### Major Enhancements
70
73
 
71
- * Add `Command#default_command` to specify a default command if none is given
72
- by the user at runtime (#7)
74
+ * Add `Command#default_command` to specify a default command if none is given by the user at runtime (#7)
73
75
 
74
76
  ### Minor Enhancements
75
77
 
76
- * Add `Command#execute` to execute the actions of a command (#6)
78
+ * Add `Command#execute` to execute the actions of a command (#6)
77
79
 
78
80
  ### Development Fixes
79
81
 
80
- * Add standard GitHub bootstrap and cibuild scripts to `script/` (#2)
82
+ * Add standard GitHub bootstrap and cibuild scripts to `script/` (#2)
81
83
 
82
84
  ## 0.1.0 / 2013-11-08
83
85
 
84
86
  ### Major Enhancements
85
87
 
86
- * It works!
88
+ * It works!
87
89
 
88
90
  ### Minor Enhancements
89
91
 
90
- * Add a logger to `Command`
91
- * Add `--version` switch to all programs
92
+ * Add a logger to `Command`
93
+ * Add `--version` switch to all programs
92
94
 
93
95
  ### Bug Fixes
94
96
 
95
- * Fix `Command#syntax` and `Command#description`'s handing of setting vs getting
96
- * Fix load path problem in `lib/mercenary.rb`
97
+ * Fix `Command#syntax` and `Command#description`'s handing of setting vs getting
98
+ * Fix load path problem in `lib/mercenary.rb`
97
99
 
98
100
  ### Development Fixes
99
101
 
100
- * Add TomDoc to everything
101
- * Add a couple starter specs
102
- * Add TravisCI badge
103
- * Add Travis configuration
102
+ * Add TomDoc to everything
103
+ * Add a couple starter specs
104
+ * Add TravisCI badge
105
+ * Add Travis configuration
104
106
 
105
107
  ## 0.0.1 / 2013-11-06
106
108
 
107
- * Birthday!
109
+ * Birthday!
@@ -22,10 +22,24 @@ module Mercenary
22
22
  #
23
23
  # Returns the string representation of the options
24
24
  def options_presentation
25
+ return nil unless command_options_presentation || parent_command_options_presentation
26
+ [command_options_presentation, parent_command_options_presentation].compact.join("\n")
27
+ end
28
+
29
+ def command_options_presentation
25
30
  return nil unless command.options.size > 0
26
31
  command.options.map(&:to_s).join("\n")
27
32
  end
28
33
 
34
+ # Public: Builds a string representation of the options for parent
35
+ # commands
36
+ #
37
+ # Returns the string representation of the options for parent commands
38
+ def parent_command_options_presentation
39
+ return nil unless command.parent
40
+ Presenter.new(command.parent).options_presentation
41
+ end
42
+
29
43
  # Public: Builds a string representation of the subcommands
30
44
  #
31
45
  # Returns the string representation of the subcommands
@@ -1,3 +1,3 @@
1
1
  module Mercenary
2
- VERSION = "0.3.5"
2
+ VERSION = "0.3.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mercenary
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Preston-Werner
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-11-12 00:00:00.000000000 Z
12
+ date: 2016-04-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  version: '0'
109
109
  requirements: []
110
110
  rubyforge_project:
111
- rubygems_version: 2.2.2
111
+ rubygems_version: 2.5.1
112
112
  signing_key:
113
113
  specification_version: 4
114
114
  summary: Lightweight and flexible library for writing command-line apps in Ruby.