slop 4.6.1 → 4.6.2

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
2
  SHA1:
3
- metadata.gz: fb0866db90cc2226117322463845a56a78f43cc2
4
- data.tar.gz: acd05e15e79c70f68d6248a9bdcf8e3c1afa128f
3
+ metadata.gz: 2ebf99ce79c4681f07967df62008038b3b3ef878
4
+ data.tar.gz: e074639079cede3024fc00eac71218a744427678
5
5
  SHA512:
6
- metadata.gz: 276b3847e95efdafb6eb47516168a3e4c984db3cf2b60c88eb8d7a9d67815956ea3d039a9ddc04dfc0d25c1ada21ab7c7d9a9825b39c31d85ab79e53b605cc78
7
- data.tar.gz: 211808f3fae95a2c7d69bee7072df3e8b05cc5c2c134d81706143d459741af3914f042a8b08a6952aa8628f5324d0cff50def90eb297a5307c87ce4794e8eb49
6
+ metadata.gz: 28ea608999bd09c8c02a43d9f67d571590dfd8742d3dd6712b5a67d3259d80273cfe3e434285dba0b6c524481d38de2fb2db599c4cab8d52d080088ace093cfb
7
+ data.tar.gz: 2cbedaf601a63a4a5ae57e46ea832827c54ebde7c69319f8313c034f89b0482af0f767fd6a4f9adbcfd5834ca31d7f6a087e4e60240399cbe96a19a3019a6380
@@ -1,6 +1,11 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ v4.6.2 (2018-03-12)
5
+
6
+ Bug fixes/Enhancements
7
+ * Fix equals character (=) being parsed incorrectly in some cases. #226
8
+
4
9
  v4.6.1 (2017-11-20)
5
10
  -------------------
6
11
 
@@ -6,7 +6,7 @@ require 'slop/types'
6
6
  require 'slop/error'
7
7
 
8
8
  module Slop
9
- VERSION = '4.6.1'
9
+ VERSION = '4.6.2'
10
10
 
11
11
  # Parse an array of options (defaults to ARGV). Accepts an
12
12
  # optional hash of configuration options and block.
@@ -53,8 +53,8 @@ module Slop
53
53
  # support `foo=bar`
54
54
  orig_flag = flag.dup
55
55
  orig_arg = arg
56
- if flag.include?("=")
57
- flag, arg = flag.split("=")
56
+ if match = flag.match(/([^=]+)=([^=]+)/)
57
+ flag, arg = match.captures
58
58
  end
59
59
 
60
60
  if opt = try_process(flag, arg)
@@ -21,6 +21,11 @@ describe Slop::Parser do
21
21
  @result.parser.parse %w(--name=bob -p=123)
22
22
  assert_equal "bob", @result[:name]
23
23
  assert_equal 123, @result[:port]
24
+
25
+ @options.string "--foo"
26
+ @result.parser.parse %w(--foo = =)
27
+ assert_equal "=", @result[:foo]
28
+ assert_equal %w(=), @result.args
24
29
  end
25
30
 
26
31
  it "parses arg with leading -" do
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.6.1
4
+ version: 4.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lee Jarvis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-20 00:00:00.000000000 Z
11
+ date: 2018-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
87
  version: '0'
88
88
  requirements: []
89
89
  rubyforge_project:
90
- rubygems_version: 2.5.2.1
90
+ rubygems_version: 2.5.2
91
91
  signing_key:
92
92
  specification_version: 4
93
93
  summary: Simple Lightweight Option Parsing