minimist 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/Gemfile +3 -1
- data/README.md +1 -1
- data/lib/minimist.rb +5 -5
- data/lib/minimist/version.rb +1 -1
- data/minimist.gemspec +3 -2
- metadata +24 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 695086ee2373642e08f682dbbf21bf85fb5928a8
|
4
|
+
data.tar.gz: 96f723308581e4eca9c20b7ddb624284456d4af9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8167a565b40343ada9eee7cd5544d0561885f415ba25cf75a89584db00bc60403c896de43b413ad11018f7c8cdcb626cd386c388212e1deddb0f4924c56be5a
|
7
|
+
data.tar.gz: 05e6cc33b5fbbebcf95fdefe41b1c136493c1913c52680c2e61384210a491b184e2e35370de229a3edf550605c073e44f1db73b68c003c76f45229e48c07da84
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
data/lib/minimist.rb
CHANGED
@@ -73,7 +73,7 @@ module Minimist
|
|
73
73
|
if match_data = arg.match(/^-([A-Za-z])([0-9])$/)
|
74
74
|
argv_object[:options][match_data[1].to_sym] = match_data[2]
|
75
75
|
elsif @argv[index + 1] =~ /^(\d|[A-Za-z])/
|
76
|
-
argv_object[:options][arg.slice(1..-1).to_sym] =
|
76
|
+
argv_object[:options][arg.slice(1..-1).to_sym] = transform(@argv[index + 1])
|
77
77
|
should_skip = true
|
78
78
|
else
|
79
79
|
#
|
@@ -94,7 +94,7 @@ module Minimist
|
|
94
94
|
should_skip = false
|
95
95
|
|
96
96
|
if !match_data[2].empty?
|
97
|
-
argv_object[:options][match_data[1].to_sym] =
|
97
|
+
argv_object[:options][match_data[1].to_sym] = match_data[2]
|
98
98
|
else
|
99
99
|
val = true
|
100
100
|
|
@@ -103,7 +103,7 @@ module Minimist
|
|
103
103
|
should_skip = true
|
104
104
|
end
|
105
105
|
|
106
|
-
argv_object[:options][match_data[1].to_sym] = val
|
106
|
+
argv_object[:options][transform(match_data[1].to_sym)] = val
|
107
107
|
end
|
108
108
|
|
109
109
|
[argv_object, should_skip]
|
@@ -119,8 +119,8 @@ module Minimist
|
|
119
119
|
[argv_object, false]
|
120
120
|
end
|
121
121
|
|
122
|
-
def
|
123
|
-
|
122
|
+
def transform(val)
|
123
|
+
val.to_s.gsub('-', '_').to_sym
|
124
124
|
end
|
125
125
|
end
|
126
126
|
end
|
data/lib/minimist/version.rb
CHANGED
data/minimist.gemspec
CHANGED
@@ -19,6 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
|
-
spec.add_development_dependency "bundler"
|
23
|
-
spec.add_development_dependency "rake"
|
22
|
+
spec.add_development_dependency "bundler"
|
23
|
+
spec.add_development_dependency "rake"
|
24
|
+
spec.add_development_dependency "rspec"
|
24
25
|
end
|
metadata
CHANGED
@@ -1,43 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minimist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Connor Atherton
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
description: A lightweight ruby argv parser.
|
42
56
|
email:
|
43
57
|
- c.liam.atherton@gmail.com
|