options 2.1.1 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README +9 -2
- data/Rakefile +3 -5
- data/lib/options.rb +6 -2
- data/options.gemspec +1 -1
- data/samples/d.rb +1 -1
- metadata +6 -7
data/README
CHANGED
@@ -25,6 +25,11 @@ SYNOPSIS
|
|
25
25
|
INSTALL
|
26
26
|
gem install options
|
27
27
|
|
28
|
+
HISTORY
|
29
|
+
2.1.0:
|
30
|
+
- 1.9 compatibility
|
31
|
+
- Validation of passed options
|
32
|
+
|
28
33
|
SAMPLES
|
29
34
|
|
30
35
|
|
@@ -168,12 +173,14 @@ SAMPLES
|
|
168
173
|
p force
|
169
174
|
end
|
170
175
|
|
171
|
-
method(:foo, :bar, :
|
176
|
+
method(:foo, :bar, :misspelled_option => true)
|
172
177
|
|
173
178
|
|
174
179
|
|
175
180
|
~ > ruby samples/d.rb
|
176
181
|
|
177
|
-
|
182
|
+
./lib/options.rb:180:in `validate': Unrecognized options: misspelled_option (ArgumentError)
|
183
|
+
from samples/d.rb:9:in `method'
|
184
|
+
from samples/d.rb:15
|
178
185
|
|
179
186
|
|
data/Rakefile
CHANGED
@@ -1,9 +1,7 @@
|
|
1
|
-
|
2
|
-
This.rubyforge_project = 'codeforpeople'
|
3
1
|
This.author = "Ara T. Howard"
|
4
2
|
This.email = "ara.t.howard@gmail.com"
|
5
3
|
This.homepage = "http://github.com/ahoward/#{ This.lib }/tree/master"
|
6
|
-
|
4
|
+
This.rubyforge_project = 'codeforpeople'
|
7
5
|
|
8
6
|
task :default do
|
9
7
|
puts(Rake::Task.tasks.map{|task| task.name} - ['default'])
|
@@ -16,7 +14,6 @@ task :spec do
|
|
16
14
|
end
|
17
15
|
end
|
18
16
|
|
19
|
-
|
20
17
|
task :gemspec do
|
21
18
|
ignore_extensions = 'git', 'svn', 'tmp', /sw./, 'bak', 'gem'
|
22
19
|
ignore_directories = 'pkg'
|
@@ -160,7 +157,8 @@ task :release => [:clean, :gemspec, :gem] do
|
|
160
157
|
gems = Dir[File.join(This.pkgdir, '*.gem')].flatten
|
161
158
|
raise "which one? : #{ gems.inspect }" if gems.size > 1
|
162
159
|
raise "no gems?" if gems.size < 1
|
163
|
-
cmd = "rubyforge login && rubyforge add_release #{ This.rubyforge_project } #{ This.lib } #{ This.version } #{ This.pkgdir }/#{ This.gem }"
|
160
|
+
#cmd = "rubyforge login && rubyforge add_release #{ This.rubyforge_project } #{ This.lib } #{ This.version } #{ This.pkgdir }/#{ This.gem }"
|
161
|
+
cmd = "rubyforge add_release #{ This.rubyforge_project } #{ This.lib } #{ This.version } #{ This.pkgdir }/#{ This.gem }"
|
164
162
|
puts cmd
|
165
163
|
system cmd
|
166
164
|
end
|
data/lib/options.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
module Options
|
2
|
-
VERSION = '2.
|
2
|
+
Options::VERSION = '2.2.0' unless defined?(Options::VERSION)
|
3
3
|
|
4
4
|
class << Options
|
5
5
|
def version
|
@@ -168,7 +168,11 @@ module Options
|
|
168
168
|
end
|
169
169
|
|
170
170
|
def pop!
|
171
|
-
|
171
|
+
if arguments.last.is_a?(Hash)
|
172
|
+
@popped = arguments.pop
|
173
|
+
else
|
174
|
+
@popped = true
|
175
|
+
end
|
172
176
|
end
|
173
177
|
|
174
178
|
# Validates that the options provided are acceptable.
|
data/options.gemspec
CHANGED
data/samples/d.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: options
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ara T. Howard
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2010-06-19 00:00:00 -06:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -22,22 +22,21 @@ extensions: []
|
|
22
22
|
extra_rdoc_files: []
|
23
23
|
|
24
24
|
files:
|
25
|
-
- lib
|
26
25
|
- lib/options.rb
|
27
26
|
- options.gemspec
|
28
27
|
- Rakefile
|
29
28
|
- README
|
30
29
|
- README.erb
|
31
|
-
- samples
|
32
30
|
- samples/a.rb
|
33
31
|
- samples/b.rb
|
34
32
|
- samples/c.rb
|
35
33
|
- samples/d.rb
|
36
|
-
- spec
|
37
34
|
- spec/options_spec.rb
|
38
35
|
- spec/spec_helper.rb
|
39
36
|
has_rdoc: true
|
40
37
|
homepage: http://github.com/ahoward/options/tree/master
|
38
|
+
licenses: []
|
39
|
+
|
41
40
|
post_install_message:
|
42
41
|
rdoc_options: []
|
43
42
|
|
@@ -58,9 +57,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
58
57
|
requirements: []
|
59
58
|
|
60
59
|
rubyforge_project: codeforpeople
|
61
|
-
rubygems_version: 1.3.
|
60
|
+
rubygems_version: 1.3.5
|
62
61
|
signing_key:
|
63
|
-
specification_version:
|
62
|
+
specification_version: 3
|
64
63
|
summary: options
|
65
64
|
test_files: []
|
66
65
|
|