kumolus-mongoid-enum 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 74f9c8dc48c4b67345875349ae97c6047bc878b5
4
+ data.tar.gz: 4869b8177d3af12778135998ae8f3738197d4549
5
+ SHA512:
6
+ metadata.gz: 2f03ddbc77b24fe9182c75c1719148349a8d97ecdc79665ca88b6d82d4358a82b94014a3a97702d9100cce18fdb5c305ec25f42ce2db8e8eb1ee4f475e50ef92
7
+ data.tar.gz: 565f50cc22d203fa45d29058602c23799765167ff012cb6ff64acf21ee1ec3a072a8a335281f1f31fbafa3dedc39417bb27668e5af5c4cd5a5e63d949ad19436
data/.autotest ADDED
File without changes
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color
data/.travis.yml ADDED
@@ -0,0 +1,14 @@
1
+ script: "bundle exec rspec spec"
2
+
3
+ language: ruby
4
+
5
+ rvm:
6
+ - 1.9.3
7
+ - 2.0.0
8
+ - 2.1.0
9
+ - 2.1.1
10
+ - 2.1.2
11
+ - jruby-19mode
12
+
13
+ services:
14
+ - mongodb
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in kumolus-mongoid-enum.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Nicholas Bruning
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # Mongoid::Enum
2
+
3
+ # Installation
4
+
5
+ Add this to your Gemfile:
6
+
7
+ ```ruby
8
+ gem "kumolus-mongoid-enum"
9
+ ```
10
+
11
+ And then run `bundle install`.
12
+
13
+
14
+ # Usage
15
+
16
+ ```ruby
17
+ class Payment
18
+ include Mongoid::Document
19
+ include Mongoid::Enum
20
+
21
+ enum :status, [:pending, :approved, :declined]
22
+ end
23
+ ```
24
+
25
+ Aaaaaaand then you get things like:
26
+
27
+ ```ruby
28
+ payment = Payment.create
29
+
30
+ payment.status
31
+ # => :pending
32
+
33
+ payment.approved!
34
+ # => :approved
35
+
36
+ payment.pending?
37
+ # => :false
38
+
39
+ Payment.approved
40
+ # => Mongoid::Criteria for payments with status == :approved
41
+
42
+ ```
43
+
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,74 @@
1
+ require "mongoid/enum/version"
2
+ require "mongoid/enum/validators/multiple_validator"
3
+ require "mongoid/enum/configuration"
4
+
5
+ module Mongoid
6
+ module Enum
7
+ extend ActiveSupport::Concern
8
+ module ClassMethods
9
+
10
+ def enum(name, values, options = {})
11
+ field_name = :"#{Mongoid::Enum.configuration.field_name_prefix}#{name}"
12
+ options = default_options(values).merge(options)
13
+
14
+ set_values_constant name, values
15
+
16
+ create_field field_name, options
17
+ alias_attribute name, field_name
18
+
19
+ create_validations field_name, values, options
20
+ define_value_scopes_and_accessors field_name, values, options
21
+ end
22
+
23
+ private
24
+ def default_options(values)
25
+ {
26
+ :multiple => false,
27
+ :default => values.first,
28
+ :required => true,
29
+ :validate => true
30
+ }
31
+ end
32
+
33
+ def set_values_constant(name, values)
34
+ const_name = name.to_s.upcase
35
+ const_set const_name, values
36
+ end
37
+
38
+ def create_field(field_name, options)
39
+ type = options[:multiple] && Array || Symbol
40
+ field field_name, :type => type, :default => options[:default]
41
+ end
42
+
43
+ def create_validations(field_name, values, options)
44
+ if options[:multiple] && options[:validate]
45
+ validates field_name, :'mongoid/enum/validators/multiple' => { :in => values, :allow_nil => !options[:required] }
46
+ elsif options[:validate]
47
+ validates field_name, :inclusion => {:in => values}, :allow_nil => !options[:required]
48
+ end
49
+ end
50
+
51
+ def define_value_scopes_and_accessors(field_name, values, options)
52
+ values.each do |value|
53
+ scope value, ->{ where(field_name => value) }
54
+
55
+ if options[:multiple]
56
+ define_array_accessor(field_name, value)
57
+ else
58
+ define_string_accessor(field_name, value)
59
+ end
60
+ end
61
+ end
62
+
63
+ def define_array_accessor(field_name, value)
64
+ class_eval "def #{value}?() self.#{field_name}.include?(:#{value}) end"
65
+ class_eval "def #{value}!() update_attributes! :#{field_name} => (self.#{field_name} || []) + [:#{value}] end"
66
+ end
67
+
68
+ def define_string_accessor(field_name, value)
69
+ class_eval "def #{value}?() self.#{field_name} == :#{value} end"
70
+ class_eval "def #{value}!() update_attributes! :#{field_name} => :#{value} end"
71
+ end
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,19 @@
1
+ module Mongoid
2
+ module Enum
3
+ class Configuration
4
+ attr_accessor :field_name_prefix
5
+
6
+ def initialize
7
+ self.field_name_prefix = "_"
8
+ end
9
+ end
10
+
11
+ def self.configuration
12
+ @configuration ||= Configuration.new
13
+ end
14
+
15
+ def self.configure
16
+ yield(configuration) if block_given?
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,29 @@
1
+ module Mongoid
2
+ module Enum
3
+ module Validators
4
+ class MultipleValidator < ActiveModel::EachValidator
5
+ def validate_each(record, attribute, values)
6
+ values = Array(values)
7
+
8
+ if options[:allow_nil]
9
+ add_error_message record, attribute if !all_included?(values, options[:in])
10
+ else
11
+ add_error_message record, attribute if values.empty? || !all_included?(values, options[:in])
12
+ end
13
+ end
14
+
15
+ def add_error_message(record, attribute)
16
+ record.errors[attribute] << (options[:message] || "is not in #{options[:in].join ", "}")
17
+ end
18
+
19
+ def all_included?(values, allowed)
20
+ (values - allowed).empty?
21
+ end
22
+
23
+ def self.kind
24
+ :custom
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,5 @@
1
+ module Mongoid
2
+ module Enum
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,29 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'mongoid/enum/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "kumolus-mongoid-enum"
8
+ spec.version = Mongoid::Enum::VERSION
9
+ spec.authors = ["Kumoas"]
10
+ spec.email = ["kumoas@kumolus.com"]
11
+ spec.description = %q{Heavily inspired by DDH's ActiveRecord::Enum, this little library is there to help you cut down the cruft in your models and make the world a happier place at the same time.}
12
+ spec.summary = %q{enum support for Mongoid}
13
+ spec.homepage = "https://github.com/kumoas/kumolus-mongoid-enum"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_runtime_dependency "mongoid", "~> 6.0"
22
+
23
+ spec.add_development_dependency "bundler", "~> 1.3"
24
+ spec.add_development_dependency "rake"
25
+ spec.add_development_dependency "rspec", "~> 2.14"
26
+ spec.add_development_dependency "guard-rspec", "~> 4.0.3"
27
+ spec.add_development_dependency "database_cleaner", "~> 1.5.3"
28
+ spec.add_development_dependency "mongoid-rspec", "~> 1.5.1"
29
+ end
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ describe Mongoid::Enum::Configuration do
4
+ subject { Mongoid::Enum::Configuration.new }
5
+
6
+ describe "field_name_prefix" do
7
+ it "has '_' as default value" do
8
+ expect(subject.field_name_prefix).to eq "_"
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,80 @@
1
+ require 'spec_helper'
2
+ require 'ostruct'
3
+
4
+ describe Mongoid::Enum::Validators::MultipleValidator do
5
+ subject { Mongoid::Enum::Validators::MultipleValidator }
6
+ let(:values) { [:lorem, :ipsum, :dolor, :sit] }
7
+ let(:attribute) { :word }
8
+ let(:record) { OpenStruct.new(:errors => {attribute => []}, attribute => values.first) }
9
+ let(:allow_nil) { false }
10
+ let(:validator) { subject.new(:attributes => attribute, :in => values, :allow_nil => allow_nil) }
11
+
12
+ describe ".validate_each" do
13
+ context "when allow_nil: true" do
14
+ let(:allow_nil) { true }
15
+
16
+ context "and value is nil" do
17
+ before(:each) { validator.validate_each(record, attribute, nil) }
18
+ it "validates" do
19
+ expect(record.errors[attribute].empty?).to be true
20
+ end
21
+ end
22
+
23
+ context "and value is []" do
24
+ before(:each) { validator.validate_each(record, attribute, []) }
25
+ it "validates" do
26
+ expect(record.errors[attribute].empty?).to be true
27
+ end
28
+ end
29
+ end
30
+
31
+ context "when allow_nil: false" do
32
+ context "and value is nil" do
33
+ before(:each) { validator.validate_each(record, attribute, nil) }
34
+ it "won't validate" do
35
+ expect(record.errors[attribute].any?).to be true
36
+ expect(record.errors[attribute]).to eq ["is not in #{values.join ", "}"]
37
+ end
38
+ end
39
+ context "and value is []" do
40
+ before(:each) { validator.validate_each(record, attribute, []) }
41
+ it "won't validate" do
42
+ expect(record.errors[attribute].any?).to be true
43
+ expect(record.errors[attribute]).to eq ["is not in #{values.join ", "}"]
44
+ end
45
+ end
46
+ end
47
+
48
+ context "when value is included" do
49
+ let(:allow_nil) { rand(2).zero? }
50
+ before(:each) { validator.validate_each(record, attribute, [values.sample]) }
51
+ it "validates" do
52
+ expect(record.errors[attribute].empty?).to be true
53
+ end
54
+ end
55
+
56
+ context "when value is not included" do
57
+ let(:allow_nil) { rand(2).zero? }
58
+ before(:each) { validator.validate_each(record, attribute, [:amet]) }
59
+ it "won't validate" do
60
+ expect(record.errors[attribute].any?).to be true
61
+ end
62
+ end
63
+
64
+ context "when multiple values included" do
65
+ let(:allow_nil) { rand(2).zero? }
66
+ before(:each) { validator.validate_each(record, attribute, [values.first, values.last]) }
67
+ it "validates" do
68
+ expect(record.errors[attribute].empty?).to be true
69
+ end
70
+ end
71
+
72
+ context "when one value is not included "do
73
+ let(:allow_nil) { rand(2).zero? }
74
+ before(:each) { validator.validate_each(record, attribute, [values.first, values.last, :amet]) }
75
+ it "won't validate" do
76
+ expect(record.errors[attribute].any?).to be true
77
+ end
78
+ end
79
+ end
80
+ end
@@ -0,0 +1,212 @@
1
+ require 'spec_helper'
2
+ require 'mongoid/enum/configuration'
3
+
4
+ class User
5
+ include Mongoid::Document
6
+ include Mongoid::Enum
7
+
8
+ enum :status, [:awaiting_approval, :approved, :banned]
9
+ enum :roles, [:author, :editor, :admin], :multiple => true, :default => [], :required => false
10
+ end
11
+
12
+ describe Mongoid::Enum do
13
+ let(:klass) { User }
14
+ let(:instance) { User.new }
15
+ let(:alias_name) { :status }
16
+ let(:field_name) { :"_#{alias_name}" }
17
+ let(:values) { [:awaiting_approval, :approved, :banned] }
18
+ let(:multiple_field_name) { :"_roles" }
19
+
20
+ describe "field" do
21
+ it "is defined" do
22
+ expect(klass).to have_field(field_name)
23
+ end
24
+
25
+ it "uses prefix defined in configuration" do
26
+ old_field_name_prefix = Mongoid::Enum.configuration.field_name_prefix
27
+ Mongoid::Enum.configure do |config|
28
+ config.field_name_prefix = "___"
29
+ end
30
+ UserWithoutPrefix = Class.new do
31
+ include Mongoid::Document
32
+ include Mongoid::Enum
33
+
34
+ enum :status, [:awaiting_approval, :approved, :banned]
35
+ end
36
+ expect(UserWithoutPrefix).to have_field "___status"
37
+ Mongoid::Enum.configure do |config|
38
+ config.field_name_prefix = old_field_name_prefix
39
+ end
40
+ end
41
+
42
+ it "is aliased" do
43
+ expect(instance).to respond_to alias_name
44
+ expect(instance).to respond_to :"#{alias_name}="
45
+ expect(instance).to respond_to :"#{alias_name}?"
46
+ end
47
+
48
+ describe "type" do
49
+ context "when multiple" do
50
+ it "is an array" do
51
+ expect(klass).to have_field(multiple_field_name).of_type(Array)
52
+ end
53
+
54
+ it "validates using a custom validator" do
55
+ expect(klass).to custom_validate(multiple_field_name).with_validator(Mongoid::Enum::Validators::MultipleValidator)
56
+ end
57
+ end
58
+
59
+ context "when not multiple" do
60
+ it "is a symbol" do
61
+ expect(klass).to have_field(field_name).of_type(Symbol)
62
+ end
63
+
64
+ it "validates inclusion in values" do
65
+ expect(klass).to validate_inclusion_of(field_name).to_allow(values)
66
+ end
67
+ end
68
+ end
69
+ end
70
+
71
+ describe "constant" do
72
+ it "is set to the values" do
73
+ expect(klass::STATUS).to eq values
74
+ end
75
+ end
76
+
77
+ describe "accessors" do
78
+ context "when singular" do
79
+ describe "{{value}}!" do
80
+ it "sets the value" do
81
+ instance.save
82
+ instance.banned!
83
+ expect(instance.status).to eq :banned
84
+ end
85
+ end
86
+
87
+ describe "{{value}}?" do
88
+ context "when {{enum}} == {{value}}" do
89
+ it "returns true" do
90
+ instance.save
91
+ instance.banned!
92
+ expect(instance.banned?).to eq true
93
+ end
94
+ end
95
+ context "when {{enum}} != {{value}}" do
96
+ it "returns false" do
97
+ instance.save
98
+ instance.banned!
99
+ expect(instance.approved?).to eq false
100
+ end
101
+ end
102
+ end
103
+ end
104
+
105
+ context "when multiple" do
106
+ describe "{{value}}!" do
107
+ context "when field is nil" do
108
+ it "creates an array containing the value" do
109
+ instance.roles = nil
110
+ instance.save
111
+ instance.author!
112
+ expect(instance.roles).to eq [:author]
113
+ end
114
+ end
115
+
116
+ context "when field is not nil" do
117
+ it "appends the value" do
118
+ instance.save
119
+ instance.author!
120
+ instance.editor!
121
+ expect(instance.roles).to eq [:author, :editor]
122
+ end
123
+ end
124
+ end
125
+
126
+ describe "{{value}}?" do
127
+ context "when {{enum}} contains {{value}}" do
128
+ it "returns true" do
129
+ instance.save
130
+ instance.author!
131
+ instance.editor!
132
+ expect(instance.editor?).to be true
133
+ expect(instance.author?).to be true
134
+ end
135
+ end
136
+
137
+ context "when {{enum}} does not contain {{value}}" do
138
+ it "returns false" do
139
+ instance.save
140
+ expect(instance.author?).to be false
141
+ end
142
+ end
143
+ end
144
+ end
145
+ end
146
+
147
+ describe "scopes" do
148
+ context "when singular" do
149
+ it "returns the corresponding documents" do
150
+ instance.save
151
+ instance.banned!
152
+ expect(User.banned.to_a).to eq [instance]
153
+ end
154
+ end
155
+
156
+ context "when multiple" do
157
+ context "and only one document" do
158
+ it "returns that document" do
159
+ instance.save
160
+ instance.author!
161
+ instance.editor!
162
+ expect(User.author.to_a).to eq [instance]
163
+ end
164
+ end
165
+
166
+ context "and more than one document" do
167
+ it "returns all documents with those values" do
168
+ instance.save
169
+ instance.author!
170
+ instance.editor!
171
+ instance2 = klass.create
172
+ instance2.author!
173
+ expect(User.author.to_a).to eq [instance, instance2]
174
+ expect(User.editor.to_a).to eq [instance]
175
+ end
176
+ end
177
+ end
178
+ end
179
+
180
+ describe "default values" do
181
+ context "when not specified" do
182
+ it "uses the first value" do
183
+ instance.save
184
+ expect(instance.status).to eq values.first
185
+ end
186
+ end
187
+
188
+ context "when specified" do
189
+ it "uses the specified value" do
190
+ instance.save
191
+ expect(instance.roles).to eq []
192
+ end
193
+ end
194
+ end
195
+
196
+ describe ".configuration" do
197
+ it "returns Configuration object" do
198
+ expect(Mongoid::Enum.configuration)
199
+ .to be_instance_of Mongoid::Enum::Configuration
200
+ end
201
+ it "returns same object when called multiple times" do
202
+ expect(Mongoid::Enum.configuration).to be Mongoid::Enum.configuration
203
+ end
204
+ end
205
+
206
+ describe ".configure" do
207
+ it "yields configuration if block is given" do
208
+ expect { |b| Mongoid::Enum.configure &b }
209
+ .to yield_with_args Mongoid::Enum.configuration
210
+ end
211
+ end
212
+ end
@@ -0,0 +1,22 @@
1
+ $: << File.expand_path("../../lib", __FILE__)
2
+
3
+ require 'database_cleaner'
4
+ require 'mongoid'
5
+ require 'mongoid-rspec'
6
+ require 'mongoid/enum'
7
+
8
+ ENV['MONGOID_ENV'] = "test"
9
+
10
+ RSpec.configure do |config|
11
+ config.include Mongoid::Matchers
12
+ config.before(:suite) do
13
+ DatabaseCleaner.strategy = :truncation
14
+ end
15
+
16
+ config.after(:each) do
17
+ DatabaseCleaner.clean
18
+ Mongoid.purge!
19
+ end
20
+ end
21
+
22
+ Mongoid.load!(File.expand_path("../support/mongoid.yml", __FILE__), :test)
@@ -0,0 +1,6 @@
1
+ test:
2
+ clients:
3
+ default:
4
+ database: mongoid-enum_test
5
+ hosts:
6
+ - localhost:<%= ENV['BOXEN_MONGODB_PORT'] || 27017 %>
metadata ADDED
@@ -0,0 +1,167 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: kumolus-mongoid-enum
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Kumoas
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-11-17 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: mongoid
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '6.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '6.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.3'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.3'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '2.14'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '2.14'
69
+ - !ruby/object:Gem::Dependency
70
+ name: guard-rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 4.0.3
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 4.0.3
83
+ - !ruby/object:Gem::Dependency
84
+ name: database_cleaner
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 1.5.3
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 1.5.3
97
+ - !ruby/object:Gem::Dependency
98
+ name: mongoid-rspec
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: 1.5.1
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: 1.5.1
111
+ description: Heavily inspired by DDH's ActiveRecord::Enum, this little library is
112
+ there to help you cut down the cruft in your models and make the world a happier
113
+ place at the same time.
114
+ email:
115
+ - kumoas@kumolus.com
116
+ executables: []
117
+ extensions: []
118
+ extra_rdoc_files: []
119
+ files:
120
+ - ".autotest"
121
+ - ".gitignore"
122
+ - ".rspec"
123
+ - ".travis.yml"
124
+ - Gemfile
125
+ - LICENSE.txt
126
+ - README.md
127
+ - Rakefile
128
+ - lib/mongoid/enum.rb
129
+ - lib/mongoid/enum/configuration.rb
130
+ - lib/mongoid/enum/validators/multiple_validator.rb
131
+ - lib/mongoid/enum/version.rb
132
+ - mongoid-enum.gemspec
133
+ - spec/mongoid/configuration_spec.rb
134
+ - spec/mongoid/enum/validators/multiple_validator_spec.rb
135
+ - spec/mongoid/enum_spec.rb
136
+ - spec/spec_helper.rb
137
+ - spec/support/mongoid.yml
138
+ homepage: https://github.com/kumoas/kumolus-mongoid-enum
139
+ licenses:
140
+ - MIT
141
+ metadata: {}
142
+ post_install_message:
143
+ rdoc_options: []
144
+ require_paths:
145
+ - lib
146
+ required_ruby_version: !ruby/object:Gem::Requirement
147
+ requirements:
148
+ - - ">="
149
+ - !ruby/object:Gem::Version
150
+ version: '0'
151
+ required_rubygems_version: !ruby/object:Gem::Requirement
152
+ requirements:
153
+ - - ">="
154
+ - !ruby/object:Gem::Version
155
+ version: '0'
156
+ requirements: []
157
+ rubyforge_project:
158
+ rubygems_version: 2.6.13
159
+ signing_key:
160
+ specification_version: 4
161
+ summary: enum support for Mongoid
162
+ test_files:
163
+ - spec/mongoid/configuration_spec.rb
164
+ - spec/mongoid/enum/validators/multiple_validator_spec.rb
165
+ - spec/mongoid/enum_spec.rb
166
+ - spec/spec_helper.rb
167
+ - spec/support/mongoid.yml