renum 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,11 @@
1
+ == 1.0.0 2008-01-25
2
+
3
+ * New fancy syntax supporting extra member variables in enums
4
+
5
+ == 0.1.0 ???
6
+
7
+ * Add in a missing require
8
+
1
9
  == 0.0.3 2007-11-02
2
10
 
3
11
  * Support nesting enums inside other modules.
@@ -17,9 +17,11 @@ module Renum
17
17
 
18
18
  include Comparable
19
19
  attr_reader :name
20
+ attr_reader :index
20
21
 
21
22
  def initialize name
22
23
  @name = name.to_s
24
+ @index = self.class.values.size
23
25
  self.class.values << self
24
26
  end
25
27
 
@@ -27,10 +29,6 @@ module Renum
27
29
  "#{self.class}::#{name}"
28
30
  end
29
31
 
30
- def index
31
- self.class.values.index self
32
- end
33
-
34
32
  def <=> other
35
33
  index <=> other.index
36
34
  end
data/lib/renum/version.rb CHANGED
@@ -2,7 +2,7 @@ module Renum #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 1
4
4
  MINOR = 0
5
- TINY = 0
5
+ TINY = 1
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
data/spec/renum_spec.rb CHANGED
@@ -95,4 +95,14 @@ describe "enum with no values array and values declared in the block" do
95
95
  it "supprts there being no extra data and no init() method defined, if you don't need them" do
96
96
  HairColor::BLONDE.name.should == "BLONDE"
97
97
  end
98
+ end
99
+
100
+ # It was reported on my blog that <=> was causing segfaults.
101
+ # I'd love to figure out why, but first I'd love to fix that.
102
+ describe "digging into this segfault/illegal instruction issue, renum" do
103
+ it "doesn't cause the ruby process to bomb!" do
104
+ Color::RED.should < Color::GREEN
105
+ Color::RED.should_not > Color::GREEN
106
+ Color::RED.should < Color::BLUE
107
+ end
98
108
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: renum
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Hume
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-01-25 00:00:00 -05:00
12
+ date: 2008-05-15 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies: []
15
15