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 +4 -4
- data/.github/workflows/ruby.yml +2 -3
- data/ChangeLog.md +8 -0
- data/lib/command_kit/arguments.rb +2 -2
- data/lib/command_kit/help/man.rb +5 -4
- data/lib/command_kit/version.rb +1 -1
- data/spec/arguments_spec.rb +1 -1
- data/spec/commands_spec.rb +0 -2
- data/spec/help/man_spec.rb +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d04119403fa9585e0258d2b20bb7c307d124aafb70c88e03749395c7b4eedb97
|
4
|
+
data.tar.gz: 3ec992adf12bbc98313bb6ff8f3038091b50b31abbf8950765a71edd771378fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: faeeaa08921ab315a825d4b1ff69f6b254c53b6675dd4278478b77200d6d2afb688d110757685ed33d74b90a6b1e9394c12135c3ab5f08e2ca3ca5834ead248d
|
7
|
+
data.tar.gz: 6b4ba3da0434c9fbd93d92a4c9d91e8eb53f1185df15edb21283c09b2ddf9ec4dc9fcb3708bdf83a1158cef92c988ccb5133ec5664ac9dcb213bdcde45aacf3d
|
data/.github/workflows/ruby.yml
CHANGED
@@ -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
|
-
#
|
128
|
-
#
|
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"
|
data/lib/command_kit/help/man.rb
CHANGED
@@ -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}
|
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.
|
data/lib/command_kit/version.rb
CHANGED
data/spec/arguments_spec.rb
CHANGED
data/spec/commands_spec.rb
CHANGED
@@ -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
|
|
data/spec/help/man_spec.rb
CHANGED
@@ -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.
|
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
|
+
date: 2021-12-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|