classy_enum 3.3.0 → 3.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +16 -2
- data/classy_enum.gemspec +1 -0
- data/gemfiles/Gemfile.rails-4.0.x +1 -1
- data/lib/classy_enum/version.rb +1 -1
- data/lib/generators/classy_enum/classy_enum_generator.rb +0 -1
- data/lib/generators/rspec/classy_enum_generator.rb +0 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 45044a722b58936978086da28b62bb08201c455b
|
4
|
+
data.tar.gz: 53dda48051a67227813a924acf839c6301d65059
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd3b5a77302bdeca43a13aaa08bf3120e439218029710f5558ef5765d55e7f8aab87c6a9aaba009cb3c68b4b35d5bbf53bd3496950dee4251f5a9c2ed74340d4
|
7
|
+
data.tar.gz: 61b2612a989cda2ac2d9a034ad49fca2212b43aa15c10d09c6d72b49ef7e9d9531fa9fd82da439780fffe7a3f6779d6691d8bb504e92c3002939ba8f38ae74bf
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# ClassyEnum Changelog
|
2
2
|
|
3
|
+
## 3.3.1
|
4
|
+
|
5
|
+
* Fixes `rails destroy classy_enum MyEnum` so it does not remove enums
|
6
|
+
directory and inadvertently remove all enum classes.
|
7
|
+
* Adding license to gemspec
|
8
|
+
|
3
9
|
## 3.3.0
|
4
10
|
|
5
11
|
* Extends the existing generator to create boilerplate spec/test files.
|
data/README.md
CHANGED
@@ -11,7 +11,7 @@ This README is also available in a [user-friendly DocumentUp format](http://beer
|
|
11
11
|
|
12
12
|
## Rails & Ruby Versions Supported
|
13
13
|
|
14
|
-
*Rails:* 3.0.x - 4.0.
|
14
|
+
*Rails:* 3.0.x - 4.0.x
|
15
15
|
|
16
16
|
*Ruby:* 1.8.7, 1.9.2, 1.9.3 and 2.0.0
|
17
17
|
|
@@ -32,7 +32,14 @@ The most common use for ClassyEnum is to replace database lookup tables where th
|
|
32
32
|
The fastest way to get up and running with ClassyEnum is to use the built-in Rails generator like so:
|
33
33
|
|
34
34
|
```
|
35
|
-
rails
|
35
|
+
rails generate classy_enum Priority low medium high
|
36
|
+
```
|
37
|
+
|
38
|
+
NOTE: You may destroy/revoke an enum by using the `rails destroy`
|
39
|
+
command:
|
40
|
+
|
41
|
+
```
|
42
|
+
rails destroy classy_enum Priority
|
36
43
|
```
|
37
44
|
|
38
45
|
A new enum template file will be created at app/enums/priority.rb that will look like:
|
@@ -165,6 +172,13 @@ as opposed to the attributes on an Active Record object.
|
|
165
172
|
Priority.find(:low) # => Priority::Low.new
|
166
173
|
Priority.find('medium') # => Priority::Medium.new
|
167
174
|
|
175
|
+
# Test if a priority is valid:
|
176
|
+
Priority.include?(:low) # => true
|
177
|
+
Priority.include?(:lower) # => false
|
178
|
+
|
179
|
+
# List priorities base strings:
|
180
|
+
Priority.map { |p| p.to_s } # => ["low", "medium", "high"]
|
181
|
+
|
168
182
|
# Find the lowest priority that can send email:
|
169
183
|
Priority.find(&:send_email?) # => Priority::High.new
|
170
184
|
|
data/classy_enum.gemspec
CHANGED
@@ -7,6 +7,7 @@ Gem::Specification.new do |gem|
|
|
7
7
|
gem.description = "A utility that adds class based enum functionality to ActiveRecord attributes"
|
8
8
|
gem.summary = "A class based enumerator utility for Ruby on Rails"
|
9
9
|
gem.homepage = "http://github.com/beerlington/classy_enum"
|
10
|
+
gem.license = "MIT"
|
10
11
|
|
11
12
|
gem.files = `git ls-files`.split($\)
|
12
13
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
data/lib/classy_enum/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: classy_enum
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.3.
|
4
|
+
version: 3.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Brown
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -124,7 +124,8 @@ files:
|
|
124
124
|
- spec/classy_enum_spec.rb
|
125
125
|
- spec/spec_helper.rb
|
126
126
|
homepage: http://github.com/beerlington/classy_enum
|
127
|
-
licenses:
|
127
|
+
licenses:
|
128
|
+
- MIT
|
128
129
|
metadata: {}
|
129
130
|
post_install_message:
|
130
131
|
rdoc_options: []
|
@@ -142,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
142
143
|
version: '0'
|
143
144
|
requirements: []
|
144
145
|
rubyforge_project:
|
145
|
-
rubygems_version: 2.0.
|
146
|
+
rubygems_version: 2.0.3
|
146
147
|
signing_key:
|
147
148
|
specification_version: 4
|
148
149
|
summary: A class based enumerator utility for Ruby on Rails
|