command_kit 0.2.1 → 0.2.2

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
  SHA256:
3
- metadata.gz: a218265a42b8b11c95888d07a3dcc3817d534adf830f8e7b1f1790bae73f05d6
4
- data.tar.gz: c11cf5b2179d0701d5164b5ffcc07f2040cf8c813ea68caafdd7602e8603b754
3
+ metadata.gz: d04119403fa9585e0258d2b20bb7c307d124aafb70c88e03749395c7b4eedb97
4
+ data.tar.gz: 3ec992adf12bbc98313bb6ff8f3038091b50b31abbf8950765a71edd771378fb
5
5
  SHA512:
6
- metadata.gz: 7bd20d0e6b33b1d84933ea246c51b552c8652e3f59c8ec3fe32bf1944148377799b20b8177f0025114689ff5f73a88d08fe14171bdbd48189ab4123ba9129113
7
- data.tar.gz: 617efce051bc51bbb88ada26a83ded0e158b8e0af28ab2bad8af1478aac05a156833aa3bfd95b59e7b07daf1075c08e60f7f6165cc28b76908cb13eb694c4f4b
6
+ metadata.gz: faeeaa08921ab315a825d4b1ff69f6b254c53b6675dd4278478b77200d6d2afb688d110757685ed33d74b90a6b1e9394c12135c3ab5f08e2ca3ca5834ead248d
7
+ data.tar.gz: 6b4ba3da0434c9fbd93d92a4c9d91e8eb53f1185df15edb21283c09b2ddf9ec4dc9fcb3708bdf83a1158cef92c988ccb5133ec5664ac9dcb213bdcde45aacf3d
@@ -10,13 +10,12 @@ jobs:
10
10
  fail-fast: false
11
11
  matrix:
12
12
  ruby:
13
- # - 2.4
14
- # - 2.5
15
- # - 2.6
16
13
  - 2.7
17
14
  - 3.0
18
15
  # TODO: uncomment when jruby supports ruby >= 2.7
19
16
  # - jruby
17
+ # TODO: uncomment when truffleruby supports splatting empty kwargs
18
+ # - truffleruby
20
19
  name: Ruby ${{ matrix.ruby }}
21
20
  steps:
22
21
  - uses: actions/checkout@v2
data/ChangeLog.md CHANGED
@@ -1,3 +1,11 @@
1
+ ### 0.2.2 / 2021-12-26
2
+
3
+ #### CommandKit::Help::Man
4
+
5
+ * Raise a `NotImplementedError` exception in {CommandKit::Help::Man#help_man
6
+ #help_man} if {CommandKit::Help::Man::ClassMethods#man_dir .man_dir} was not
7
+ set.
8
+
1
9
  ### 0.2.1 / 2021-11-16
2
10
 
3
11
  * Ensure that all error messages end with a period.
@@ -124,8 +124,8 @@ module CommandKit
124
124
  # argument :bar, desc: "Bar argument"
125
125
  #
126
126
  # @example With a custom usage string:
127
- # option :bar, usage: 'BAR',
128
- # desc: "Bar argument"
127
+ # argument :bar, usage: 'BAR',
128
+ # desc: "Bar argument"
129
129
  #
130
130
  # @example With a custom type:
131
131
  # argument :bar, desc: "Bar argument"
@@ -110,11 +110,15 @@ module CommandKit
110
110
  # Returns `nil` when the `man` command is not installed.
111
111
  #
112
112
  # @raise [NotImplementedError]
113
- # {ClassMethods#man_dir .man_dir} does not have a value.
113
+ # {ClassMethods#man_dir .man_dir} was not set in the class.
114
114
  #
115
115
  # @api semipublic
116
116
  #
117
117
  def help_man(man_page=self.class.man_page)
118
+ unless self.class.man_dir
119
+ raise(NotImplementedError,"man_dir was not set in #{self.class}")
120
+ end
121
+
118
122
  man_path = File.join(self.class.man_dir,man_page)
119
123
 
120
124
  man(man_path)
@@ -124,9 +128,6 @@ module CommandKit
124
128
  # Displays the {ClassMethods#man_page .man_page} in
125
129
  # {ClassMethods#man_dir .man_dir} instead of the usual `--help` output.
126
130
  #
127
- # @raise [NotImplementedError]
128
- # {ClassMethods#man_dir .man_dir} does not have a value.
129
- #
130
131
  # @note
131
132
  # if `TERM` is `dumb` or `$stdout` is not a TTY, will fall back to
132
133
  # printing the usual `--help` output.
@@ -1,4 +1,4 @@
1
1
  module CommandKit
2
2
  # command_kit version
3
- VERSION = "0.2.1"
3
+ VERSION = "0.2.2"
4
4
  end
@@ -203,7 +203,7 @@ describe CommandKit::Arguments do
203
203
  end
204
204
  end
205
205
 
206
- context "when #arguments returns an Array" do
206
+ context "when #arguments returns a Hash" do
207
207
  module TestArguments
208
208
  class MultipleArguments
209
209
  include CommandKit::Arguments
@@ -19,7 +19,6 @@ describe CommandKit::Commands do
19
19
  class Test2 < CommandKit::Command
20
20
  end
21
21
 
22
- p method(:command).source_location
23
22
  command Test1
24
23
  command Test2
25
24
 
@@ -147,7 +146,6 @@ describe CommandKit::Commands do
147
146
  desc: 'Argument 2'
148
147
  end
149
148
 
150
- p method(:command).source_location
151
149
  command Test1
152
150
  command Test2
153
151
 
@@ -271,6 +271,16 @@ describe CommandKit::Help::Man do
271
271
  subject.help_man(man_page)
272
272
  end
273
273
  end
274
+
275
+ context "but the man_dir is not set" do
276
+ let(:command_class) { TestHelpMan::TestCommandWithManDirNotSet }
277
+
278
+ it "must call the super help() mehtod" do
279
+ expect {
280
+ subject.help_man
281
+ }.to raise_error(NotImplementedError,"man_dir was not set in #{command_class}")
282
+ end
283
+ end
274
284
  end
275
285
 
276
286
  describe "#help" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: command_kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Postmodern
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-17 00:00:00.000000000 Z
11
+ date: 2021-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler