simple_scripting 0.10.0 → 0.10.1
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 +5 -5
- data/.gitignore +1 -1
- data/Gemfile.lock +13 -13
- data/README.md +10 -3
- data/lib/simple_scripting/argv.rb +3 -0
- data/lib/simple_scripting/version.rb +1 -1
- data/simple_scripting.gemspec +2 -2
- data/spec/simple_scripting/argv_spec.rb +8 -0
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: c4b1be8a601a79595da23945788e7c16ff9491c527929c6d8ab718b23f032e7f
|
4
|
+
data.tar.gz: 92fe06a625a0ff3661f5c4d9034a6f16aa8846ba88f8327bd9d848bd49bc40e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1c88943a0a2adbd3887374dc01e5f1b4be1edf14530cc7bd0408da1c8a35f3e5a1e3bf49dd72fc6fa9b077284e569c304ead13f16f77890eeacbcd6d7f579df
|
7
|
+
data.tar.gz: c351644417ea83f5c50b7bd011631df9b0b852a8a4bf553889464237da33437fe5a035d7ec687a8a668b68649f3fd2b260ffc578e41b9c3b7cb5391afe43867a
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
simple_scripting (0.
|
4
|
+
simple_scripting (0.10.0)
|
5
5
|
parseconfig (~> 1.0)
|
6
6
|
|
7
7
|
GEM
|
@@ -26,19 +26,19 @@ GEM
|
|
26
26
|
powerpack (0.1.2)
|
27
27
|
rainbow (3.0.0)
|
28
28
|
rake (12.0.0)
|
29
|
-
rspec (3.
|
30
|
-
rspec-core (~> 3.
|
31
|
-
rspec-expectations (~> 3.
|
32
|
-
rspec-mocks (~> 3.
|
33
|
-
rspec-core (3.
|
34
|
-
rspec-support (~> 3.
|
35
|
-
rspec-expectations (3.
|
29
|
+
rspec (3.7.0)
|
30
|
+
rspec-core (~> 3.7.0)
|
31
|
+
rspec-expectations (~> 3.7.0)
|
32
|
+
rspec-mocks (~> 3.7.0)
|
33
|
+
rspec-core (3.7.1)
|
34
|
+
rspec-support (~> 3.7.0)
|
35
|
+
rspec-expectations (3.7.0)
|
36
36
|
diff-lcs (>= 1.2.0, < 2.0)
|
37
|
-
rspec-support (~> 3.
|
38
|
-
rspec-mocks (3.
|
37
|
+
rspec-support (~> 3.7.0)
|
38
|
+
rspec-mocks (3.7.0)
|
39
39
|
diff-lcs (>= 1.2.0, < 2.0)
|
40
|
-
rspec-support (~> 3.
|
41
|
-
rspec-support (3.
|
40
|
+
rspec-support (~> 3.7.0)
|
41
|
+
rspec-support (3.7.1)
|
42
42
|
rubocop (0.58.1)
|
43
43
|
jaro_winkler (~> 1.5.1)
|
44
44
|
parallel (~> 1.10)
|
@@ -66,7 +66,7 @@ DEPENDENCIES
|
|
66
66
|
byebug (~> 10.0.2)
|
67
67
|
coveralls (~> 0.8.21)
|
68
68
|
rake (~> 12.0)
|
69
|
-
rspec (~> 3.
|
69
|
+
rspec (~> 3.7)
|
70
70
|
rubocop (= 0.58.1)
|
71
71
|
simple_scripting!
|
72
72
|
|
data/README.md
CHANGED
@@ -17,6 +17,8 @@
|
|
17
17
|
|
18
18
|
`TabCompletion` makes trivial to define tab-completion for terminal commands on Linux/Mac systems; it's so easy that an example is much simpler than an explanation.
|
19
19
|
|
20
|
+
`TabCompletion` supports Bash, and Zsh (with `bashcompinit`).
|
21
|
+
|
20
22
|
### Example
|
21
23
|
|
22
24
|
Suppose we have the command:
|
@@ -75,11 +77,16 @@ $ open_project --wi<tab> # autocompletes "--with-editor"; this is built-i
|
|
75
77
|
|
76
78
|
Happy completion!
|
77
79
|
|
78
|
-
###
|
80
|
+
### Zsh
|
81
|
+
|
82
|
+
`TabCompletion` on Zsh requires `bashcompinit`; add the following to your `~/.zshrc`:
|
79
83
|
|
80
|
-
|
84
|
+
```sh
|
85
|
+
autoload bashcompinit
|
86
|
+
bashcompinit
|
87
|
+
```
|
81
88
|
|
82
|
-
Note that a recent version of Zsh is required
|
89
|
+
Note that a **recent version of Zsh is required**; the stock Ubuntu 16.04 version (5.1.1-1ubuntu2.2) has bug that breaks bash tab completion.
|
83
90
|
|
84
91
|
### More complex use cases
|
85
92
|
|
data/simple_scripting.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.platform = Gem::Platform::RUBY
|
11
11
|
s.required_ruby_version = '>= 2.3.0'
|
12
12
|
s.authors = ["Saverio Miroddi"]
|
13
|
-
s.date = "2018-
|
13
|
+
s.date = "2018-12-03"
|
14
14
|
s.email = ["saverio.pub2@gmail.com"]
|
15
15
|
s.homepage = "https://github.com/saveriomiroddi/simple_scripting"
|
16
16
|
s.summary = "Library for simplifying some typical scripting functionalities."
|
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.add_runtime_dependency "parseconfig", "~> 1.0"
|
21
21
|
|
22
22
|
s.add_development_dependency "rake", "~> 12.0"
|
23
|
-
s.add_development_dependency "rspec", "~> 3.
|
23
|
+
s.add_development_dependency "rspec", "~> 3.7"
|
24
24
|
|
25
25
|
s.files = `git ls-files`.split("\n")
|
26
26
|
s.test_files = `git ls-files -- spec/*`.split("\n")
|
@@ -270,6 +270,14 @@ describe SimpleScripting::Argv do
|
|
270
270
|
expect(decoding).to raise_error(SimpleScripting::Argv::InvalidCommand, "Invalid command: pizza")
|
271
271
|
end
|
272
272
|
|
273
|
+
it "should print a specific error message on missing command" do
|
274
|
+
decoder_params[:arguments] = []
|
275
|
+
|
276
|
+
decoding = -> { described_class.decode(decoder_params) }
|
277
|
+
|
278
|
+
expect(decoding).to raise_error(SimpleScripting::Argv::InvalidCommand, "Missing command")
|
279
|
+
end
|
280
|
+
|
273
281
|
end # context "error handling"
|
274
282
|
|
275
283
|
context "help" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_scripting
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Saverio Miroddi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parseconfig
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '3.
|
47
|
+
version: '3.7'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '3.
|
54
|
+
version: '3.7'
|
55
55
|
description: Simplifies options parsing and configuration loading.
|
56
56
|
email:
|
57
57
|
- saverio.pub2@gmail.com
|
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
101
101
|
version: '0'
|
102
102
|
requirements: []
|
103
103
|
rubyforge_project:
|
104
|
-
rubygems_version: 2.
|
104
|
+
rubygems_version: 2.7.8
|
105
105
|
signing_key:
|
106
106
|
specification_version: 4
|
107
107
|
summary: Library for simplifying some typical scripting functionalities.
|