tabry 0.1.4 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/tabry-bash +2 -29
- data/bin/tabry-generate-bash-complete +31 -0
- data/bin/tabry-help +1 -1
- data/bin/tabry-test-options +1 -1
- data/bin/tabry-test-parse +1 -1
- data/lib/tabry/cli/all_in_one.rb +98 -0
- data/lib/tabry/cli/arg_proxy.rb +4 -4
- data/lib/tabry/cli/base.rb +5 -2
- data/lib/tabry/cli/builder.rb +14 -8
- data/lib/tabry/cli/internals.rb +1 -1
- data/lib/tabry/cli/util.rb +23 -10
- data/lib/tabry/config_builder/arg_or_flag_builder.rb +39 -0
- data/lib/tabry/config_builder/flagarg_builder.rb +14 -0
- data/lib/tabry/config_builder/generic_builder.rb +103 -0
- data/lib/tabry/config_builder/sub_builder.rb +27 -0
- data/lib/tabry/config_builder/top_level_builder.rb +31 -0
- data/lib/tabry/config_builder.rb +16 -0
- data/lib/tabry/models/config_list.rb +2 -2
- data/lib/tabry/models/config_string_hash.rb +2 -2
- data/lib/tabry/result.rb +5 -1
- data/lib/tabry/runner.rb +6 -2
- data/lib/tabry/shell_splitter.rb +2 -0
- data/lib/tabry/shells/bash/wrapper.rb +38 -0
- data/lib/tabry/shells/bash.rb +46 -9
- data/sh/bash/tabry_bash.sh +1 -1
- data/sh/bash/tabry_bash_core.sh +3 -2
- data/spec/fixtures/config_builder/args.rb +49 -0
- data/spec/fixtures/config_builder/args.tabry +32 -0
- data/spec/fixtures/config_builder/args.yml +63 -0
- data/spec/fixtures/config_builder/defs.rb +33 -0
- data/spec/fixtures/config_builder/defs.tabry +21 -0
- data/spec/fixtures/config_builder/defs.yml +33 -0
- data/spec/fixtures/config_builder/flags.rb +26 -0
- data/spec/fixtures/config_builder/flags.tabry +13 -0
- data/spec/fixtures/config_builder/flags.yml +27 -0
- data/spec/fixtures/config_builder/subs.rb +34 -0
- data/spec/fixtures/config_builder/subs.tabry +25 -0
- data/spec/fixtures/config_builder/subs.yml +46 -0
- data/spec/fixtures/config_builder/underscoresdashes.rb +30 -0
- data/spec/fixtures/config_builder/underscoresdashes.tabry +18 -0
- data/spec/fixtures/config_builder/underscoresdashes.yml +39 -0
- data/spec/fixtures/vehicles.tabry +5 -0
- data/spec/fixtures/vehicles.yaml +5 -0
- data/spec/tabry/cli/all_in_one_spec.rb +141 -0
- data/spec/tabry/cli/arg_proxy_spec.rb +2 -2
- data/spec/tabry/cli/builder_spec.rb +51 -20
- data/spec/tabry/cli/util_spec.rb +125 -0
- data/spec/tabry/config_builder_spec.rb +64 -0
- data/spec/tabry/config_loader_spec.rb +2 -2
- data/spec/tabry/options_finder_spec.rb +1 -1
- data/spec/tabry/result_spec.rb +4 -0
- data/spec/tabry/runner_spec.rb +1 -1
- data/spec/tabry/shell_splitter_spec.rb +10 -8
- data/spec/tabry/shells/bash_spec.rb +44 -0
- data/tabry.gemspec +1 -1
- metadata +32 -4
- data/spec/lib/tabry/cli/util_spec.rb +0 -58
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tabry
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evan Battaglia
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry-byebug
|
@@ -84,6 +84,7 @@ description:
|
|
84
84
|
email: battaglia.evan@gmail.com
|
85
85
|
executables:
|
86
86
|
- tabry-bash
|
87
|
+
- tabry-generate-bash-complete
|
87
88
|
- tabry-help
|
88
89
|
- tabry-test-options
|
89
90
|
- tabry-test-parse
|
@@ -91,9 +92,11 @@ extensions: []
|
|
91
92
|
extra_rdoc_files: []
|
92
93
|
files:
|
93
94
|
- bin/tabry-bash
|
95
|
+
- bin/tabry-generate-bash-complete
|
94
96
|
- bin/tabry-help
|
95
97
|
- bin/tabry-test-options
|
96
98
|
- bin/tabry-test-parse
|
99
|
+
- lib/tabry/cli/all_in_one.rb
|
97
100
|
- lib/tabry/cli/arg_proxy.rb
|
98
101
|
- lib/tabry/cli/base.rb
|
99
102
|
- lib/tabry/cli/builder.rb
|
@@ -101,6 +104,12 @@ files:
|
|
101
104
|
- lib/tabry/cli/internals.rb
|
102
105
|
- lib/tabry/cli/util.rb
|
103
106
|
- lib/tabry/cli/util/config.rb
|
107
|
+
- lib/tabry/config_builder.rb
|
108
|
+
- lib/tabry/config_builder/arg_or_flag_builder.rb
|
109
|
+
- lib/tabry/config_builder/flagarg_builder.rb
|
110
|
+
- lib/tabry/config_builder/generic_builder.rb
|
111
|
+
- lib/tabry/config_builder/sub_builder.rb
|
112
|
+
- lib/tabry/config_builder/top_level_builder.rb
|
104
113
|
- lib/tabry/config_loader.rb
|
105
114
|
- lib/tabry/core_ext/string/colors.rb
|
106
115
|
- lib/tabry/machine.rb
|
@@ -135,6 +144,7 @@ files:
|
|
135
144
|
- lib/tabry/runner.rb
|
136
145
|
- lib/tabry/shell_splitter.rb
|
137
146
|
- lib/tabry/shells/bash.rb
|
147
|
+
- lib/tabry/shells/bash/wrapper.rb
|
138
148
|
- lib/tabry/state.rb
|
139
149
|
- lib/tabry/usage_generator.rb
|
140
150
|
- lib/tabry/util.rb
|
@@ -148,12 +158,29 @@ files:
|
|
148
158
|
- spec/fixtures/basiccli.tabry
|
149
159
|
- spec/fixtures/basiccli2.tabry
|
150
160
|
- spec/fixtures/basiccli2.yml
|
161
|
+
- spec/fixtures/config_builder/args.rb
|
162
|
+
- spec/fixtures/config_builder/args.tabry
|
163
|
+
- spec/fixtures/config_builder/args.yml
|
164
|
+
- spec/fixtures/config_builder/defs.rb
|
165
|
+
- spec/fixtures/config_builder/defs.tabry
|
166
|
+
- spec/fixtures/config_builder/defs.yml
|
167
|
+
- spec/fixtures/config_builder/flags.rb
|
168
|
+
- spec/fixtures/config_builder/flags.tabry
|
169
|
+
- spec/fixtures/config_builder/flags.yml
|
170
|
+
- spec/fixtures/config_builder/subs.rb
|
171
|
+
- spec/fixtures/config_builder/subs.tabry
|
172
|
+
- spec/fixtures/config_builder/subs.yml
|
173
|
+
- spec/fixtures/config_builder/underscoresdashes.rb
|
174
|
+
- spec/fixtures/config_builder/underscoresdashes.tabry
|
175
|
+
- spec/fixtures/config_builder/underscoresdashes.yml
|
151
176
|
- spec/fixtures/vehicles.tabry
|
152
177
|
- spec/fixtures/vehicles.yaml
|
153
|
-
- spec/lib/tabry/cli/util_spec.rb
|
154
178
|
- spec/spec_helper.rb
|
179
|
+
- spec/tabry/cli/all_in_one_spec.rb
|
155
180
|
- spec/tabry/cli/arg_proxy_spec.rb
|
156
181
|
- spec/tabry/cli/builder_spec.rb
|
182
|
+
- spec/tabry/cli/util_spec.rb
|
183
|
+
- spec/tabry/config_builder_spec.rb
|
157
184
|
- spec/tabry/config_loader_spec.rb
|
158
185
|
- spec/tabry/machine_spec.rb
|
159
186
|
- spec/tabry/models/args_list_spec.rb
|
@@ -168,6 +195,7 @@ files:
|
|
168
195
|
- spec/tabry/result_spec.rb
|
169
196
|
- spec/tabry/runner_spec.rb
|
170
197
|
- spec/tabry/shell_splitter_spec.rb
|
198
|
+
- spec/tabry/shells/bash_spec.rb
|
171
199
|
- spec/tabry/usage_generator_spec.rb
|
172
200
|
- tabry.gemspec
|
173
201
|
- treesitter/Cargo.toml
|
@@ -225,7 +253,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
225
253
|
- !ruby/object:Gem::Version
|
226
254
|
version: '0'
|
227
255
|
requirements: []
|
228
|
-
rubygems_version: 3.2.
|
256
|
+
rubygems_version: 3.2.22
|
229
257
|
signing_key:
|
230
258
|
specification_version: 4
|
231
259
|
summary: Tab completion and CLIs extraordinaire
|
@@ -1,58 +0,0 @@
|
|
1
|
-
require_relative "../../../../lib/tabry/cli/util"
|
2
|
-
|
3
|
-
describe Tabry::CLI::Util do
|
4
|
-
describe ".make_cmdline" do
|
5
|
-
it "escapes a single string" do
|
6
|
-
expect(described_class.make_cmdline(
|
7
|
-
"hello %s", "world;abc"
|
8
|
-
)).to eq(
|
9
|
-
"hello world\\;abc"
|
10
|
-
)
|
11
|
-
end
|
12
|
-
|
13
|
-
it "escapes multiple string arguments" do
|
14
|
-
expect(described_class.make_cmdline(
|
15
|
-
"hello %s hi %s", "world;abc", "def;ghi"
|
16
|
-
)).to eq(
|
17
|
-
"hello world\\;abc hi def\\;ghi"
|
18
|
-
)
|
19
|
-
end
|
20
|
-
|
21
|
-
it "escapes array arguments" do
|
22
|
-
# args is an array of strings and arrays
|
23
|
-
expect(described_class.make_cmdline(
|
24
|
-
"hello %s hi %s", "world;abc", ["foo;bar", "waz;ok"]
|
25
|
-
)).to eq(
|
26
|
-
"hello world\\;abc hi foo\\;bar waz\\;ok"
|
27
|
-
)
|
28
|
-
end
|
29
|
-
|
30
|
-
it "treats a single array of strings as a list of args, not as one array arg" do
|
31
|
-
# args is an array with one array of strings
|
32
|
-
# an improvement might be to figure out how
|
33
|
-
# many '%s's there are in the cmdline
|
34
|
-
expect(described_class.make_cmdline(
|
35
|
-
"hello %s hi %s", ["world;abc", "foo;bar"]
|
36
|
-
)).to eq(
|
37
|
-
"hello world\\;abc hi foo\\;bar"
|
38
|
-
)
|
39
|
-
end
|
40
|
-
|
41
|
-
it "escapes arrays if given one array of mixed strings and arrays" do
|
42
|
-
expect(described_class.make_cmdline(
|
43
|
-
"hello %s hi %s", [["world;abc", "foo;bar"], "waz;ok"]
|
44
|
-
)).to eq(
|
45
|
-
"hello world\\;abc foo\\;bar hi waz\\;ok"
|
46
|
-
)
|
47
|
-
end
|
48
|
-
|
49
|
-
it "can send a single array argument by wrapping in an array" do
|
50
|
-
# args is an array with one array of one array
|
51
|
-
expect(described_class.make_cmdline(
|
52
|
-
"hello %s hi", [["foo;bar", "waz;ok"]]
|
53
|
-
)).to eq(
|
54
|
-
"hello foo\\;bar waz\\;ok hi"
|
55
|
-
)
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|