args_parser 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/lib/args_parser/parser.rb +1 -2
- data/lib/args_parser.rb +1 -1
- data/test/test_args_parser.rb +4 -2
- metadata +59 -73
data/History.txt
CHANGED
data/lib/args_parser/parser.rb
CHANGED
@@ -7,7 +7,6 @@ module ArgsParser
|
|
7
7
|
class Parser
|
8
8
|
attr_reader :first
|
9
9
|
|
10
|
-
|
11
10
|
private
|
12
11
|
def params
|
13
12
|
@params ||=
|
@@ -31,7 +30,7 @@ module ArgsParser
|
|
31
30
|
unless block_given?
|
32
31
|
raise ArgumentError, 'initialize block was not given'
|
33
32
|
end
|
34
|
-
instance_eval
|
33
|
+
instance_eval(&block)
|
35
34
|
parse argv
|
36
35
|
end
|
37
36
|
|
data/lib/args_parser.rb
CHANGED
data/test/test_args_parser.rb
CHANGED
@@ -31,7 +31,8 @@ class TestArgsParser < Test::Unit::TestCase
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def test_has_param?
|
34
|
-
assert
|
34
|
+
assert @parser.has_param? :input
|
35
|
+
assert @parser.has_param? :output
|
35
36
|
end
|
36
37
|
|
37
38
|
def test_has_params?
|
@@ -43,7 +44,8 @@ class TestArgsParser < Test::Unit::TestCase
|
|
43
44
|
end
|
44
45
|
|
45
46
|
def test_has_option?
|
46
|
-
assert
|
47
|
+
assert @parser.has_option? :help
|
48
|
+
assert @parser.has_option? :a
|
47
49
|
end
|
48
50
|
|
49
51
|
def test_has_options?
|
metadata
CHANGED
@@ -1,80 +1,74 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: args_parser
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 0
|
9
|
-
- 1
|
10
|
-
version: 0.0.1
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Sho Hashimoto
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-06-11 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: rdoc
|
22
|
-
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
24
17
|
none: false
|
25
|
-
requirements:
|
18
|
+
requirements:
|
26
19
|
- - ~>
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
|
29
|
-
segments:
|
30
|
-
- 3
|
31
|
-
- 10
|
32
|
-
version: "3.10"
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '3.10'
|
33
22
|
type: :development
|
34
|
-
version_requirements: *id001
|
35
|
-
- !ruby/object:Gem::Dependency
|
36
|
-
name: newgem
|
37
23
|
prerelease: false
|
38
|
-
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '3.10'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: newgem
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
39
33
|
none: false
|
40
|
-
requirements:
|
41
|
-
- -
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
hash: 5
|
44
|
-
segments:
|
45
|
-
- 1
|
46
|
-
- 5
|
47
|
-
- 3
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
48
37
|
version: 1.5.3
|
49
38
|
type: :development
|
50
|
-
version_requirements: *id002
|
51
|
-
- !ruby/object:Gem::Dependency
|
52
|
-
name: hoe
|
53
39
|
prerelease: false
|
54
|
-
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
55
41
|
none: false
|
56
|
-
requirements:
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 1.5.3
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: hoe
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
57
51
|
- - ~>
|
58
|
-
- !ruby/object:Gem::Version
|
59
|
-
|
60
|
-
segments:
|
61
|
-
- 2
|
62
|
-
- 15
|
63
|
-
version: "2.15"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '3.0'
|
64
54
|
type: :development
|
65
|
-
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3.0'
|
66
62
|
description: ARGV parser - Parse args from command line.
|
67
|
-
email:
|
63
|
+
email:
|
68
64
|
- hashimoto@shokai.org
|
69
65
|
executables: []
|
70
|
-
|
71
66
|
extensions: []
|
72
|
-
|
73
|
-
extra_rdoc_files:
|
67
|
+
extra_rdoc_files:
|
74
68
|
- History.txt
|
75
69
|
- Manifest.txt
|
76
70
|
- README.rdoc
|
77
|
-
files:
|
71
|
+
files:
|
78
72
|
- History.txt
|
79
73
|
- Manifest.txt
|
80
74
|
- README.rdoc
|
@@ -90,38 +84,30 @@ files:
|
|
90
84
|
- .gemtest
|
91
85
|
homepage: http://github.com/shokai/args_parser
|
92
86
|
licenses: []
|
93
|
-
|
94
87
|
post_install_message:
|
95
|
-
rdoc_options:
|
88
|
+
rdoc_options:
|
96
89
|
- --main
|
97
90
|
- README.rdoc
|
98
|
-
require_paths:
|
91
|
+
require_paths:
|
99
92
|
- lib
|
100
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
93
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
101
94
|
none: false
|
102
|
-
requirements:
|
103
|
-
- -
|
104
|
-
- !ruby/object:Gem::Version
|
105
|
-
|
106
|
-
|
107
|
-
- 0
|
108
|
-
version: "0"
|
109
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
|
+
requirements:
|
96
|
+
- - ! '>='
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '0'
|
99
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
110
100
|
none: false
|
111
|
-
requirements:
|
112
|
-
- -
|
113
|
-
- !ruby/object:Gem::Version
|
114
|
-
|
115
|
-
segments:
|
116
|
-
- 0
|
117
|
-
version: "0"
|
101
|
+
requirements:
|
102
|
+
- - ! '>='
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '0'
|
118
105
|
requirements: []
|
119
|
-
|
120
106
|
rubyforge_project: args_parser
|
121
|
-
rubygems_version: 1.8.
|
107
|
+
rubygems_version: 1.8.24
|
122
108
|
signing_key:
|
123
109
|
specification_version: 3
|
124
110
|
summary: ARGV parser - Parse args from command line.
|
125
|
-
test_files:
|
111
|
+
test_files:
|
126
112
|
- test/test_args_parser.rb
|
127
113
|
- test/test_helper.rb
|