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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a823b880e0feb218800faed1d191258594fb26ab2078fdfd5282df024677fd06
4
- data.tar.gz: fe212b6f93ff3548873896606de836842081319c3acbfd99438a15b38539c2a2
3
+ metadata.gz: c7b0c61e7c1636499757933c40267cb03c8762eeddc928ed49859de31eae21ab
4
+ data.tar.gz: a3dcbf06cb7af2ab4edac0664de185553781a59137fdf8602986ef92cb86d3a9
5
5
  SHA512:
6
- metadata.gz: 467b52c6de36c7a164739b301ef016efcef5abd62891682e8353f67f63b125bc8238abd853112fb544cdc2391d93dc492446c93a01220a5ef8c908ff2cb95ee1
7
- data.tar.gz: 6d027c76c43e84f8dab52bc04236568045c1dff962a58b0df029693b35cf535f03b2d5e4445993964bfcabe3d9093ff6465ba3ebfb399e661cc187388178b059
6
+ metadata.gz: a4a7a0c057d34ef83972cf56ccda260af5b349adc0c91922898cee4d2b7841d6e5bc8a31b1a83477a2b0404853de053250a34de2e27a4a8d07657bd157faa703
7
+ data.tar.gz: 96d2291b6b6504aceb7485f79ae3f035fdfa3b8a0aa8a7c84fb41e620b30f6ff5e8903b6c1c57e00cd855ea1fe1c54fac0629fde8a56cde5c816927637d4fa20
data/.travis.yml CHANGED
@@ -13,11 +13,12 @@ rvm:
13
13
  - 2.1
14
14
  - 2.2
15
15
  - 2.3.4
16
- - 2.4.9
17
- - 2.5.7
18
- - 2.6.5
19
- - 2.7.0
20
- - jruby-9.2.16.0
16
+ - 2.4.10
17
+ - 2.5.9
18
+ - 2.6.7
19
+ - 2.7.3
20
+ - 3.0.1
21
+ - jruby-9.2.17.0
21
22
  - jruby-head
22
23
  - ruby-head
23
24
  - truffleruby-head
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
- # both of these will return o[:files] as ["foo.txt", "bar.rb"]:
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
@@ -6,7 +6,7 @@ require 'slop/types'
6
6
  require 'slop/error'
7
7
 
8
8
  module Slop
9
- VERSION = '4.9.0'
9
+ VERSION = '4.9.1'
10
10
 
11
11
  # Parse an array of options (defaults to ARGV). Accepts an
12
12
  # optional hash of configuration options and block.
data/lib/slop/parser.rb CHANGED
@@ -52,7 +52,7 @@ module Slop
52
52
 
53
53
  # support `foo=bar`
54
54
  orig_flag = flag.dup
55
- if match = flag.match(/([^=]+)=([^=]+)/)
55
+ if match = flag.match(/([^=]+)=([^=]*)/)
56
56
  flag, arg = match.captures
57
57
  end
58
58
 
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.0
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 00:00:00.000000000 Z
11
+ date: 2021-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake