tins 0.4.0 → 0.4.1
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.
- data/VERSION +1 -1
- data/lib/tins/go.rb +1 -0
- data/lib/tins/version.rb +1 -1
- data/tests/go_test.rb +8 -0
- data/tins.gemspec +1 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.1
|
data/lib/tins/go.rb
CHANGED
@@ -24,6 +24,7 @@ module Tins
|
|
24
24
|
# An option hash is returned with all found options set to true or the
|
25
25
|
# found option argument.
|
26
26
|
def go(s, args = ARGV)
|
27
|
+
args = args.map(&:dup)
|
27
28
|
b, v = s.scan(/(.)(:?)/).inject([ {}, {} ]) { |t, (o, a)|
|
28
29
|
a = a == ':'
|
29
30
|
t[a ? 1 : 0][o] = a ? nil : false
|
data/lib/tins/version.rb
CHANGED
data/tests/go_test.rb
CHANGED
@@ -32,5 +32,13 @@ module Tins
|
|
32
32
|
assert_equal({ 'a' => 2, 'b' => 'hello' }, r)
|
33
33
|
assert_equal %w[hello world], r['b'].to_a
|
34
34
|
end
|
35
|
+
|
36
|
+
def test_complex_frozen
|
37
|
+
args = %w[-b hello -aa -b world -c]
|
38
|
+
args = args.map(&:freeze)
|
39
|
+
r = go 'ab:', args
|
40
|
+
assert_equal({ 'a' => 2, 'b' => 'hello' }, r)
|
41
|
+
assert_equal %w[hello world], r['b'].to_a
|
42
|
+
end
|
35
43
|
end
|
36
44
|
end
|
data/tins.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tins
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -351,7 +351,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
351
351
|
version: '0'
|
352
352
|
segments:
|
353
353
|
- 0
|
354
|
-
hash:
|
354
|
+
hash: 4100283347471528269
|
355
355
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
356
356
|
none: false
|
357
357
|
requirements:
|