classy_enum 3.3.0 → 3.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e797e8a533bf5f74cca3a2b6c1ac10fb2de623bd
4
- data.tar.gz: 7e7049d175554faa74facd0b5a95108131a8f4cc
3
+ metadata.gz: 45044a722b58936978086da28b62bb08201c455b
4
+ data.tar.gz: 53dda48051a67227813a924acf839c6301d65059
5
5
  SHA512:
6
- metadata.gz: 41c72e09e4a3ba245f58139d5f6f40e22ade540b37947a1c3639d907015c2c5b6b46fbb27b25fe8576e969e0830a0c01e7ca495a4b0ac2c3b161e2215a947ca3
7
- data.tar.gz: 1f28e0114ab0c8f06efd71963dcd788b65ab9686230bc0cc578b2e61b774599ab3f9f59189d95dcc6ec3ab7fc68513a5774d328099cb7d3bd1dfd4ba079ab090
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.0.rc2
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 g classy_enum Priority low medium high
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)/})
@@ -1,6 +1,6 @@
1
1
  source :rubygems
2
2
 
3
- gem 'rails', '4.0.0.rc2'
3
+ gem 'rails', '~> 4.0.0'
4
4
  gem 'rspec-rails', '~> 2.11'
5
5
  gem 'sqlite3'
6
6
  gem 'json', '~> 1.7'
@@ -1,3 +1,3 @@
1
1
  module ClassyEnum
2
- VERSION = "3.3.0"
2
+ VERSION = "3.3.1"
3
3
  end
@@ -7,7 +7,6 @@ class ClassyEnumGenerator < Rails::Generators::NamedBase
7
7
  source_root File.expand_path("../templates", __FILE__)
8
8
 
9
9
  def copy_files # :nodoc:
10
- empty_directory 'app/enums'
11
10
  template "enum.rb", "app/enums/#{file_name}.rb"
12
11
  end
13
12
 
@@ -9,7 +9,6 @@ module Rspec
9
9
  source_root File.expand_path("../templates", __FILE__)
10
10
 
11
11
  def copy_files # :nodoc:
12
- empty_directory 'spec/enums'
13
12
  template "enum_spec.rb", "spec/enums/#{file_name}_spec.rb"
14
13
  end
15
14
  end
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.0
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-06-23 00:00:00.000000000 Z
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.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