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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: bb1844c9f2da48418b9fc91c3b4026c7fd1a1fbf
4
- data.tar.gz: 5a30040d716b0e544027261f5bbe6fba834d75af
2
+ SHA256:
3
+ metadata.gz: c4b1be8a601a79595da23945788e7c16ff9491c527929c6d8ab718b23f032e7f
4
+ data.tar.gz: 92fe06a625a0ff3661f5c4d9034a6f16aa8846ba88f8327bd9d848bd49bc40e8
5
5
  SHA512:
6
- metadata.gz: 39c51fd57bb624894fbb9b0adbfc731d365c2fd36d7b6e9e0a17d2e06fc36ba2f78c014f007b5dd360079daf449beb1ed433d694d827d15f17e664bf10bfdd0e
7
- data.tar.gz: 6013724a8eb488ed73b2c8918096af8fc4c37a70e5e04aedcf66abd228412ec19606716b9a80a5b4ec829a99f4b071fe0978079ba35db9e023c58a4ea8265190
6
+ metadata.gz: e1c88943a0a2adbd3887374dc01e5f1b4be1edf14530cc7bd0408da1c8a35f3e5a1e3bf49dd72fc6fa9b077284e569c304ead13f16f77890eeacbcd6d7f579df
7
+ data.tar.gz: c351644417ea83f5c50b7bd011631df9b0b852a8a4bf553889464237da33437fe5a035d7ec687a8a668b68649f3fd2b260ffc578e41b9c3b7cb5391afe43867a
data/.gitignore CHANGED
@@ -1,3 +1,3 @@
1
- .byebug_history
1
+ .ruby-gemset
2
2
  .ruby-version
3
3
  coverage/
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- simple_scripting (0.9.4)
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.6.0)
30
- rspec-core (~> 3.6.0)
31
- rspec-expectations (~> 3.6.0)
32
- rspec-mocks (~> 3.6.0)
33
- rspec-core (3.6.0)
34
- rspec-support (~> 3.6.0)
35
- rspec-expectations (3.6.0)
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.6.0)
38
- rspec-mocks (3.6.0)
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.6.0)
41
- rspec-support (3.6.0)
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.6)
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
- ### Supported shells
80
+ ### Zsh
81
+
82
+ `TabCompletion` on Zsh requires `bashcompinit`; add the following to your `~/.zshrc`:
79
83
 
80
- TabCompletion supports Bash, and Zsh with bashcompinit.
84
+ ```sh
85
+ autoload bashcompinit
86
+ bashcompinit
87
+ ```
81
88
 
82
- Note that a recent version of Zsh is required - the Ubuntu 16.04 standard version has a bug that breaks bash-compatible completion.
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
 
@@ -89,6 +89,9 @@ module SimpleScripting
89
89
  end
90
90
 
91
91
  command = command_for_check
92
+
93
+ raise InvalidCommand.new("Missing command") if command.nil?
94
+
92
95
  command_params_definition = commands_definition[command]
93
96
 
94
97
  case command_params_definition
@@ -1,5 +1,5 @@
1
1
  module SimpleScripting
2
2
 
3
- VERSION = "0.10.0"
3
+ VERSION = "0.10.1"
4
4
 
5
5
  end
@@ -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-07-26"
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.6"
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.0
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-07-26 00:00:00.000000000 Z
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.6'
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.6'
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.6.13
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.