options 2.3.0 → 2.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/Rakefile +21 -16
- data/lib/options.rb +5 -1
- data/options.gemspec +23 -6
- metadata +28 -60
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
OTc4ODRmYjZkYTgzODVlMWRhZTY4YTFjOWVkYjAwOTRmY2ZhZjczYg==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
MTk5NzFkZDNiZGE3YzJmNTNhMzI2YmY3M2JkNTdmMDFlNTZlN2MwMw==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
OGFjZjRhMjY0ODEzOTg5NmI3MjYyNDFlZTAyMzEyNDBmOGQzMmIwMzBhYTUy
|
10
|
+
MDczNWE2YzA0NDEzYzAxYzg1MmQzYmRhYTVlZDE4ODlhMDA4MmNhOTI3MDI5
|
11
|
+
OWFlYWFhMmNiNjA2ZGIxZWY3ZmU1MDQ4MzQ0MmI3MTcwZjdlMTA=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
NzZiMTBjYTRkZDFiN2I2MjZjZDM2NmY5M2RmZWYwNDc1MDcxZTlhM2JiODNl
|
14
|
+
YmY2YjI4OTZlMmYzOGJjNDA3MmE5NjM3MTJlNTIzNGUyMjIxYjAwYTBmODY2
|
15
|
+
ZjA5NDIxYWIzMjFjNzYyM2UxNDBkM2NmYjM3YTg3NTJkM2I1Njg=
|
data/Rakefile
CHANGED
@@ -1,8 +1,11 @@
|
|
1
1
|
This.rubyforge_project = 'codeforpeople'
|
2
2
|
This.author = "Ara T. Howard"
|
3
3
|
This.email = "ara.t.howard@gmail.com"
|
4
|
-
This.homepage = "
|
4
|
+
This.homepage = "https://github.com/ahoward/#{ This.lib }"
|
5
5
|
|
6
|
+
task :license do
|
7
|
+
open('LICENSE', 'w'){|fd| fd.puts "same as ruby's"}
|
8
|
+
end
|
6
9
|
|
7
10
|
task :default do
|
8
11
|
puts((Rake::Task.tasks.map{|task| task.name.gsub(/::/,':')} - ['default']).sort)
|
@@ -26,11 +29,10 @@ def run_tests!(which = nil)
|
|
26
29
|
|
27
30
|
div = ('=' * 119)
|
28
31
|
line = ('-' * 119)
|
29
|
-
helper = "-r ./test/helper.rb" if test(?e, "./test/helper.rb")
|
30
32
|
|
31
33
|
test_rbs.each_with_index do |test_rb, index|
|
32
34
|
testno = index + 1
|
33
|
-
command = "#{ This.ruby } -I ./lib -I ./test/lib #{
|
35
|
+
command = "#{ This.ruby } -w -I ./lib -I ./test/lib #{ test_rb }"
|
34
36
|
|
35
37
|
puts
|
36
38
|
say(div, :color => :cyan, :bold => true)
|
@@ -59,9 +61,9 @@ end
|
|
59
61
|
|
60
62
|
|
61
63
|
task :gemspec do
|
62
|
-
ignore_extensions = 'git', 'svn', 'tmp', /sw./, 'bak', 'gem'
|
63
|
-
ignore_directories = 'pkg'
|
64
|
-
ignore_files = 'test/log'
|
64
|
+
ignore_extensions = ['git', 'svn', 'tmp', /sw./, 'bak', 'gem']
|
65
|
+
ignore_directories = ['pkg']
|
66
|
+
ignore_files = ['test/log']
|
65
67
|
|
66
68
|
shiteless =
|
67
69
|
lambda do |list|
|
@@ -87,10 +89,11 @@ task :gemspec do
|
|
87
89
|
version = This.version
|
88
90
|
files = shiteless[Dir::glob("**/**")]
|
89
91
|
executables = shiteless[Dir::glob("bin/*")].map{|exe| File.basename(exe)}
|
90
|
-
has_rdoc = true #File.exist?('doc')
|
92
|
+
#has_rdoc = true #File.exist?('doc')
|
91
93
|
test_files = "test/#{ lib }.rb" if File.file?("test/#{ lib }.rb")
|
92
94
|
summary = object.respond_to?(:summary) ? object.summary : "summary: #{ lib } kicks the ass"
|
93
95
|
description = object.respond_to?(:description) ? object.description : "description: #{ lib } kicks the ass"
|
96
|
+
license = object.respond_to?(:license) ? object.license : "same as ruby's"
|
94
97
|
|
95
98
|
if This.extensions.nil?
|
96
99
|
This.extensions = []
|
@@ -116,16 +119,17 @@ task :gemspec do
|
|
116
119
|
spec.platform = Gem::Platform::RUBY
|
117
120
|
spec.summary = #{ lib.inspect }
|
118
121
|
spec.description = #{ description.inspect }
|
122
|
+
spec.license = #{ license.inspect }
|
119
123
|
|
120
|
-
spec.files
|
124
|
+
spec.files =\n#{ files.sort.pretty_inspect }
|
121
125
|
spec.executables = #{ executables.inspect }
|
122
126
|
|
123
127
|
spec.require_path = "lib"
|
124
128
|
|
125
|
-
spec.has_rdoc = #{ has_rdoc.inspect }
|
126
129
|
spec.test_files = #{ test_files.inspect }
|
127
|
-
|
128
|
-
|
130
|
+
|
131
|
+
### spec.add_dependency 'lib', '>= version'
|
132
|
+
#### spec.add_dependency 'map'
|
129
133
|
|
130
134
|
spec.extensions.push(*#{ extensions.inspect })
|
131
135
|
|
@@ -139,7 +143,7 @@ task :gemspec do
|
|
139
143
|
end
|
140
144
|
|
141
145
|
Fu.mkdir_p(This.pkgdir)
|
142
|
-
gemspec =
|
146
|
+
gemspec = "#{ lib }.gemspec"
|
143
147
|
open(gemspec, "w"){|fd| fd.puts(template)}
|
144
148
|
This.gemspec = gemspec
|
145
149
|
end
|
@@ -176,8 +180,8 @@ task :readme do
|
|
176
180
|
end
|
177
181
|
|
178
182
|
template =
|
179
|
-
if test(?e, '
|
180
|
-
Template{ IO.read('
|
183
|
+
if test(?e, 'README.erb')
|
184
|
+
Template{ IO.read('README.erb') }
|
181
185
|
else
|
182
186
|
Template {
|
183
187
|
<<-__
|
@@ -235,6 +239,7 @@ BEGIN {
|
|
235
239
|
require 'erb'
|
236
240
|
require 'fileutils'
|
237
241
|
require 'rbconfig'
|
242
|
+
require 'pp'
|
238
243
|
|
239
244
|
# fu shortcut
|
240
245
|
#
|
@@ -292,7 +297,7 @@ BEGIN {
|
|
292
297
|
|
293
298
|
def unindent(s)
|
294
299
|
indent = nil
|
295
|
-
s.
|
300
|
+
s.each_line do |line|
|
296
301
|
next if line =~ %r/^\s*$/
|
297
302
|
indent = line[%r/^\s*/] and break
|
298
303
|
end
|
@@ -309,7 +314,7 @@ BEGIN {
|
|
309
314
|
@template = block.call.to_s
|
310
315
|
end
|
311
316
|
def expand(b=nil)
|
312
|
-
ERB.new(Util.unindent(@template)).result(b||@block)
|
317
|
+
ERB.new(Util.unindent(@template)).result((b||@block).binding)
|
313
318
|
end
|
314
319
|
alias_method 'to_s', 'expand'
|
315
320
|
end
|
data/lib/options.rb
CHANGED
@@ -1,11 +1,15 @@
|
|
1
1
|
module Options
|
2
|
-
Options::VERSION = '2.3.
|
2
|
+
Options::VERSION = '2.3.1' unless defined?(Options::VERSION)
|
3
3
|
|
4
4
|
class << Options
|
5
5
|
def version
|
6
6
|
Options::VERSION
|
7
7
|
end
|
8
8
|
|
9
|
+
def description
|
10
|
+
'parse options from *args cleanly'
|
11
|
+
end
|
12
|
+
|
9
13
|
def normalize!(hash)
|
10
14
|
hash.keys.each{|key| hash[key.to_s.to_sym] = hash.delete(key) unless Symbol===key}
|
11
15
|
hash
|
data/options.gemspec
CHANGED
@@ -3,24 +3,41 @@
|
|
3
3
|
|
4
4
|
Gem::Specification::new do |spec|
|
5
5
|
spec.name = "options"
|
6
|
-
spec.version = "2.
|
6
|
+
spec.version = "2.3.1"
|
7
7
|
spec.platform = Gem::Platform::RUBY
|
8
8
|
spec.summary = "options"
|
9
|
+
spec.description = "parse options from *args cleanly"
|
10
|
+
spec.license = "same as ruby's"
|
11
|
+
|
12
|
+
spec.files =
|
13
|
+
["README",
|
14
|
+
"README.erb",
|
15
|
+
"Rakefile",
|
16
|
+
"lib",
|
17
|
+
"lib/options.rb",
|
18
|
+
"options.gemspec",
|
19
|
+
"samples",
|
20
|
+
"samples/a.rb",
|
21
|
+
"samples/b.rb",
|
22
|
+
"samples/c.rb",
|
23
|
+
"samples/d.rb",
|
24
|
+
"spec",
|
25
|
+
"spec/options_spec.rb",
|
26
|
+
"spec/spec_helper.rb"]
|
9
27
|
|
10
|
-
spec.files = ["lib", "lib/options.rb", "options.gemspec", "Rakefile", "README", "README.erb", "samples", "samples/a.rb", "samples/b.rb", "samples/c.rb", "samples/d.rb", "spec", "spec/options_spec.rb", "spec/spec_helper.rb"]
|
11
28
|
spec.executables = []
|
12
29
|
|
13
30
|
spec.require_path = "lib"
|
14
31
|
|
15
|
-
spec.has_rdoc = true
|
16
32
|
spec.test_files = nil
|
17
|
-
|
18
|
-
|
33
|
+
|
34
|
+
### spec.add_dependency 'lib', '>= version'
|
35
|
+
#### spec.add_dependency 'map'
|
19
36
|
|
20
37
|
spec.extensions.push(*[])
|
21
38
|
|
22
39
|
spec.rubyforge_project = "codeforpeople"
|
23
40
|
spec.author = "Ara T. Howard"
|
24
41
|
spec.email = "ara.t.howard@gmail.com"
|
25
|
-
spec.homepage = "
|
42
|
+
spec.homepage = "https://github.com/ahoward/options"
|
26
43
|
end
|
metadata
CHANGED
@@ -1,86 +1,54 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: options
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
segments:
|
6
|
-
- 2
|
7
|
-
- 3
|
8
|
-
- 0
|
9
|
-
version: 2.3.0
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 2.3.1
|
10
5
|
platform: ruby
|
11
|
-
authors:
|
6
|
+
authors:
|
12
7
|
- Ara T. Howard
|
13
8
|
autorequire:
|
14
9
|
bindir: bin
|
15
10
|
cert_chain: []
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
dependencies:
|
20
|
-
- !ruby/object:Gem::Dependency
|
21
|
-
name: fattr
|
22
|
-
prerelease: false
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
-
none: false
|
25
|
-
requirements:
|
26
|
-
- - ">="
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
segments:
|
29
|
-
- 0
|
30
|
-
version: "0"
|
31
|
-
type: :runtime
|
32
|
-
version_requirements: *id001
|
33
|
-
description: "description: options kicks the ass"
|
11
|
+
date: 2014-02-15 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: parse options from *args cleanly
|
34
14
|
email: ara.t.howard@gmail.com
|
35
15
|
executables: []
|
36
|
-
|
37
16
|
extensions: []
|
38
|
-
|
39
17
|
extra_rdoc_files: []
|
40
|
-
|
41
|
-
files:
|
42
|
-
- lib/options.rb
|
43
|
-
- options.gemspec
|
44
|
-
- Rakefile
|
18
|
+
files:
|
45
19
|
- README
|
46
20
|
- README.erb
|
21
|
+
- Rakefile
|
22
|
+
- lib/options.rb
|
23
|
+
- options.gemspec
|
47
24
|
- samples/a.rb
|
48
25
|
- samples/b.rb
|
49
26
|
- samples/c.rb
|
50
27
|
- samples/d.rb
|
51
28
|
- spec/options_spec.rb
|
52
29
|
- spec/spec_helper.rb
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
30
|
+
homepage: https://github.com/ahoward/options
|
31
|
+
licenses:
|
32
|
+
- same as ruby's
|
33
|
+
metadata: {}
|
57
34
|
post_install_message:
|
58
35
|
rdoc_options: []
|
59
|
-
|
60
|
-
require_paths:
|
36
|
+
require_paths:
|
61
37
|
- lib
|
62
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
segments:
|
76
|
-
- 0
|
77
|
-
version: "0"
|
38
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - ! '>='
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '0'
|
43
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ! '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
78
48
|
requirements: []
|
79
|
-
|
80
49
|
rubyforge_project: codeforpeople
|
81
|
-
rubygems_version:
|
50
|
+
rubygems_version: 2.0.3
|
82
51
|
signing_key:
|
83
|
-
specification_version:
|
52
|
+
specification_version: 4
|
84
53
|
summary: options
|
85
54
|
test_files: []
|
86
|
-
|