applix 0.4.9 → 0.4.10

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1,6 +1,7 @@
1
- *.sw?
1
+ # Ignore logfiles and tempfiles.
2
+ /log/*
3
+ /tmp
4
+
5
+ ## PROJECT::SPECIFIC
2
6
  Gemfile.lock
3
- .DS_Store
4
- coverage
5
- rdoc
6
- pkg
7
+ README.html
data/.travis.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.9.2
3
+ # - 1.9.2
4
4
  - 1.9.3 # switched to debugger gem
5
5
  - jruby-19mode # JRuby in 1.9 mode
6
6
  # uncomment this line if your project needs to run something other than `rake`:
data/applix.gemspec CHANGED
@@ -12,8 +12,8 @@ Gem::Specification.new do |s|
12
12
  s.summary = 'extracting typed option hashes from command line arguments'
13
13
  s.description = %q{
14
14
  ApplixHash#from_argv builds hashes from ARGV like argument vectors
15
- according to following examples:
16
-
15
+ according to following examples:
16
+
17
17
  '-f' --> { :f => true }
18
18
  '--flag' --> { :flag => true }
19
19
  '--flag:false' --> { :flag => false }
@@ -26,11 +26,11 @@ Gem::Specification.new do |s|
26
26
  '--txt:'"foo bar"'' --> { :txt => "foo bar" }
27
27
  '--txt:%w{foo bar}' --> { :txt => ["foo", "bar"] }
28
28
  '--now:Time.now' --> { :now => #<Date: 3588595/2,0,2299161> }
29
-
29
+
30
30
  remaining arguments(non flag/options) are inserted as [:arguments,
31
31
  args], eg:
32
32
  Hash.from_argv %w(--foo --bar=loo 123 now)
33
- becomes
33
+ becomes
34
34
  { :foo => true, :bar => 'loo', :arguments => ["123", "now"] }
35
35
  }
36
36
 
@@ -51,9 +51,10 @@ Gem::Specification.new do |s|
51
51
  s.add_development_dependency 'debugger'
52
52
  end
53
53
 
54
+ # version class is read from
54
55
  s.files = `git ls-files`.split("\n")
55
56
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
56
- s.executables = `git ls-files -- bin/*`.split("\n").map do |f|
57
+ s.executables = `git ls-files -- bin/*`.split("\n").map do |f|
57
58
  File.basename(f)
58
59
  end
59
60
  s.require_paths = ["lib"]
data/lib/applix.rb CHANGED
@@ -1,36 +1,51 @@
1
1
  require 'applix/hash'
2
2
 
3
- class Applix
4
- def self.main argv, defaults = {}, &blk
5
- app = Applix.new
6
- app.instance_eval(&blk)
7
- app.run(argv, defaults, &blk)
8
- end
3
+ # command line options & argument routing controller. A typical usage
4
+ # Applix.main(ARGV). see also: ApplixHash for argument parsing options.
5
+ #
6
+ class Applix
7
+
8
+ # prints primitve usage in case of error,
9
+ #
10
+ def self.main argv, app_defaults = {}, &blk
11
+ self.main!(argv, app_defaults, &blk)
9
12
 
10
- def self.main! argv, defaults = {}, &blk
11
- self.main argv, defaults, &blk
12
13
  rescue => e
13
- puts <<-EOT
14
+ puts <<-TXT
15
+
16
+ usage: #{$0} <args...>"
14
17
 
15
- ## #{e}
18
+ TXT
19
+ end
20
+
21
+ # raises exception on error
22
+ # dumps callstack in case of error when --debug is enabled
23
+ #
24
+ def self.main! argv, app_defaults = {}, &blk
25
+ app = Applix.new(app_defaults.merge(Hash.from_argv argv))
26
+ app.instance_eval(&blk)
27
+ app.run(argv, app_defaults, &blk)
16
28
 
17
- usage: #{$0} <args...>
29
+ rescue => e
30
+ #app.debug? and (puts %[ !! #{e}:\n#{e.backtrace.join "\n"}])
31
+ (puts %[ !! #{e}:\n#{e.backtrace.join "\n"}]) if app.debug?
32
+ raise
33
+ end
18
34
 
19
- --- #{e.backtrace.join "\n "}
20
- EOT
35
+ def debug?
36
+ @options[:debug] == true
21
37
  end
22
38
 
23
- def run argv, defaults
24
- options = (Hash.from_argv argv)
25
- options = (defaults.merge options)
26
- args = (options.delete :args)
39
+ def run argv, defaults = {}
40
+ # run defaults are overloaded with argv command line options
41
+ run_options = defaults.merge(Hash.from_argv argv)
42
+ args = (run_options.delete :args)
27
43
 
28
44
  # pre handle, can modify args & options
29
- @prolog_cb.call(args, options) unless @prolog_cb.nil?
30
-
45
+ @prolog_cb.call(args, run_options) unless @prolog_cb.nil?
31
46
 
32
47
  # logic table for dispatching the command line onto an action
33
- #
48
+ #
34
49
  # id | name exits? any | action
35
50
  # -- | -----------------+--------------
36
51
  # 1 | - - | error: no any, mapped to #3 with name == :any
@@ -46,31 +61,39 @@ usage: #{$0} <args...>
46
61
  task = tasks[name] || tasks[:any]
47
62
  task or (raise "no such task: '#{name}'")
48
63
 
49
- # case #4: we must un-shift the name back into the args list to lets any
50
- # see it as its first argument,
64
+ # case #4: we must un-shift the name back into the args list to let :any
65
+ # still sees it as first argument,
51
66
  (args.unshift name.to_s) if(name != :any && task[:name] == :any)
52
67
 
53
68
  # cluster for nesting or direct calling?
54
69
  if task[:cluster]
55
70
  #rc = Applix.main(args, options, &task[:code])
56
71
  cluster_task = task[:name].to_sym
57
- cluster_options = options.merge(options[cluster_task] || {})
72
+ cluster_options = run_options.merge(run_options[cluster_task] || {})
58
73
  cluster_options.delete(cluster_task)
59
74
  cluster_options.merge!(Hash.from_argv argv)
60
75
  rc = Applix.main(args, cluster_options, &task[:code])
61
76
  else
62
- rc = task[:code].call(*args, options)
77
+ rc = task[:code].call(*args, run_options)
63
78
  end
64
79
 
65
80
  # post handle
66
81
  unless @epilog_cb.nil?
67
- rc = @epilog_cb.call(rc, args, options)
82
+ rc = @epilog_cb.call(rc, args, run_options)
68
83
  end
69
84
 
70
85
  rc # return result code from handle callbacks, not the epilog_cb
71
86
  end
72
87
 
73
- private
88
+ private
89
+
90
+ Defaults = {
91
+ debug: false,
92
+ }
93
+
94
+ def initialize app_defaults = {}
95
+ @options = (Defaults.merge app_defaults)
96
+ end
74
97
 
75
98
  def prolog &blk
76
99
  @prolog_cb = blk
data/lib/applix/hash.rb CHANGED
@@ -2,7 +2,7 @@ module ApplixHash
2
2
 
3
3
  module ClassMethods
4
4
  # #from_argv builds hash from ARGV like argument vector according to
5
- # following examples:
5
+ # following examples:
6
6
  #
7
7
  # '-f' --> { :f => true }
8
8
  # '--flag' --> { :flag => true }
@@ -19,7 +19,7 @@ module ApplixHash
19
19
  #
20
20
  # remaining arguments(non flag/options) are inserted as [:args]. eg:
21
21
  # Hash.from_argv %w(--foo --bar=loo 123 now)
22
- # becomes
22
+ # becomes
23
23
  # { :foo => true, :bar => 'loo', :args => ["123", "now"] }
24
24
  #
25
25
  def from_argv argv, opts = {}
@@ -29,7 +29,7 @@ module ApplixHash
29
29
  break unless key
30
30
  h[key] = val
31
31
  args.shift
32
- end
32
+ end
33
33
  #[args, h]
34
34
  h[:args] = args
35
35
  h
@@ -39,7 +39,7 @@ module ApplixHash
39
39
  # parse single flag/option into a [key, value] tuple. returns nil on non
40
40
  # option/flag arguments.
41
41
  def self.parse(arg)
42
- m = /^(-(\w)|--(\w\w+))(([=:])(.+))?$/.match(arg)
42
+ m = /^(-(\w)|--(\w[\w-]+))(([=:])(.+))?$/.match(arg)
43
43
  return [nil, arg] unless m # neither option nor flag -> straight arg
44
44
  key = (m[2] || m[3]).to_sym
45
45
  value = m[6][/(['"]?)(.*)\1$/,2] rescue true
@@ -1,3 +1,5 @@
1
+ # gem version is extracted automatically from this class during the build
2
+ # process
1
3
  class Applix
2
- VERSION = '0.4.9'
4
+ VERSION = '0.4.10'
3
5
  end
@@ -0,0 +1,20 @@
1
+ require 'spec_helper'
2
+
3
+ describe ApplixHash do
4
+ it 'parses dashed string options' do
5
+ (ApplixHash.parse '--foo-bar').should == ["foo-bar".to_sym, true]
6
+ (ApplixHash.parse '--foo-bar=321').should == ["foo-bar".to_sym, '321']
7
+ end
8
+
9
+ it "parses the old unit test..." do
10
+ # -f becomes { :f => true }
11
+ # --flag becomes { :flag => true }
12
+ (ApplixHash.parse '-f').should == [:f, true]
13
+ (ApplixHash.parse '--flag').should == [:flag, true]
14
+ # --flag:false becomes { :flag => false }
15
+ (ApplixHash.parse '--flag:false').should == [:flag, false]
16
+
17
+ # --option=value becomes { :option => "value" }
18
+ (ApplixHash.parse '--opt=val').should == [:opt, 'val']
19
+ end
20
+ end
data/spec/applix_spec.rb CHANGED
@@ -2,62 +2,93 @@ require 'spec_helper'
2
2
 
3
3
  describe Applix do
4
4
 
5
- it 'cluster defaults shadow globals' do
6
- args = %w(-c=5 cluster cmd)
7
- Applix.main(args, a: :global, b: 2, :cluster => {a: :cluster, c: 3}) do
8
- handle(:cmd) { raise 'should not be called!' }
9
- cluster(:cluster) do
10
- handle(:cmd) do |*args, options|
11
- options.should == {:a => :cluster, :b => 2, :c => '5'}
12
- args
13
- end
14
- end
5
+ context 'main' do
6
+ it 'catches unknown task errors' do
7
+ expect { Applix.main(%w(no-such-task)) {} }.
8
+ should_not raise_error /no-such-task/
15
9
  end
16
- end
17
10
 
18
- it 'calls cluster prolog' do
19
- Applix.main(%w(foo a b)) do
20
- cluster(:foo) do
21
- prolog { |args, options|
22
- args.should == %w(a b)
23
- args.reverse!
24
- }
25
- handle(:a) { raise 'should not be called!' }
26
- handle(:b) { :b_was_called }
11
+ context 'with captured I/O streams' do
12
+ it 'prints a minimal (better than nothing?) usage line on errors' do
13
+ output = capture(:stdout) { Applix.main(%w(no-such-task)) {} }
14
+ output.should =~ /usage: /
27
15
  end
28
- end.should == :b_was_called
29
- end
30
16
 
31
- it 'support :cluster for nesting' do
32
- args = %w(-a -b:2 foo bar p1 p2)
33
- Applix.main(args) do
34
- handle(:foo) do
35
- raise 'should not be called!'
17
+ it 'suppresses the callstack on errors' do
18
+ output = capture(:stdout) { Applix.main(%w(no-such-task)) {} }
19
+ output.should_not =~ /no such task:/
36
20
  end
37
- cluster(:foo) do
38
- handle(:bar) do |*args, options|
39
- args.should == %w(p1 p2)
40
- options.should == {:a => true, :b => 2}
41
- args
42
- end
21
+
22
+ it 'shows callstack on --debug option' do
23
+ output = capture(:stdout) { Applix.main(%w(--debug no-such-task)) {} }
24
+ output.should =~ / !! no such task:/
25
+ end
26
+
27
+ it 'dumps a stacktrace on main with a !' do
28
+ expect { Applix.main!(%w(no-such-task)) {} }.
29
+ should raise_error /no such task:/
43
30
  end
44
- end.should == %w{p1 p2}
31
+ end
45
32
  end
46
33
 
47
- it 'can even cluster clusters' do
48
- args = %w(foo bar f p1 p2)
49
- Applix.main(args) do
50
- cluster(:foo) do
51
- cluster(:bar) do
52
- handle(:f) do |*args, options|
53
- args.should == %w(p1 p2)
54
- options.should == {}
34
+ describe 'cluster' do
35
+ it 'cluster defaults shadow globals' do
36
+ args = %w(-c=5 cluster cmd)
37
+ Applix.main(args, a: :global, b: 2, :cluster => {a: :cluster, c: 3}) do
38
+ handle(:cmd) { raise 'should not be called!' }
39
+ cluster(:cluster) do
40
+ handle(:cmd) do |*args, options|
41
+ options.should == {:a => :cluster, :b => 2, :c => '5'}
55
42
  args
56
43
  end
57
44
  end
58
45
  end
59
- end.should == %w{p1 p2}
60
- end
46
+ end
47
+
48
+ it 'calls cluster prolog' do
49
+ Applix.main(%w(foo a b)) do
50
+ cluster(:foo) do
51
+ prolog { |args, options|
52
+ args.should == %w(a b)
53
+ args.reverse!
54
+ }
55
+ handle(:a) { raise 'should not be called!' }
56
+ handle(:b) { :b_was_called }
57
+ end
58
+ end.should == :b_was_called
59
+ end
60
+
61
+ it 'support :cluster for nesting' do
62
+ args = %w(-a -b:2 foo bar p1 p2)
63
+ Applix.main(args) do
64
+ handle(:foo) do
65
+ raise 'should not be called!'
66
+ end
67
+ cluster(:foo) do
68
+ handle(:bar) do |*args, options|
69
+ args.should == %w(p1 p2)
70
+ options.should == {:a => true, :b => 2}
71
+ args
72
+ end
73
+ end
74
+ end.should == %w{p1 p2}
75
+ end
76
+
77
+ it 'can even cluster clusters' do
78
+ args = %w(foo bar f p1 p2)
79
+ Applix.main(args) do
80
+ cluster(:foo) do
81
+ cluster(:bar) do
82
+ handle(:f) do |*args, options|
83
+ args.should == %w(p1 p2)
84
+ options.should == {}
85
+ args
86
+ end
87
+ end
88
+ end
89
+ end.should == %w{p1 p2}
90
+ end
91
+ end #.cluster
61
92
 
62
93
  it 'prolog can even temper with arguments to modify the handle sequence' do
63
94
  Applix.main(['a', 'b']) do
@@ -77,7 +108,7 @@ describe Applix do
77
108
  options[:prolog] = Time.now
78
109
  }
79
110
 
80
- handle(:func) { |*_, options|
111
+ handle(:func) { |*_, options|
81
112
  options[:prolog]
82
113
  }
83
114
  end.should_not == nil
@@ -86,7 +117,7 @@ describe Applix do
86
117
  it 'epilog has access to task handler results' do
87
118
  Applix.main(['func']) do
88
119
  # @epilog will NOT make it into the handle invocation
89
- epilog { |rc, *_|
120
+ epilog { |rc, *_|
90
121
  rc.should == [1, 2, 3]
91
122
  rc.reverse
92
123
  }
@@ -99,18 +130,18 @@ describe Applix do
99
130
  Applix.main(['func']) do
100
131
 
101
132
  # @prolog will be available in handle invocations
102
- prolog {
103
- @prolog = :prolog
133
+ prolog {
134
+ @prolog = :prolog
104
135
  }
105
136
 
106
137
  # @epilog will NOT make it into the handle invocation
107
138
  epilog { |rc, *_|
108
- @epilog = :epilog
109
- rc
139
+ @epilog = :epilog
140
+ rc
110
141
  }
111
142
 
112
- handle(:func) {
113
- [@prolog, @epilog]
143
+ handle(:func) {
144
+ [@prolog, @epilog]
114
145
  }
115
146
  end.should == [:prolog, nil]
116
147
  end
@@ -118,12 +149,12 @@ describe Applix do
118
149
  it 'runs epilog callback after handle' do
119
150
  last_action = nil
120
151
  Applix.main([:func]) do
121
- epilog { |rc, *_|
152
+ epilog { |rc, *_|
122
153
  # handle was already executed
123
154
  last_action.should == :handle
124
155
  last_action = :epilog
125
156
  }
126
- handle(:func) {
157
+ handle(:func) {
127
158
  # epilog block should not have been executed yet
128
159
  last_action.should == nil
129
160
  last_action = :handle
@@ -135,7 +166,7 @@ describe Applix do
135
166
  it 'supports :any as fallback on command lines without matching task' do
136
167
  Applix.main(%w(--opt1 foo param1 param2), {:opt2 => false}) do
137
168
  handle(:not_called) { raise "can't possible happen" }
138
- any do |*args, options|
169
+ any do |*args, options|
139
170
  args.should == ["foo", "param1", "param2"]
140
171
  options.should == {:opt1 => true, :opt2 => false}
141
172
  end
@@ -144,7 +175,7 @@ describe Applix do
144
175
 
145
176
  it 'any does not shadow existing tasks' do
146
177
  Applix.main(['--opt1', 'foo', "param1", "param2"], {:opt2 => false}) do
147
- handle(:foo) do |*args, options|
178
+ handle(:foo) do |*args, options|
148
179
  args.should == ["param1", "param2"]
149
180
  options.should == {:opt1 => true, :opt2 => false}
150
181
  end
@@ -155,7 +186,7 @@ describe Applix do
155
186
  it 'supports :any when task does not depend on first arguments' do
156
187
  %w(bla fasel laber red).each do |name|
157
188
  Applix.main(['--opt1', name, "param1", "param2"], {:opt2 => false}) do
158
- any do |*args, options|
189
+ any do |*args, options|
159
190
  args.should == [name, "param1", "param2"]
160
191
  options.should == {:opt1 => true, :opt2 => false}
161
192
  end
@@ -170,37 +201,31 @@ describe Applix do
170
201
  end.should == :func_return
171
202
  end
172
203
 
173
- it 'should pass arguments to function' do
204
+ it 'passes arguments to function' do
174
205
  argv = ['func', 'p1', 'p2']
175
- Applix.main(argv) do
176
- handle(:func) { |*args, options| args }
177
- end.should == %w{p1 p2}
206
+ subject = Applix.main(argv) { handle(:func) {|*args, options| args} }
207
+ subject.should eq(%w(p1 p2))
178
208
  end
179
209
 
180
- it 'should pass emtpy options to function on default' do
210
+ it 'passes a default options hash to function' do
181
211
  argv = %w(func)
182
212
  Applix.main(argv) do
183
213
  handle(:func) { |*_, options| options }
184
- end.should == {}
214
+ end.should eq({})
185
215
  end
186
216
 
187
217
  it 'should pass a processed options hash' do
188
218
  argv = %w(-a --bar func)
189
219
  Applix.main(argv) do
190
220
  handle(:func) { |*_, options| options }
191
- end.should == {:a => true, :bar => true}
221
+ end.should include(:a => true, :bar => true)
192
222
  end
193
223
 
224
+ it 'parses dashes in string options' do
225
+ end
226
+
194
227
  it "should parse the old unit test..." do
195
- # -f becomes { :f => true }
196
- # --flag becomes { :flag => true }
197
- (ApplixHash.parse '-f').should == [:f, true]
198
- (ApplixHash.parse '--flag').should == [:flag, true]
199
- # --flag:false becomes { :flag => false }
200
- (ApplixHash.parse '--flag:false').should == [:flag, false]
201
-
202
- # --option=value becomes { :option => "value" }
203
- (ApplixHash.parse '--opt=val').should == [:opt, 'val']
228
+ # see applix_hash_spec.rb
204
229
 
205
230
  # --int=1 becomes { :int => "1" }
206
231
  # --int:1 becomes { :int => 1 }
data/spec/oattr_spec.rb CHANGED
@@ -17,18 +17,18 @@ describe OAttr do
17
17
  Foo.oattr.should_not == nil
18
18
  end
19
19
  it "should define a bar method" do
20
- class Foo;
20
+ class Foo;
21
21
  oattr :bar
22
- def initialize; @options = { :bar => 123}; end;
22
+ def initialize; @options = { :bar => 123}; end;
23
23
  end
24
24
  (Foo.new.respond_to? :bar).should == true
25
25
  Foo.new.bar.should == 123
26
26
  end
27
27
 
28
28
  it "should handle container options" do
29
- class Foo;
29
+ class Foo;
30
30
  oattr :xxx, :foo, :container => :params
31
- def initialize; @params = { :xxx => 321}; end;
31
+ def initialize; @params = { :xxx => 321}; end;
32
32
  end
33
33
  (Foo.new.respond_to? :xxx).should == true
34
34
  Foo.new.xxx.should == 321
data/spec/spec_helper.rb CHANGED
@@ -12,3 +12,18 @@ RSpec.configure do |config|
12
12
  config.after :each do
13
13
  end
14
14
  end
15
+
16
+ # captures standard output streams to help testing console I/O
17
+ #
18
+ def capture(*streams)
19
+ streams.map! { |stream| stream.to_s }
20
+ begin
21
+ result = StringIO.new
22
+ streams.each { |stream| eval "$#{stream} = result" }
23
+ yield
24
+ ensure
25
+ streams.each { |stream| eval("$#{stream} = #{stream.upcase}") }
26
+ end
27
+ result.string
28
+ end
29
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: applix
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.9
4
+ version: 0.4.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-26 00:00:00.000000000 Z
12
+ date: 2012-05-29 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: daemons
16
- requirement: !ruby/object:Gem::Requirement
16
+ requirement: &70225028432700 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,15 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ! '>='
28
- - !ruby/object:Gem::Version
29
- version: '0'
24
+ version_requirements: *70225028432700
30
25
  - !ruby/object:Gem::Dependency
31
26
  name: rspec
32
- requirement: !ruby/object:Gem::Requirement
27
+ requirement: &70225028432280 !ruby/object:Gem::Requirement
33
28
  none: false
34
29
  requirements:
35
30
  - - ! '>='
@@ -37,15 +32,10 @@ dependencies:
37
32
  version: '0'
38
33
  type: :development
39
34
  prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ! '>='
44
- - !ruby/object:Gem::Version
45
- version: '0'
35
+ version_requirements: *70225028432280
46
36
  - !ruby/object:Gem::Dependency
47
37
  name: rspec-mocks
48
- requirement: !ruby/object:Gem::Requirement
38
+ requirement: &70225028431860 !ruby/object:Gem::Requirement
49
39
  none: false
50
40
  requirements:
51
41
  - - ! '>='
@@ -53,15 +43,10 @@ dependencies:
53
43
  version: '0'
54
44
  type: :development
55
45
  prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
- requirements:
59
- - - ! '>='
60
- - !ruby/object:Gem::Version
61
- version: '0'
46
+ version_requirements: *70225028431860
62
47
  - !ruby/object:Gem::Dependency
63
48
  name: guard
64
- requirement: !ruby/object:Gem::Requirement
49
+ requirement: &70225028431440 !ruby/object:Gem::Requirement
65
50
  none: false
66
51
  requirements:
67
52
  - - ! '>='
@@ -69,15 +54,10 @@ dependencies:
69
54
  version: '0'
70
55
  type: :development
71
56
  prerelease: false
72
- version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
75
- - - ! '>='
76
- - !ruby/object:Gem::Version
77
- version: '0'
57
+ version_requirements: *70225028431440
78
58
  - !ruby/object:Gem::Dependency
79
59
  name: guard-rspec
80
- requirement: !ruby/object:Gem::Requirement
60
+ requirement: &70225028463500 !ruby/object:Gem::Requirement
81
61
  none: false
82
62
  requirements:
83
63
  - - ! '>='
@@ -85,15 +65,10 @@ dependencies:
85
65
  version: '0'
86
66
  type: :development
87
67
  prerelease: false
88
- version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
- requirements:
91
- - - ! '>='
92
- - !ruby/object:Gem::Version
93
- version: '0'
68
+ version_requirements: *70225028463500
94
69
  - !ruby/object:Gem::Dependency
95
70
  name: growl
96
- requirement: !ruby/object:Gem::Requirement
71
+ requirement: &70225028463080 !ruby/object:Gem::Requirement
97
72
  none: false
98
73
  requirements:
99
74
  - - ! '>='
@@ -101,15 +76,10 @@ dependencies:
101
76
  version: '0'
102
77
  type: :development
103
78
  prerelease: false
104
- version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
- requirements:
107
- - - ! '>='
108
- - !ruby/object:Gem::Version
109
- version: '0'
79
+ version_requirements: *70225028463080
110
80
  - !ruby/object:Gem::Dependency
111
81
  name: debugger
112
- requirement: !ruby/object:Gem::Requirement
82
+ requirement: &70225028462640 !ruby/object:Gem::Requirement
113
83
  none: false
114
84
  requirements:
115
85
  - - ! '>='
@@ -117,15 +87,10 @@ dependencies:
117
87
  version: '0'
118
88
  type: :development
119
89
  prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
- requirements:
123
- - - ! '>='
124
- - !ruby/object:Gem::Version
125
- version: '0'
90
+ version_requirements: *70225028462640
126
91
  description: ! "\n ApplixHash#from_argv builds hashes from ARGV like argument vectors\n
127
- \ according to following examples: \n \n '-f' -->
128
- { :f => true }\n '--flag' --> { :flag => true }\n '--flag:false'
92
+ \ according to following examples:\n\n '-f' --> { :f
93
+ \ => true }\n '--flag' --> { :flag => true }\n '--flag:false'
129
94
  \ --> { :flag => false }\n '--flag=false' --> { :flag =>
130
95
  'false' }\n '--option=value' --> { :option => \"value\" }\n '--int=1'
131
96
  \ --> { :int => \"1\" }\n '--float=2.3' --> { :float
@@ -133,52 +98,34 @@ description: ! "\n ApplixHash#from_argv builds hashes from ARGV like argument
133
98
  bar\"' --> { :txt => \"foo bar\" }\n '--txt:'\"foo bar\"'' -->
134
99
  { :txt => \"foo bar\" }\n '--txt:%w{foo bar}' --> { :txt => [\"foo\",
135
100
  \"bar\"] }\n '--now:Time.now' --> { :now => #<Date: 3588595/2,0,2299161>
136
- }\n \n remaining arguments(non flag/options) are inserted as [:arguments,\n
137
- \ args], eg:\n Hash.from_argv %w(--foo --bar=loo 123 now)\n becomes
138
- \ \n { :foo => true, :bar => 'loo', :arguments => [\"123\", \"now\"] }\n
139
- \ "
101
+ }\n\n remaining arguments(non flag/options) are inserted as [:arguments,\n args],
102
+ eg:\n Hash.from_argv %w(--foo --bar=loo 123 now)\n becomes\n {
103
+ :foo => true, :bar => 'loo', :arguments => [\"123\", \"now\"] }\n "
140
104
  email:
141
105
  - dirk.luesebrink@artcom.de
142
106
  executables: []
143
107
  extensions: []
144
108
  extra_rdoc_files: []
145
109
  files:
146
- - !binary |-
147
- LmF1dG90ZXN0
148
- - !binary |-
149
- LmRvY3VtZW50
150
- - !binary |-
151
- LmdpdGlnbm9yZQ==
152
- - !binary |-
153
- LnJzcGVj
154
- - !binary |-
155
- LnRyYXZpcy55bWw=
156
- - !binary |-
157
- R2VtZmlsZQ==
158
- - !binary |-
159
- R3VhcmRmaWxl
160
- - !binary |-
161
- TElDRU5TRQ==
162
- - !binary |-
163
- UkVBRE1FLm1rZA==
164
- - !binary |-
165
- UmFrZWZpbGU=
166
- - !binary |-
167
- YXBwbGl4LmdlbXNwZWM=
168
- - !binary |-
169
- bGliL2FwcGxpeC5yYg==
170
- - !binary |-
171
- bGliL2FwcGxpeC9oYXNoLnJi
172
- - !binary |-
173
- bGliL2FwcGxpeC9vYXR0ci5yYg==
174
- - !binary |-
175
- bGliL2FwcGxpeC92ZXJzaW9uLnJi
176
- - !binary |-
177
- c3BlYy9hcHBsaXhfc3BlYy5yYg==
178
- - !binary |-
179
- c3BlYy9vYXR0cl9zcGVjLnJi
180
- - !binary |-
181
- c3BlYy9zcGVjX2hlbHBlci5yYg==
110
+ - .autotest
111
+ - .document
112
+ - .gitignore
113
+ - .rspec
114
+ - .travis.yml
115
+ - Gemfile
116
+ - Guardfile
117
+ - LICENSE
118
+ - README.mkd
119
+ - Rakefile
120
+ - applix.gemspec
121
+ - lib/applix.rb
122
+ - lib/applix/hash.rb
123
+ - lib/applix/oattr.rb
124
+ - lib/applix/version.rb
125
+ - spec/applix_hash_spec.rb
126
+ - spec/applix_spec.rb
127
+ - spec/oattr_spec.rb
128
+ - spec/spec_helper.rb
182
129
  homepage: http://github.com/crux/applix
183
130
  licenses: []
184
131
  post_install_message:
@@ -199,14 +146,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
199
146
  version: '0'
200
147
  requirements: []
201
148
  rubyforge_project:
202
- rubygems_version: 1.8.23
149
+ rubygems_version: 1.8.15
203
150
  signing_key:
204
151
  specification_version: 3
205
152
  summary: extracting typed option hashes from command line arguments
206
153
  test_files:
207
- - !binary |-
208
- c3BlYy9hcHBsaXhfc3BlYy5yYg==
209
- - !binary |-
210
- c3BlYy9vYXR0cl9zcGVjLnJi
211
- - !binary |-
212
- c3BlYy9zcGVjX2hlbHBlci5yYg==
154
+ - spec/applix_hash_spec.rb
155
+ - spec/applix_spec.rb
156
+ - spec/oattr_spec.rb
157
+ - spec/spec_helper.rb
158
+ has_rdoc: