maintain 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.4
1
+ 0.1.5
@@ -21,7 +21,6 @@ module Maintain
21
21
  end
22
22
 
23
23
  def ===(value)
24
- raise "#{compare_value} #{compare_value_for(value)}"
25
24
  (compare_value == compare_value_for(value)) || super
26
25
  end
27
26
 
@@ -92,10 +91,10 @@ module Maintain
92
91
  end
93
92
 
94
93
  def state_name_for(value)
95
- if (value.is_a?(String) || value.is_a?(Symbol))
94
+ if value.to_s =~ /^\d+$/
95
+ @state.state_name_for(value.to_i)
96
+ elsif (value.is_a?(String) || value.is_a?(Symbol))
96
97
  @state.states.has_key?(value.to_sym) ? value.to_sym : nil
97
- else
98
- @state.state_name_for(value)
99
98
  end
100
99
  end
101
100
 
data/maintain.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{maintain}
8
- s.version = "0.1.4"
8
+ s.version = "0.1.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Flip Sasser"]
data/spec/integer_spec.rb CHANGED
@@ -18,5 +18,15 @@ describe Maintain do
18
18
  end
19
19
  @maintainer = MaintainTest.new
20
20
  end
21
+
22
+ it "should return valid names, too" do
23
+ @maintainer.kind = :woman
24
+ @maintainer.kind.name.should == "woman"
25
+ end
26
+
27
+ it "should handle numbery strings" do
28
+ @maintainer.kind = "3"
29
+ @maintainer.none?.should be_true
30
+ end
21
31
  end
22
32
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 4
9
- version: 0.1.4
8
+ - 5
9
+ version: 0.1.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - Flip Sasser