slop 4.9.1 → 4.9.2

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: c7b0c61e7c1636499757933c40267cb03c8762eeddc928ed49859de31eae21ab
4
- data.tar.gz: a3dcbf06cb7af2ab4edac0664de185553781a59137fdf8602986ef92cb86d3a9
3
+ metadata.gz: db594ae38cd4d8b8d078d3b3854e5dce764f4763107caacc02b0b270c33098d8
4
+ data.tar.gz: 6e1348ca3f3d642bff87411d33c78b2f3d1b654c11c079a228f327f82648cd5f
5
5
  SHA512:
6
- metadata.gz: a4a7a0c057d34ef83972cf56ccda260af5b349adc0c91922898cee4d2b7841d6e5bc8a31b1a83477a2b0404853de053250a34de2e27a4a8d07657bd157faa703
7
- data.tar.gz: 96d2291b6b6504aceb7485f79ae3f035fdfa3b8a0aa8a7c84fb41e620b30f6ff5e8903b6c1c57e00cd855ea1fe1c54fac0629fde8a56cde5c816927637d4fa20
6
+ metadata.gz: b578d6d172adf2b9c88d482fe27798d97a821b83ef7ff4f8b6e8ed37d63cd7f7963b9634b9f734e80d744c0fc077f47bc2a08e00feed02af90452c6415383494
7
+ data.tar.gz: 8fc6007694ba5df48585ac6561c1ec68cf50141d92cb6f080d50b6de700a0244aefd3d3d647f7ccee197c57cfcd3ad4721b2c88039ab6f9667cb47d4dc705620
@@ -0,0 +1,35 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ paths:
7
+ - "lib/**"
8
+ - "test/**"
9
+ - ".github/**"
10
+ - "Rakefile"
11
+ pull_request:
12
+ branches: ["**"]
13
+ paths:
14
+ - "lib/**"
15
+ - "test/**"
16
+ - ".github/**"
17
+ - "Rakefile"
18
+
19
+ jobs:
20
+ tests:
21
+ runs-on: ubuntu-latest
22
+ strategy:
23
+ fail-fast: false
24
+ matrix:
25
+ ruby: [ "2.0", "2.1", "2.2", "2.3", "2.4", "2.5", "2.6", "2.7", "3.0", "3.1", head, jruby, truffleruby ]
26
+ name: Ruby ${{ matrix.ruby }}
27
+ steps:
28
+ - uses: actions/checkout@v2
29
+ - name: Set up Ruby
30
+ uses: ruby/setup-ruby@v1
31
+ with:
32
+ ruby-version: ${{ matrix.ruby }}
33
+ bundler: none
34
+ - name: Run tests
35
+ run: rake test
data/CHANGELOG.md CHANGED
@@ -1,6 +1,12 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ v4.9.2 (2022-03-26)
5
+ -------------------
6
+
7
+ Bug fixes:
8
+ * Handle flag arguments that contain equals character [#275](https://github.com/leejarvis/slop/pull/275) (ConnorWGarvey)
9
+
4
10
  v4.9.1 (2021-05-28)
5
11
  -------------------
6
12
 
data/README.md CHANGED
@@ -3,7 +3,7 @@ Slop
3
3
 
4
4
  Slop is a simple option parser with an easy to remember syntax and friendly API.
5
5
 
6
- [![Build Status](https://travis-ci.org/leejarvis/slop.svg?branch=master)](http://travis-ci.org/leejarvis/slop)
6
+ [![Build Status](https://github.com/leejarvis/slop/actions/workflows/ci.yml/badge.svg)](https://github.com/leejarvis/slop/actions/workflows/ci.yml)
7
7
 
8
8
  Installation
9
9
  ------------
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/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.1'
9
+ VERSION = '4.9.2'
10
10
 
11
11
  # Parse an array of options (defaults to ARGV). Accepts an
12
12
  # optional hash of configuration options and block.
data/test/parser_test.rb CHANGED
@@ -17,16 +17,25 @@ describe Slop::Parser do
17
17
  assert_equal ["-v", "--name", "lee"], @parser.arguments
18
18
  end
19
19
 
20
- it "parses flag=argument" do
21
- @options.integer "-p", "--port"
22
- @result.parser.parse %w(--name=bob -p=123)
23
- assert_equal "bob", @result[:name]
24
- assert_equal 123, @result[:port]
20
+ describe "for flag=argument" do
21
+ it "parses names and values" do
22
+ @options.integer "-p", "--port"
23
+ @result.parser.parse %w(--name=bob -p=123)
24
+ assert_equal "bob", @result[:name]
25
+ assert_equal 123, @result[:port]
26
+ end
25
27
 
26
- @options.string "--foo"
27
- @result.parser.parse %w(--foo = =)
28
- assert_equal "=", @result[:foo]
29
- assert_equal %w(=), @result.args
28
+ it "treats an = separated by a space as a value" do
29
+ @options.string "--foo"
30
+ @result.parser.parse %w(--foo = =)
31
+ assert_equal "=", @result[:foo]
32
+ assert_equal %w(=), @result.args
33
+ end
34
+
35
+ it "includes = in strings" do
36
+ @result.parser.parse(%w(--name=b=b))
37
+ assert_equal "b=b", @result[:name]
38
+ end
30
39
  end
31
40
 
32
41
  it "parses flag=''" 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.9.1
4
+ version: 4.9.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: 2021-05-28 00:00:00.000000000 Z
11
+ date: 2022-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -44,8 +44,8 @@ executables: []
44
44
  extensions: []
45
45
  extra_rdoc_files: []
46
46
  files:
47
+ - ".github/workflows/ci.yml"
47
48
  - ".gitignore"
48
- - ".travis.yml"
49
49
  - CHANGELOG.md
50
50
  - Gemfile
51
51
  - LICENSE
@@ -86,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
86
86
  - !ruby/object:Gem::Version
87
87
  version: '0'
88
88
  requirements: []
89
- rubygems_version: 3.0.3
89
+ rubygems_version: 3.2.32
90
90
  signing_key:
91
91
  specification_version: 4
92
92
  summary: Simple Lightweight Option Parsing
data/.travis.yml DELETED
@@ -1,30 +0,0 @@
1
- cache: bundler
2
- before_install:
3
- - |
4
- export RVM_CURRENT=`rvm current|cut -c6-8`
5
- if [ "${RVM_CURRENT}" = "2.0" ] || \
6
- [ "${RVM_CURRENT}" = "2.1" ] || \
7
- [ "${RVM_CURRENT}" = "2.2" ]; then
8
- gem install bundler -v '< 2'
9
- fi
10
-
11
- rvm:
12
- - 2.0.0
13
- - 2.1
14
- - 2.2
15
- - 2.3.4
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
22
- - jruby-head
23
- - ruby-head
24
- - truffleruby-head
25
- jdk:
26
- - openjdk8
27
- notifications:
28
- email:
29
- on_success: change
30
- on_failure: always