haz_enum 0.5.3 → 0.5.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +22 -0
- data/.travis.yml +4 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +47 -0
- data/Rakefile +3 -41
- data/haz_enum.gemspec +12 -43
- data/lib/haz_enum/enum.rb +16 -10
- data/lib/version.rb +3 -0
- data/spec/enum_spec.rb +31 -17
- data/spec/spec_helper.rb +18 -7
- metadata +96 -77
- data/VERSION +0 -1
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
haz_enum (0.5.4)
|
5
|
+
activerecord (>= 2.3.0)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: http://rubygems.org/
|
9
|
+
specs:
|
10
|
+
activemodel (3.2.8)
|
11
|
+
activesupport (= 3.2.8)
|
12
|
+
builder (~> 3.0.0)
|
13
|
+
activerecord (3.2.8)
|
14
|
+
activemodel (= 3.2.8)
|
15
|
+
activesupport (= 3.2.8)
|
16
|
+
arel (~> 3.0.2)
|
17
|
+
tzinfo (~> 0.3.29)
|
18
|
+
activesupport (3.2.8)
|
19
|
+
i18n (~> 0.6)
|
20
|
+
multi_json (~> 1.0)
|
21
|
+
arel (3.0.2)
|
22
|
+
builder (3.0.4)
|
23
|
+
diff-lcs (1.1.3)
|
24
|
+
i18n (0.6.1)
|
25
|
+
multi_json (1.3.6)
|
26
|
+
rake (10.0.3)
|
27
|
+
renum (1.3.1)
|
28
|
+
rspec (2.12.0)
|
29
|
+
rspec-core (~> 2.12.0)
|
30
|
+
rspec-expectations (~> 2.12.0)
|
31
|
+
rspec-mocks (~> 2.12.0)
|
32
|
+
rspec-core (2.12.2)
|
33
|
+
rspec-expectations (2.12.1)
|
34
|
+
diff-lcs (~> 1.1.3)
|
35
|
+
rspec-mocks (2.12.1)
|
36
|
+
sqlite3 (1.3.6)
|
37
|
+
tzinfo (0.3.34)
|
38
|
+
|
39
|
+
PLATFORMS
|
40
|
+
ruby
|
41
|
+
|
42
|
+
DEPENDENCIES
|
43
|
+
haz_enum!
|
44
|
+
rake (~> 10.0.3)
|
45
|
+
renum (~> 1.3.1)
|
46
|
+
rspec (~> 2.12.0)
|
47
|
+
sqlite3 (~> 1.3)
|
data/Rakefile
CHANGED
@@ -1,47 +1,9 @@
|
|
1
1
|
require 'rubygems'
|
2
|
+
require "bundler"
|
2
3
|
require 'rake'
|
3
4
|
|
4
|
-
|
5
|
-
require 'jeweler'
|
6
|
-
Jeweler::Tasks.new do |gem|
|
7
|
-
gem.name = "haz_enum"
|
8
|
-
gem.summary = %Q{has_set and has_enum for ActiveRecord}
|
9
|
-
gem.description = %Q{use has_set and has_enum in your ActiveRecord models if you want to have one (has_enum) value from a defined enumeration or more (has_set))}
|
10
|
-
gem.email = "andi@galaxycats.com"
|
11
|
-
gem.homepage = "http://github.com/galaxycats/haz_enum"
|
12
|
-
gem.authors = ["thyphoon"]
|
13
|
-
gem.add_dependency "activerecord", ">= 2.3.0"
|
14
|
-
gem.add_development_dependency "rspec", "~> 1.3.0"
|
15
|
-
gem.add_development_dependency "renum", "~> 1.3.1"
|
16
|
-
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
17
|
-
end
|
18
|
-
Jeweler::GemcutterTasks.new
|
19
|
-
rescue LoadError
|
20
|
-
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
21
|
-
end
|
5
|
+
require 'rspec/core/rake_task'
|
22
6
|
|
23
|
-
|
24
|
-
Spec::Rake::SpecTask.new(:spec) do |spec|
|
25
|
-
spec.libs << 'lib' << 'spec'
|
26
|
-
spec.spec_files = FileList['spec/**/*_spec.rb']
|
27
|
-
end
|
28
|
-
|
29
|
-
Spec::Rake::SpecTask.new(:rcov) do |spec|
|
30
|
-
spec.libs << 'lib' << 'spec'
|
31
|
-
spec.pattern = 'spec/**/*_spec.rb'
|
32
|
-
spec.rcov = true
|
33
|
-
end
|
34
|
-
|
35
|
-
task :spec => :check_dependencies
|
7
|
+
RSpec::Core::RakeTask.new(:spec)
|
36
8
|
|
37
9
|
task :default => :spec
|
38
|
-
|
39
|
-
require 'rake/rdoctask'
|
40
|
-
Rake::RDocTask.new do |rdoc|
|
41
|
-
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
42
|
-
|
43
|
-
rdoc.rdoc_dir = 'rdoc'
|
44
|
-
rdoc.title = "haz_enum #{version}"
|
45
|
-
rdoc.rdoc_files.include('README*')
|
46
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
47
|
-
end
|
data/haz_enum.gemspec
CHANGED
@@ -1,12 +1,11 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
1
|
# -*- encoding: utf-8 -*-
|
2
|
+
require File.join(File.dirname(__FILE__), *%w[lib version])
|
5
3
|
|
6
4
|
Gem::Specification.new do |s|
|
7
5
|
s.name = %q{haz_enum}
|
8
|
-
s.version =
|
9
|
-
|
6
|
+
s.version = HazEnum::VERSION
|
7
|
+
s.platform = Gem::Platform::RUBY
|
8
|
+
s.rubyforge_project = "haz_enum"
|
10
9
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
10
|
s.authors = ["thyphoon"]
|
12
11
|
s.date = %q{2011-05-25}
|
@@ -16,48 +15,18 @@ Gem::Specification.new do |s|
|
|
16
15
|
"LICENSE",
|
17
16
|
"README.rdoc"
|
18
17
|
]
|
19
|
-
s.files =
|
20
|
-
|
21
|
-
"CHANGESET",
|
22
|
-
"LICENSE",
|
23
|
-
"README.rdoc",
|
24
|
-
"Rakefile",
|
25
|
-
"VERSION",
|
26
|
-
"haz_enum.gemspec",
|
27
|
-
"lib/haz_enum.rb",
|
28
|
-
"lib/haz_enum/enum.rb",
|
29
|
-
"lib/haz_enum/set.rb",
|
30
|
-
"spec/enum_spec.rb",
|
31
|
-
"spec/set_spec.rb",
|
32
|
-
"spec/spec.opts",
|
33
|
-
"spec/spec_helper.rb"
|
34
|
-
]
|
18
|
+
s.files = `git ls-files`.split("\n")
|
19
|
+
|
35
20
|
s.homepage = %q{http://github.com/galaxycats/haz_enum}
|
36
21
|
s.require_paths = ["lib"]
|
37
22
|
s.rubygems_version = %q{1.5.0}
|
38
23
|
s.summary = %q{has_set and has_enum for ActiveRecord}
|
39
|
-
s.test_files =
|
40
|
-
"spec/enum_spec.rb",
|
41
|
-
"spec/set_spec.rb",
|
42
|
-
"spec/spec_helper.rb"
|
43
|
-
]
|
44
|
-
|
45
|
-
if s.respond_to? :specification_version then
|
46
|
-
s.specification_version = 3
|
24
|
+
s.test_files = `git ls-files -- spec/*`.split("\n")
|
47
25
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
s.add_dependency(%q<activerecord>, [">= 2.3.0"])
|
54
|
-
s.add_dependency(%q<rspec>, ["~> 1.3.0"])
|
55
|
-
s.add_dependency(%q<renum>, ["~> 1.3.1"])
|
56
|
-
end
|
57
|
-
else
|
58
|
-
s.add_dependency(%q<activerecord>, [">= 2.3.0"])
|
59
|
-
s.add_dependency(%q<rspec>, ["~> 1.3.0"])
|
60
|
-
s.add_dependency(%q<renum>, ["~> 1.3.1"])
|
61
|
-
end
|
26
|
+
s.add_runtime_dependency(%q<activerecord>, [">= 2.3.0"])
|
27
|
+
s.add_development_dependency(%q<rspec>, ["~> 2.12.0"])
|
28
|
+
s.add_development_dependency(%q<renum>, ["~> 1.3.1"])
|
29
|
+
s.add_development_dependency(%q<rake>, ["~> 10.0.3"])
|
30
|
+
s.add_development_dependency(%q<sqlite3>, ["~> 1.3"])
|
62
31
|
end
|
63
32
|
|
data/lib/haz_enum/enum.rb
CHANGED
@@ -3,11 +3,17 @@ module HazEnum
|
|
3
3
|
def has_enum(enum_name, options={})
|
4
4
|
enum_name = enum_name.to_s
|
5
5
|
enum_column = options.has_key?(:column_name) ? options[:column_name].to_s : enum_name
|
6
|
-
enum_class = options.has_key?(:class_name)
|
7
|
-
|
6
|
+
enum_class = if options.has_key?(:class_name)
|
7
|
+
options[:class_name].constantize
|
8
|
+
elsif options[:enum]
|
9
|
+
options[:enum]
|
10
|
+
else
|
11
|
+
enum_name.pluralize.camelize.constantize
|
12
|
+
end
|
13
|
+
|
8
14
|
self.attr_protected("#{enum_column}") if enum_name != enum_column
|
9
15
|
self.validate "#{enum_column}_check_for_valid_enum_value"
|
10
|
-
|
16
|
+
|
11
17
|
define_method "#{enum_name}" do
|
12
18
|
begin
|
13
19
|
return enum_class.const_get(self["#{enum_column}"]) if self["#{enum_column}"]
|
@@ -16,7 +22,7 @@ module HazEnum
|
|
16
22
|
return nil
|
17
23
|
end
|
18
24
|
end
|
19
|
-
|
25
|
+
|
20
26
|
define_method "#{enum_name}=" do |enum_to_set|
|
21
27
|
if enum_to_set.blank?
|
22
28
|
self["#{enum_column}"] = nil
|
@@ -26,28 +32,28 @@ module HazEnum
|
|
26
32
|
self["#{enum_column}"] = enum_class.const_get(enum_to_set).name
|
27
33
|
end
|
28
34
|
end
|
29
|
-
|
35
|
+
|
30
36
|
define_method "has_#{enum_name}?" do |enum|
|
31
37
|
send(enum_name) == enum
|
32
38
|
end
|
33
|
-
|
39
|
+
|
34
40
|
define_method "#{enum_name}_changed?" do
|
35
41
|
send("#{enum_column}_changed?")
|
36
42
|
end if enum_name != enum_column
|
37
|
-
|
43
|
+
|
38
44
|
define_method "#{enum_column}_check_for_valid_enum_value" do
|
39
45
|
return true if self["#{enum_column}"].nil?
|
40
46
|
begin
|
41
47
|
enum_class.const_get(self["#{enum_column}"])
|
42
48
|
rescue NameError => e
|
43
|
-
|
49
|
+
|
44
50
|
message = I18n.translate("activerecord.errors.models.#{self.class.name.underscore}.attributes.#{enum_name}.enum_value_invalid", :value => self["#{enum_column}"], :name => enum_name) ||
|
45
51
|
I18n.translate("activerecord.errors.models.#{self.class.name.underscore}.enum_value_invalid", :value => self["#{enum_column}"], :name => enum_name) ||
|
46
52
|
I18n.translate(:'activerecord.errors.messages.enum_value_invalid', :value => self["#{enum_column}"], :name => enum_name)
|
47
|
-
|
53
|
+
|
48
54
|
self.errors.add(enum_name.to_sym, message)
|
49
55
|
end
|
50
56
|
end
|
51
57
|
end
|
52
58
|
end
|
53
|
-
end
|
59
|
+
end
|
data/lib/version.rb
ADDED
data/spec/enum_spec.rb
CHANGED
@@ -1,45 +1,45 @@
|
|
1
1
|
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
2
|
|
3
3
|
describe "HazEnum" do
|
4
|
-
|
4
|
+
|
5
5
|
describe "Enum" do
|
6
|
-
|
6
|
+
|
7
7
|
before(:all) do
|
8
8
|
setup_db
|
9
9
|
end
|
10
|
-
|
10
|
+
|
11
11
|
it "should have class method has_enum" do
|
12
12
|
ClassWithEnum.should respond_to(:has_enum)
|
13
13
|
end
|
14
|
-
|
14
|
+
|
15
15
|
it "should be able to set enum-attribute via hash in initializer" do
|
16
16
|
ClassWithEnum.new(:product => Products::Silver).product.should be(Products::Silver)
|
17
17
|
ClassWithCustomNameEnum.new(:product => Products::Silver).product.should be(Products::Silver)
|
18
18
|
end
|
19
|
-
|
19
|
+
|
20
20
|
it "should be able to set enum-value as string in initializer" do
|
21
21
|
ClassWithEnum.new(:product => "Silver").product.should be(Products::Silver)
|
22
22
|
end
|
23
|
-
|
23
|
+
|
24
24
|
it "should have has_<association>? method" do
|
25
25
|
class_with_enum = ClassWithEnum.new(:product => "Silver")
|
26
26
|
class_with_enum.has_product?(Products::Silver).should == true
|
27
27
|
class_with_enum.has_product?(Products::Gold).should == false
|
28
28
|
end
|
29
|
-
|
29
|
+
|
30
30
|
it "should not be able to set enum-attribute by colum-name via hash in initializer" do
|
31
31
|
ClassWithCustomNameEnum.new(:custom_name => Products::Silver).product.should_not be(Products::Silver)
|
32
32
|
ClassWithCustomNameEnum.new(:custom_name => Products::Silver.name).product.should_not be(Products::Silver)
|
33
33
|
end
|
34
|
-
|
34
|
+
|
35
35
|
it "should have a enum_value attribute" do
|
36
36
|
ClassWithCustomNameEnum.new(:product => Products::Gold).custom_name.should be(Products::Gold.name)
|
37
37
|
end
|
38
|
-
|
38
|
+
|
39
39
|
it "colum_name should be configurable" do
|
40
40
|
ClassWithCustomNameEnum.new(:product => Products::Gold).product.should be(Products::Gold)
|
41
41
|
end
|
42
|
-
|
42
|
+
|
43
43
|
it "should know if enum-attribute has changed" do
|
44
44
|
product_enum = ClassWithEnum.new(:product => Products::Silver)
|
45
45
|
product_enum.product_changed?.should be(true)
|
@@ -48,14 +48,14 @@ describe "HazEnum" do
|
|
48
48
|
product_enum.product = Products::Gold
|
49
49
|
product_enum.product_changed?.should be(true)
|
50
50
|
end
|
51
|
-
|
51
|
+
|
52
52
|
it "should know if enum-attribute has not really changed" do
|
53
53
|
product_enum = ClassWithEnum.new(:product => Products::Silver)
|
54
54
|
product_enum.save
|
55
55
|
product_enum.product = Products::Silver
|
56
56
|
product_enum.product_changed?.should be(false)
|
57
57
|
end
|
58
|
-
|
58
|
+
|
59
59
|
it "should validate enum-value" do
|
60
60
|
enum_mixin = ClassWithEnum.new
|
61
61
|
platin = "Platin"
|
@@ -64,20 +64,34 @@ describe "HazEnum" do
|
|
64
64
|
enum_mixin.valid?.should_not be(true)
|
65
65
|
enum_mixin.errors[:product].size.should > 0
|
66
66
|
end
|
67
|
-
|
67
|
+
|
68
68
|
it "should work without renum (just ruby module with classes)" do
|
69
69
|
role_enum = ClassWithEnum.new(:module_role => ModuleRoles::Admin)
|
70
70
|
role_enum.has_module_role?(ModuleRoles::Admin).should == true
|
71
71
|
end
|
72
|
-
|
72
|
+
|
73
73
|
it "should handle blank parameter of setter" do
|
74
74
|
ClassWithEnum.new(:product => nil).product.should be_nil
|
75
75
|
ClassWithEnum.new(:product => "").product.should be_nil
|
76
76
|
end
|
77
|
-
|
77
|
+
|
78
|
+
it "should be able to set the class_name manually" do
|
79
|
+
main_product_enum = ClassWithCustomNameField.new(:main_product => Products::Silver)
|
80
|
+
main_product_enum.main_product.should == Products::Silver
|
81
|
+
main_product_enum.save
|
82
|
+
ClassWithCustomNameField.find(main_product_enum.id).main_product.should == Products::Silver
|
83
|
+
end
|
84
|
+
|
85
|
+
it "should be able to set the enum class manually" do
|
86
|
+
sub_product_enum = ClassWithCustomNameField.new(:sub_product => Products::Gold)
|
87
|
+
sub_product_enum.sub_product.should == Products::Gold
|
88
|
+
sub_product_enum.save
|
89
|
+
ClassWithCustomNameField.find(sub_product_enum.id).sub_product.should == Products::Gold
|
90
|
+
end
|
91
|
+
|
78
92
|
after(:all) do
|
79
93
|
teardown_db
|
80
94
|
end
|
81
|
-
|
95
|
+
|
82
96
|
end
|
83
|
-
end
|
97
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -4,8 +4,6 @@ require "rubygems"
|
|
4
4
|
require "active_record"
|
5
5
|
require 'renum'
|
6
6
|
require 'haz_enum'
|
7
|
-
require 'spec'
|
8
|
-
require 'spec/autorun'
|
9
7
|
|
10
8
|
ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => ":memory:")
|
11
9
|
ActiveRecord::Migration.verbose = false
|
@@ -16,6 +14,7 @@ def setup_db
|
|
16
14
|
create_table :class_with_enums do |t|
|
17
15
|
t.column :title, :string
|
18
16
|
t.column :product, :string
|
17
|
+
t.column :module_role, :string
|
19
18
|
t.column :created_at, :datetime
|
20
19
|
t.column :updated_at, :datetime
|
21
20
|
end
|
@@ -27,10 +26,21 @@ def setup_db
|
|
27
26
|
t.column :updated_at, :datetime
|
28
27
|
end
|
29
28
|
|
29
|
+
create_table :class_with_custom_name_fields do |t|
|
30
|
+
t.column :title, :string
|
31
|
+
t.column :main_product, :string
|
32
|
+
t.column :sub_product, :string
|
33
|
+
t.column :created_at, :datetime
|
34
|
+
t.column :updated_at, :datetime
|
35
|
+
end
|
36
|
+
|
30
37
|
create_table :class_with_sets do |t|
|
31
38
|
t.column :title, :string
|
32
39
|
t.column :roles_bitfield, :integer
|
33
40
|
t.column :roles_yml, :text
|
41
|
+
t.column :module_roles_yml, :text
|
42
|
+
t.column :extended_roles_yml, :text
|
43
|
+
t.column :module_bitfield_roles_bitfield, :integer
|
34
44
|
t.column :created_at, :datetime
|
35
45
|
t.column :updated_at, :datetime
|
36
46
|
end
|
@@ -90,6 +100,11 @@ class ClassWithCustomNameEnum < ActiveRecord::Base
|
|
90
100
|
has_enum :product, :column_name => :custom_name
|
91
101
|
end
|
92
102
|
|
103
|
+
class ClassWithCustomNameField < ActiveRecord::Base
|
104
|
+
has_enum :main_product, :class_name => "Products"
|
105
|
+
has_enum :sub_product, :enum => Products
|
106
|
+
end
|
107
|
+
|
93
108
|
class ClassWithSet < ActiveRecord::Base
|
94
109
|
has_set :roles
|
95
110
|
has_set :extended_roles, :class_name => :roles do
|
@@ -102,7 +117,7 @@ class ClassWithSet < ActiveRecord::Base
|
|
102
117
|
end
|
103
118
|
|
104
119
|
class YmlSet < ActiveRecord::Base
|
105
|
-
|
120
|
+
self.table_name = "class_with_sets"
|
106
121
|
has_set :roles, :field_type => :yml
|
107
122
|
end
|
108
123
|
|
@@ -111,7 +126,3 @@ class ClassWithCustomNameSet < ActiveRecord::Base
|
|
111
126
|
end
|
112
127
|
|
113
128
|
teardown_db # And drop them right afterwards
|
114
|
-
|
115
|
-
Spec::Runner.configure do |config|
|
116
|
-
|
117
|
-
end
|
metadata
CHANGED
@@ -1,130 +1,149 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: haz_enum
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.5.5
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 5
|
9
|
-
- 3
|
10
|
-
version: 0.5.3
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- thyphoon
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2011-05-25 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
22
15
|
name: activerecord
|
23
|
-
|
24
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
25
17
|
none: false
|
26
|
-
requirements:
|
27
|
-
- -
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
hash: 3
|
30
|
-
segments:
|
31
|
-
- 2
|
32
|
-
- 3
|
33
|
-
- 0
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
34
21
|
version: 2.3.0
|
35
22
|
type: :runtime
|
36
|
-
version_requirements: *id001
|
37
|
-
- !ruby/object:Gem::Dependency
|
38
|
-
name: rspec
|
39
23
|
prerelease: false
|
40
|
-
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 2.3.0
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rspec
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
41
33
|
none: false
|
42
|
-
requirements:
|
34
|
+
requirements:
|
43
35
|
- - ~>
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
|
46
|
-
segments:
|
47
|
-
- 1
|
48
|
-
- 3
|
49
|
-
- 0
|
50
|
-
version: 1.3.0
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 2.12.0
|
51
38
|
type: :development
|
52
|
-
|
53
|
-
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 2.12.0
|
46
|
+
- !ruby/object:Gem::Dependency
|
54
47
|
name: renum
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ~>
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 1.3.1
|
54
|
+
type: :development
|
55
55
|
prerelease: false
|
56
|
-
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
none: false
|
58
|
-
requirements:
|
58
|
+
requirements:
|
59
59
|
- - ~>
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
hash: 25
|
62
|
-
segments:
|
63
|
-
- 1
|
64
|
-
- 3
|
65
|
-
- 1
|
60
|
+
- !ruby/object:Gem::Version
|
66
61
|
version: 1.3.1
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: rake
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ~>
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 10.0.3
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ~>
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 10.0.3
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: sqlite3
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ~>
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '1.3'
|
67
86
|
type: :development
|
68
|
-
|
69
|
-
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ~>
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '1.3'
|
94
|
+
description: use has_set and has_enum in your ActiveRecord models if you want to have
|
95
|
+
one (has_enum) value from a defined enumeration or more (has_set))
|
70
96
|
email: andi@galaxycats.com
|
71
97
|
executables: []
|
72
|
-
|
73
98
|
extensions: []
|
74
|
-
|
75
|
-
extra_rdoc_files:
|
99
|
+
extra_rdoc_files:
|
76
100
|
- LICENSE
|
77
101
|
- README.rdoc
|
78
|
-
files:
|
102
|
+
files:
|
79
103
|
- .document
|
104
|
+
- .gitignore
|
105
|
+
- .travis.yml
|
80
106
|
- CHANGESET
|
107
|
+
- Gemfile
|
108
|
+
- Gemfile.lock
|
81
109
|
- LICENSE
|
82
110
|
- README.rdoc
|
83
111
|
- Rakefile
|
84
|
-
- VERSION
|
85
112
|
- haz_enum.gemspec
|
86
113
|
- lib/haz_enum.rb
|
87
114
|
- lib/haz_enum/enum.rb
|
88
115
|
- lib/haz_enum/set.rb
|
116
|
+
- lib/version.rb
|
89
117
|
- spec/enum_spec.rb
|
90
118
|
- spec/set_spec.rb
|
91
119
|
- spec/spec.opts
|
92
120
|
- spec/spec_helper.rb
|
93
|
-
has_rdoc: true
|
94
121
|
homepage: http://github.com/galaxycats/haz_enum
|
95
122
|
licenses: []
|
96
|
-
|
97
123
|
post_install_message:
|
98
124
|
rdoc_options: []
|
99
|
-
|
100
|
-
require_paths:
|
125
|
+
require_paths:
|
101
126
|
- lib
|
102
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
127
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
103
128
|
none: false
|
104
|
-
requirements:
|
105
|
-
- -
|
106
|
-
- !ruby/object:Gem::Version
|
107
|
-
|
108
|
-
|
109
|
-
- 0
|
110
|
-
version: "0"
|
111
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - ! '>='
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: '0'
|
133
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
112
134
|
none: false
|
113
|
-
requirements:
|
114
|
-
- -
|
115
|
-
- !ruby/object:Gem::Version
|
116
|
-
|
117
|
-
segments:
|
118
|
-
- 0
|
119
|
-
version: "0"
|
135
|
+
requirements:
|
136
|
+
- - ! '>='
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
120
139
|
requirements: []
|
121
|
-
|
122
|
-
|
123
|
-
rubygems_version: 1.5.0
|
140
|
+
rubyforge_project: haz_enum
|
141
|
+
rubygems_version: 1.8.23
|
124
142
|
signing_key:
|
125
143
|
specification_version: 3
|
126
144
|
summary: has_set and has_enum for ActiveRecord
|
127
|
-
test_files:
|
145
|
+
test_files:
|
128
146
|
- spec/enum_spec.rb
|
129
147
|
- spec/set_spec.rb
|
148
|
+
- spec/spec.opts
|
130
149
|
- spec/spec_helper.rb
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.5.3
|