argh 0.0.3 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,15 +10,10 @@ module Argh
10
10
  end
11
11
 
12
12
  def attribute(name, value = nil, &block)
13
- attribute = nil
14
- if value.is_a?(Symbol)
15
- attribute = value
16
- value = nil
17
- end
18
13
  @attributes << {
19
14
  :name => name,
20
15
  :value => value,
21
- :lambda => block || lambda { |i| i.send(attribute || name) }
16
+ :lambda => block || lambda { |i| i.send(name) }
22
17
  }
23
18
  end
24
19
 
@@ -1,5 +1,5 @@
1
1
  module Argh
2
2
 
3
- VERSION = '0.0.3'
3
+ VERSION = '0.1.0'
4
4
 
5
5
  end
@@ -20,7 +20,7 @@ class BasicExample
20
20
  end
21
21
 
22
22
  argh 'straight' do
23
- attribute :name, 'john'
23
+ attribute :name, :john
24
24
  end
25
25
 
26
26
  argh 'lambs' do
@@ -28,7 +28,7 @@ class BasicExample
28
28
  end
29
29
 
30
30
  argh 'symb' do
31
- attribute(:the_name, :name)
31
+ attribute(:the_name, &:name)
32
32
  end
33
33
 
34
34
  private
@@ -77,8 +77,4 @@ describe Argh::Attributable do
77
77
  example.straight.should == '-name \'john\''
78
78
  end
79
79
 
80
- it 'should be able to specify a symbol instead of a lambda' do
81
- example.symb.should == '-the_name \'John Crepezzi\''
82
- end
83
-
84
80
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: argh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: