enumify 0.0.5 → 0.0.6

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: a8afbb3738f0c1aba03e6447384e9fe19c628905
4
- data.tar.gz: 7a3e37ec4b0e53194e13005d8c46ffcd5c9ff4b6
3
+ metadata.gz: 6e07e879db1b0841f3709bb38a18a6e1ebf6ca9d
4
+ data.tar.gz: 16564aef554f7f9b5ec758ebc05c8773b0491255
5
5
  SHA512:
6
- metadata.gz: cee67d6734399da89000f4a503acd71098842395bd5ef6d6fdd1e7d08bbed1fe7cc8debcff7b20dfcc3cc5a2533845f4b8ab38fce479519b210b31fd14cc9850
7
- data.tar.gz: ccb3e32f9d9dd9c7fa8457097d3a23cd5899585a3edbce0a3491a1f268a80f4180b72e2d12b7e507e9895b1c3da44f10709a5fbd65d195a87b142a63ac001583
6
+ metadata.gz: 25f74bc2d96ac0c98113836d512193afc297b5f00ef2e7f342749cd5a4a0390449e5b59e55f67bd8f04542e10e80c11f6db6bc405007ce53f68d3509b3b6f601
7
+ data.tar.gz: ab1a202e1104bd2d7dd84e6bfadae9e40a46b310664ca73152e2c859a1bedb3a7955e530ee25453a0f3f762cd974a096fb3011ff5ea48fdb671f831b9cf40b23
@@ -3,12 +3,21 @@ rvm:
3
3
  - 1.8.7
4
4
  - 1.9.3
5
5
  - 2.0.0
6
+ - 2.1.0
7
+ - rbx
8
+ - jruby-19mode
6
9
  gemfile:
7
10
  - gemfiles/rails30.gemfile
8
11
  - gemfiles/rails31.gemfile
9
12
  - gemfiles/rails32.gemfile
10
13
  - gemfiles/rails40.gemfile
14
+ - gemfiles/rails41.gemfile
11
15
  matrix:
12
16
  exclude:
13
17
  - rvm: 1.8.7
14
- gemfile: gemfiles/rails40.gemfile
18
+ gemfile: gemfiles/rails40.gemfile
19
+ - rvm: 1.8.7
20
+ gemfile: gemfiles/rails41.gemfile
21
+ allow_failures:
22
+ - rvm: jruby-19mode
23
+ gemfile: gemfiles/rails41.gemfile
data/Appraisals CHANGED
@@ -1,15 +1,44 @@
1
1
  appraise "rails30" do
2
+ gem 'rubysl', '~> 2.0', :platforms => :rbx
3
+ gem 'rubinius-developer_tools', :platforms => :rbx
4
+ gem 'sqlite3', :platforms => [:ruby, :rbx]
5
+ gem 'activerecord-jdbcsqlite3-adapter', :platforms => :jruby
6
+
2
7
  gem "activerecord", "~> 3.0.11"
3
8
  end
4
9
 
5
10
  appraise "rails31" do
11
+ gem 'rubysl', '~> 2.0', :platforms => :rbx
12
+ gem 'rubinius-developer_tools', :platforms => :rbx
13
+ gem 'sqlite3', :platforms => [:ruby, :rbx]
14
+ gem 'activerecord-jdbcsqlite3-adapter', :platforms => :jruby
15
+
6
16
  gem "activerecord", "~> 3.1.12"
7
17
  end
8
18
 
9
19
  appraise "rails32" do
20
+ gem 'rubysl', '~> 2.0', :platforms => :rbx
21
+ gem 'rubinius-developer_tools', :platforms => :rbx
22
+ gem 'sqlite3', :platforms => [:ruby, :rbx]
23
+ gem 'activerecord-jdbcsqlite3-adapter', :platforms => :jruby
24
+
10
25
  gem "activerecord", "~> 3.2.14"
11
26
  end
12
27
 
13
28
  appraise "rails40" do
29
+ gem 'rubysl', '~> 2.0', :platforms => :rbx
30
+ gem 'rubinius-developer_tools', :platforms => :rbx
31
+ gem 'sqlite3', :platforms => [:ruby, :rbx]
32
+ gem 'activerecord-jdbcsqlite3-adapter', :platforms => :jruby
33
+
14
34
  gem "activerecord", "~> 4.0.0"
35
+ end
36
+
37
+ appraise "rails41" do
38
+ gem 'rubysl', '~> 2.0', :platforms => :rbx
39
+ gem 'rubinius-developer_tools', :platforms => :rbx
40
+ gem 'sqlite3', :platforms => [:ruby, :rbx]
41
+ gem 'activerecord-jdbcsqlite3-adapter', :platforms => :jruby
42
+
43
+ gem "activerecord", "~> 4.1.0.beta1"
15
44
  end
@@ -1,3 +1,6 @@
1
+ ## v0.0.6
2
+ * Calling method! will not trigger a save if the value had not changed
3
+
1
4
  ## v0.0.5
2
5
  * Added 'allow_nil' as an option.
3
6
 
@@ -9,4 +12,4 @@
9
12
  * Improved the tests
10
13
 
11
14
  ## v0.0.1
12
- * Initial release
15
+ * Initial release
data/Gemfile CHANGED
@@ -1,4 +1,9 @@
1
1
  source "http://rubygems.org"
2
2
 
3
+ gem 'rubysl', '~> 2.0', :platforms => :rbx
4
+ gem 'rubinius-developer_tools', :platforms => :rbx
5
+ gem 'sqlite3', :platforms => [:ruby, :rbx]
6
+ gem 'activerecord-jdbcsqlite3-adapter', :platforms => :jruby
7
+
3
8
  # Specify your gem's dependencies in enumify.gemspec
4
9
  gemspec
@@ -32,6 +32,5 @@ Gem::Specification.new do |s|
32
32
  s.add_development_dependency "rake"
33
33
  s.add_development_dependency "rspec"
34
34
  s.add_development_dependency "activerecord", '>= 3.0'
35
- s.add_development_dependency "sqlite3"
36
35
  s.add_development_dependency 'appraisal', '>= 0.3.8'
37
36
  end
@@ -4,4 +4,9 @@ source "http://rubygems.org"
4
4
 
5
5
  gem "activerecord", "~> 3.0.11"
6
6
 
7
+ gem 'rubysl', '~> 2.0', :platforms => :rbx
8
+ gem 'rubinius-developer_tools', :platforms => :rbx
9
+ gem 'sqlite3', :platforms => [:ruby, :rbx]
10
+ gem 'activerecord-jdbcsqlite3-adapter', :platforms => :jruby
11
+
7
12
  gemspec :path=>"../"
@@ -4,4 +4,9 @@ source "http://rubygems.org"
4
4
 
5
5
  gem "activerecord", "~> 3.1.12"
6
6
 
7
+ gem 'rubysl', '~> 2.0', :platforms => :rbx
8
+ gem 'rubinius-developer_tools', :platforms => :rbx
9
+ gem 'sqlite3', :platforms => [:ruby, :rbx]
10
+ gem 'activerecord-jdbcsqlite3-adapter', :platforms => :jruby
11
+
7
12
  gemspec :path=>"../"
@@ -4,4 +4,9 @@ source "http://rubygems.org"
4
4
 
5
5
  gem "activerecord", "~> 3.2.14"
6
6
 
7
+ gem 'rubysl', '~> 2.0', :platforms => :rbx
8
+ gem 'rubinius-developer_tools', :platforms => :rbx
9
+ gem 'sqlite3', :platforms => [:ruby, :rbx]
10
+ gem 'activerecord-jdbcsqlite3-adapter', :platforms => :jruby
11
+
7
12
  gemspec :path=>"../"
@@ -4,4 +4,9 @@ source "http://rubygems.org"
4
4
 
5
5
  gem "activerecord", "~> 4.0.0"
6
6
 
7
+ gem 'rubysl', '~> 2.0', :platforms => :rbx
8
+ gem 'rubinius-developer_tools', :platforms => :rbx
9
+ gem 'sqlite3', :platforms => [:ruby, :rbx]
10
+ gem 'activerecord-jdbcsqlite3-adapter', :platforms => :jruby
11
+
7
12
  gemspec :path=>"../"
@@ -0,0 +1,12 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://rubygems.org"
4
+
5
+ gem "activerecord", "~> 4.1.0.beta1"
6
+
7
+ gem 'rubysl', '~> 2.0', :platforms => :rbx
8
+ gem 'rubinius-developer_tools', :platforms => :rbx
9
+ gem 'sqlite3', :platforms => [:ruby, :rbx]
10
+ gem 'activerecord-jdbcsqlite3-adapter', :platforms => :jruby
11
+
12
+ gemspec :path=>"../"
@@ -23,9 +23,10 @@ module Enumify
23
23
 
24
24
  value = value.to_sym
25
25
  old = read_attribute(parameter) ? read_attribute(parameter).to_sym : nil
26
+ return value if old == value
26
27
  write_attribute(parameter, value.to_s)
27
28
  save if should_save
28
- send("#{parameter.to_s}_changed", old, value) if respond_to?("#{parameter.to_s}_changed", true) and old != value and !old.nil?
29
+ send("#{parameter.to_s}_changed", old, value) if respond_to?("#{parameter.to_s}_changed", true) and !old.nil?
29
30
  return value
30
31
  end
31
32
 
@@ -1,3 +1,3 @@
1
1
  module Enumify
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
@@ -79,6 +79,15 @@ describe :Enumify do
79
79
  @obj.canceled!
80
80
  @obj.status.should == :canceled
81
81
  end
82
+
83
+ context 'trying to set the value to the same value' do
84
+ before { @obj.available! }
85
+ it 'should not save the object again' do
86
+ @obj.should_not_receive(:save)
87
+ @obj.available!
88
+ end
89
+ end
90
+
82
91
  end
83
92
 
84
93
  it "should have two shorthand methods for each possible value" do
@@ -179,4 +188,4 @@ describe :Enumify do
179
188
  Model::STATUSES.should == [:available, :canceled, :completed]
180
189
  end
181
190
 
182
- end
191
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enumify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - yon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-14 00:00:00.000000000 Z
11
+ date: 2014-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -52,20 +52,6 @@ dependencies:
52
52
  - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.0'
55
- - !ruby/object:Gem::Dependency
56
- name: sqlite3
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - '>='
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - '>='
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: appraisal
71
57
  requirement: !ruby/object:Gem::Requirement
@@ -108,6 +94,7 @@ files:
108
94
  - gemfiles/rails31.gemfile
109
95
  - gemfiles/rails32.gemfile
110
96
  - gemfiles/rails40.gemfile
97
+ - gemfiles/rails41.gemfile
111
98
  - lib/enumify.rb
112
99
  - lib/enumify/model.rb
113
100
  - lib/enumify/railtie.rb
@@ -134,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
121
  version: '0'
135
122
  requirements: []
136
123
  rubyforge_project: enumify
137
- rubygems_version: 2.0.6
124
+ rubygems_version: 2.0.3
138
125
  signing_key:
139
126
  specification_version: 4
140
127
  summary: enumify adds an enum command to all ActiveRecord models which enables you