command_kit 0.1.0.pre1 → 0.1.0.pre2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +37 -140
- data/examples/colors.rb +30 -0
- data/examples/command.rb +65 -0
- data/examples/pager.rb +30 -0
- data/lib/command_kit/arguments.rb +49 -18
- data/lib/command_kit/arguments/argument.rb +14 -44
- data/lib/command_kit/arguments/argument_value.rb +1 -30
- data/lib/command_kit/command.rb +45 -3
- data/lib/command_kit/commands.rb +6 -0
- data/lib/command_kit/commands/auto_load/subcommand.rb +3 -0
- data/lib/command_kit/commands/subcommand.rb +3 -0
- data/lib/command_kit/description.rb +3 -1
- data/lib/command_kit/examples.rb +3 -1
- data/lib/command_kit/help.rb +3 -0
- data/lib/command_kit/help/man.rb +74 -39
- data/lib/command_kit/main.rb +2 -0
- data/lib/command_kit/options.rb +46 -9
- data/lib/command_kit/options/option.rb +35 -5
- data/lib/command_kit/options/option_value.rb +40 -3
- data/lib/command_kit/pager.rb +6 -0
- data/lib/command_kit/version.rb +1 -1
- data/lib/command_kit/xdg.rb +8 -1
- data/spec/arguments/argument_spec.rb +3 -39
- data/spec/arguments/argument_value_spec.rb +1 -61
- data/spec/arguments_spec.rb +7 -0
- data/spec/help/man_spec.rb +348 -0
- data/spec/options/option_spec.rb +45 -6
- data/spec/options/option_value_spec.rb +52 -3
- data/spec/pager_spec.rb +2 -4
- metadata +10 -8
- data/lib/command_kit/arguments/usage.rb +0 -6
- data/lib/command_kit/options/usage.rb +0 -6
data/spec/pager_spec.rb
CHANGED
@@ -67,6 +67,8 @@ describe Pager do
|
|
67
67
|
let(:pager_pid) { double('pid') }
|
68
68
|
|
69
69
|
before do
|
70
|
+
expect(subject.stdout).to receive(:tty?).and_return(true)
|
71
|
+
|
70
72
|
expect(IO).to receive(:popen).with(pager,'w').and_return(pager_io)
|
71
73
|
expect(pager_io).to receive(:pid).and_return(pager_pid)
|
72
74
|
|
@@ -75,8 +77,6 @@ describe Pager do
|
|
75
77
|
end
|
76
78
|
|
77
79
|
it "must spawn a new process and yield an IO object" do
|
78
|
-
skip "STDOUT is not a TTY" unless STDOUT.tty?
|
79
|
-
|
80
80
|
expect { |b|
|
81
81
|
subject.pager(&b)
|
82
82
|
}.to yield_with_args(pager_io)
|
@@ -84,8 +84,6 @@ describe Pager do
|
|
84
84
|
|
85
85
|
context "when Errno::EPIPE is raised" do
|
86
86
|
it "must return gracefully" do
|
87
|
-
skip "STDOUT is not a TTY" unless STDOUT.tty?
|
88
|
-
|
89
87
|
expect {
|
90
88
|
subject.pager do
|
91
89
|
raise(Errno::EPIPE,"pipe broken")
|
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.1.0.
|
4
|
+
version: 0.1.0.pre2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Postmodern
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-05-
|
11
|
+
date: 2021-05-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -45,12 +45,14 @@ files:
|
|
45
45
|
- README.md
|
46
46
|
- Rakefile
|
47
47
|
- command_kit.gemspec
|
48
|
+
- examples/colors.rb
|
49
|
+
- examples/command.rb
|
50
|
+
- examples/pager.rb
|
48
51
|
- gemspec.yml
|
49
52
|
- lib/command_kit.rb
|
50
53
|
- lib/command_kit/arguments.rb
|
51
54
|
- lib/command_kit/arguments/argument.rb
|
52
55
|
- lib/command_kit/arguments/argument_value.rb
|
53
|
-
- lib/command_kit/arguments/usage.rb
|
54
56
|
- lib/command_kit/colors.rb
|
55
57
|
- lib/command_kit/command.rb
|
56
58
|
- lib/command_kit/command_name.rb
|
@@ -78,7 +80,6 @@ files:
|
|
78
80
|
- lib/command_kit/options/option_value.rb
|
79
81
|
- lib/command_kit/options/parser.rb
|
80
82
|
- lib/command_kit/options/quiet.rb
|
81
|
-
- lib/command_kit/options/usage.rb
|
82
83
|
- lib/command_kit/options/verbose.rb
|
83
84
|
- lib/command_kit/options/version.rb
|
84
85
|
- lib/command_kit/os.rb
|
@@ -114,6 +115,7 @@ files:
|
|
114
115
|
- spec/env_spec.rb
|
115
116
|
- spec/examples_spec.rb
|
116
117
|
- spec/exception_handler_spec.rb
|
118
|
+
- spec/help/man_spec.rb
|
117
119
|
- spec/help_spec.rb
|
118
120
|
- spec/inflector_spec.rb
|
119
121
|
- spec/main_spec.rb
|
@@ -134,7 +136,7 @@ homepage: https://github.com/postmodern/command_kit#readme
|
|
134
136
|
licenses:
|
135
137
|
- MIT
|
136
138
|
metadata: {}
|
137
|
-
post_install_message:
|
139
|
+
post_install_message:
|
138
140
|
rdoc_options: []
|
139
141
|
require_paths:
|
140
142
|
- lib
|
@@ -149,8 +151,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
149
151
|
- !ruby/object:Gem::Version
|
150
152
|
version: '0'
|
151
153
|
requirements: []
|
152
|
-
rubygems_version: 3.
|
153
|
-
signing_key:
|
154
|
+
rubygems_version: 3.2.15
|
155
|
+
signing_key:
|
154
156
|
specification_version: 4
|
155
157
|
summary: A toolkit for building Ruby CLI commands
|
156
158
|
test_files: []
|