slop 4.9.0 → 4.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +6 -5
- data/CHANGELOG.md +7 -0
- data/README.md +3 -1
- data/lib/slop.rb +1 -1
- data/lib/slop/parser.rb +1 -1
- data/test/parser_test.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: c7b0c61e7c1636499757933c40267cb03c8762eeddc928ed49859de31eae21ab
|
4
|
+
data.tar.gz: a3dcbf06cb7af2ab4edac0664de185553781a59137fdf8602986ef92cb86d3a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4a7a0c057d34ef83972cf56ccda260af5b349adc0c91922898cee4d2b7841d6e5bc8a31b1a83477a2b0404853de053250a34de2e27a4a8d07657bd157faa703
|
7
|
+
data.tar.gz: 96d2291b6b6504aceb7485f79ae3f035fdfa3b8a0aa8a7c84fb41e620b30f6ff5e8903b6c1c57e00cd855ea1fe1c54fac0629fde8a56cde5c816927637d4fa20
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
Changelog
|
2
2
|
=========
|
3
3
|
|
4
|
+
v4.9.1 (2021-05-28)
|
5
|
+
-------------------
|
6
|
+
|
7
|
+
Bug fixes:
|
8
|
+
* Fixed a bug where `flag=arg` syntax would raise an error when an
|
9
|
+
empty value was passed. [#266](https://github.com/leejarvis/slop/issues/266)
|
10
|
+
|
4
11
|
v4.9.0 (2021-05-11)
|
5
12
|
-------------------
|
6
13
|
|
data/README.md
CHANGED
@@ -135,9 +135,11 @@ opts = Slop.parse do |o|
|
|
135
135
|
o.array '--files', 'a list of files', delimiter: ','
|
136
136
|
end
|
137
137
|
|
138
|
-
#
|
138
|
+
# Both of these will return o[:files] as ["foo.txt", "bar.rb"]:
|
139
139
|
# --files foo.txt,bar.rb
|
140
140
|
# --files foo.txt --files bar.rb
|
141
|
+
# This will return o[:files] as []:
|
142
|
+
# --files ""
|
141
143
|
```
|
142
144
|
|
143
145
|
If you want to disable the built-in string-splitting, set the delimiter to
|
data/lib/slop.rb
CHANGED
data/lib/slop/parser.rb
CHANGED
data/test/parser_test.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'test_helper'
|
2
|
+
require 'shellwords'
|
2
3
|
|
3
4
|
describe Slop::Parser do
|
4
5
|
before do
|
@@ -28,6 +29,15 @@ describe Slop::Parser do
|
|
28
29
|
assert_equal %w(=), @result.args
|
29
30
|
end
|
30
31
|
|
32
|
+
it "parses flag=''" do
|
33
|
+
@options.string "--str"
|
34
|
+
@options.array "--arr", default: ["array"]
|
35
|
+
@result.parser.parse %(--str="" --arr="").shellsplit
|
36
|
+
|
37
|
+
assert_equal "", @result[:str]
|
38
|
+
assert_equal [], @result[:arr]
|
39
|
+
end
|
40
|
+
|
31
41
|
it "parses arg with leading -" do
|
32
42
|
@options.string "-t", "--text"
|
33
43
|
@result.parser.parse %w(--name=bob --text --sometext)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.9.
|
4
|
+
version: 4.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lee Jarvis
|
8
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: rake
|