slop 4.8.0 → 4.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/slop.rb +2 -2
- data/test/slop_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: 9ec00c622e6cf0e93fdcebfa0964225fd2a2be127fcf21191a47bb96a64afb2b
|
4
|
+
data.tar.gz: 129ca3a92e02e2ac696c4a1dbc805a6316e59f8802d7c06fe3b071ef4467e6e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6280d06c83bafc75d2b2169d0c08ac1470031777aad641a162dda1657dbaa8940dad56ae20431fe7dc34eba52ab6a6f42a8dbb0207ad0f568cc21d5ed84884d
|
7
|
+
data.tar.gz: ce64d1d1d442cbb4a09c130e14a7f4d9837d53cf6ed2b4b4c3db1264650ebaba50cf500418737bbf265940dc2f430c14b30641394aca1b5626680fec4d4f4411
|
data/CHANGELOG.md
CHANGED
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.8.
|
9
|
+
VERSION = '4.8.1'
|
10
10
|
|
11
11
|
# Parse an array of options (defaults to ARGV). Accepts an
|
12
12
|
# optional hash of configuration options and block.
|
@@ -20,7 +20,7 @@ module Slop
|
|
20
20
|
#
|
21
21
|
# Returns a Slop::Result.
|
22
22
|
def self.parse(items = ARGV, **config, &block)
|
23
|
-
Options.new(config, &block).parse(items)
|
23
|
+
Options.new(**config, &block).parse(items)
|
24
24
|
end
|
25
25
|
|
26
26
|
# Example:
|
data/test/slop_test.rb
CHANGED
@@ -1,6 +1,16 @@
|
|
1
1
|
require "test_helper"
|
2
2
|
|
3
3
|
describe Slop do
|
4
|
+
describe ".parse" do
|
5
|
+
it "parses a list of arguments" do
|
6
|
+
result = Slop.parse(%w[--name Lee]) do |o|
|
7
|
+
o.string "--name"
|
8
|
+
end
|
9
|
+
|
10
|
+
assert_equal "Lee", result[:name]
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
4
14
|
describe ".option_defined?" do
|
5
15
|
it "handles bad constant names" do
|
6
16
|
assert_equal false, Slop.option_defined?("Foo?Bar")
|
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.8.
|
4
|
+
version: 4.8.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: 2020-
|
11
|
+
date: 2020-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|