property_sets 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1,46 +1,9 @@
1
1
  Gemfile.lock
2
2
  test/*.log
3
3
  .rvmrc
4
-
5
- # rcov generated
6
4
  coverage
7
-
8
- # rdoc generated
9
5
  rdoc
10
-
11
- # yard generated
12
6
  doc
13
7
  .yardoc
14
-
15
- # bundler
16
8
  .bundle
17
-
18
- # jeweler generated
19
9
  pkg
20
-
21
- # Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
22
- #
23
- # * Create a file at ~/.gitignore
24
- # * Include files you want ignored
25
- # * Run: git config --global core.excludesfile ~/.gitignore
26
- #
27
- # After doing this, these files will be ignored in all your git projects,
28
- # saving you from having to 'pollute' every project you touch with them
29
- #
30
- # Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line)
31
- #
32
- # For MacOS:
33
- #
34
- #.DS_Store
35
- #
36
- # For TextMate
37
- #*.tmproj
38
- #tmtags
39
- #
40
- # For emacs:
41
- #*~
42
- #\#*
43
- #.\#*
44
- #
45
- # For vim:
46
- #*.swp
data/.travis.yml CHANGED
@@ -1,7 +1,3 @@
1
- before_install:
2
- - gem update --system
3
- before_script:
4
- - "mysql -e 'create database property_sets_test;'"
5
1
  rvm:
6
2
  - 1.8.7
7
3
  - 1.9.3
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source "http://rubygems.org"
1
+ source :rubygems
2
2
 
3
3
  gem 'activerecord-jdbcmysql-adapter', '1.2.2', :platforms => :jruby
4
4
  gem 'mysql', :platforms => :ruby
@@ -1,6 +1,6 @@
1
1
  # This file was generated by Appraisal
2
2
 
3
- source "http://rubygems.org"
3
+ source :rubygems
4
4
 
5
5
  gem "activerecord-jdbcmysql-adapter", "1.2.2", :platforms=>:jruby
6
6
  gem "mysql", :platforms=>:ruby
@@ -1,7 +1,7 @@
1
1
  PATH
2
- remote: /Users/mgrosser/code/tools/property_sets
2
+ remote: /Users/primdahl/Git/property_sets
3
3
  specs:
4
- property_sets (0.7.2)
4
+ property_sets (0.8.1)
5
5
  actionpack (>= 2.3.14, < 3.3)
6
6
  activerecord (>= 2.3.14, < 3.3)
7
7
  activesupport (>= 2.3.14, < 3.3)
@@ -24,7 +24,7 @@ GEM
24
24
  bundler
25
25
  rake
26
26
  jdbc-mysql (5.1.13)
27
- json (1.7.3)
27
+ json (1.7.5)
28
28
  metaclass (0.0.1)
29
29
  mocha (0.10.3)
30
30
  metaclass (~> 0.0.1)
@@ -32,6 +32,7 @@ GEM
32
32
  rack (1.1.3)
33
33
  rake (0.9.2.2)
34
34
  shoulda (2.11.3)
35
+ test-unit (2.5.2)
35
36
 
36
37
  PLATFORMS
37
38
  java
@@ -49,3 +50,4 @@ DEPENDENCIES
49
50
  property_sets!
50
51
  rake
51
52
  shoulda
53
+ test-unit (>= 2.5.2)
@@ -1,6 +1,6 @@
1
1
  # This file was generated by Appraisal
2
2
 
3
- source "http://rubygems.org"
3
+ source :rubygems
4
4
 
5
5
  gem "activerecord-jdbcmysql-adapter", "1.2.2", :platforms=>:jruby
6
6
  gem "mysql", :platforms=>:ruby
@@ -1,7 +1,7 @@
1
1
  PATH
2
- remote: /Users/mgrosser/code/tools/property_sets
2
+ remote: /Users/primdahl/Git/property_sets
3
3
  specs:
4
- property_sets (0.7.2)
4
+ property_sets (0.8.1)
5
5
  actionpack (>= 2.3.14, < 3.3)
6
6
  activerecord (>= 2.3.14, < 3.3)
7
7
  activesupport (>= 2.3.14, < 3.3)
@@ -39,7 +39,7 @@ GEM
39
39
  erubis (2.6.6)
40
40
  abstract (>= 1.0.0)
41
41
  i18n (0.5.0)
42
- json (1.7.3)
42
+ json (1.7.5)
43
43
  metaclass (0.0.1)
44
44
  mocha (0.12.0)
45
45
  metaclass (~> 0.0.1)
@@ -55,6 +55,7 @@ GEM
55
55
  shoulda-matchers (~> 1.0.0)
56
56
  shoulda-context (1.0.0)
57
57
  shoulda-matchers (1.0.0)
58
+ test-unit (2.5.2)
58
59
  tzinfo (0.3.33)
59
60
 
60
61
  PLATFORMS
@@ -72,3 +73,4 @@ DEPENDENCIES
72
73
  property_sets!
73
74
  rake
74
75
  shoulda
76
+ test-unit (>= 2.5.2)
@@ -1,6 +1,6 @@
1
1
  # This file was generated by Appraisal
2
2
 
3
- source "http://rubygems.org"
3
+ source :rubygems
4
4
 
5
5
  gem "activerecord-jdbcmysql-adapter", "1.2.2", :platforms=>:jruby
6
6
  gem "mysql", :platforms=>:ruby
@@ -1,7 +1,7 @@
1
1
  PATH
2
- remote: /Users/mgrosser/code/tools/property_sets
2
+ remote: /Users/primdahl/Git/property_sets
3
3
  specs:
4
- property_sets (0.7.2)
4
+ property_sets (0.8.1)
5
5
  actionpack (>= 2.3.14, < 3.3)
6
6
  activerecord (>= 2.3.14, < 3.3)
7
7
  activesupport (>= 2.3.14, < 3.3)
@@ -45,7 +45,8 @@ GEM
45
45
  i18n (0.6.0)
46
46
  jdbc-mysql (5.1.13)
47
47
  journey (1.0.4)
48
- json (1.7.3)
48
+ json (1.7.5)
49
+ json (1.7.5-java)
49
50
  metaclass (0.0.1)
50
51
  mocha (0.10.3)
51
52
  metaclass (~> 0.0.1)
@@ -62,6 +63,7 @@ GEM
62
63
  hike (~> 1.2)
63
64
  rack (~> 1.0)
64
65
  tilt (~> 1.1, != 1.3.0)
66
+ test-unit (2.5.2)
65
67
  tilt (1.3.3)
66
68
  tzinfo (0.3.33)
67
69
 
@@ -81,3 +83,4 @@ DEPENDENCIES
81
83
  property_sets!
82
84
  rake
83
85
  shoulda
86
+ test-unit (>= 2.5.2)
@@ -1,4 +1,4 @@
1
- Gem::Specification.new "property_sets", "0.8.0" do |s|
1
+ Gem::Specification.new "property_sets", "0.8.1" do |s|
2
2
  s.summary = "Property sets for ActiveRecord."
3
3
  s.description = "This gem is an ActiveRecord extension which provides a convenient interface for managing per row properties."
4
4
  s.authors = ["Morten Primdahl"]
@@ -15,6 +15,7 @@ Gem::Specification.new "property_sets", "0.8.0" do |s|
15
15
  s.add_development_dependency('shoulda')
16
16
  s.add_development_dependency('mocha')
17
17
  s.add_development_dependency('appraisal')
18
+ s.add_development_dependency('test-unit', '>= 2.5.2')
18
19
 
19
20
  s.files = `git ls-files`.split("\n")
20
21
  s.license = "MIT"
@@ -191,29 +191,36 @@ class TestPropertySets < ActiveSupport::TestCase
191
191
  end
192
192
 
193
193
  should "be updateable as a nested structure" do
194
- attribs = {
195
- :name => "Kim", :settings => { :foo => "1", :bar => "0" }
196
- }
197
-
198
- assert @account.update_attributes(attribs)
194
+ @account.settings.baz = "1"
199
195
  @account.save!
200
196
 
201
- assert @account.settings.foo?
197
+ assert !@account.settings.foo?
202
198
  assert !@account.settings.bar?
203
- assert @account.settings.foo == "1"
204
- assert @account.settings.bar == "0"
199
+ assert @account.settings.baz?
205
200
  assert !@account.settings.pro?
206
201
 
207
- attribs = {
208
- :name => "Kim", :settings => { :foo => "1", :bar => "1", :baz => "1", :pro => "1" }
209
- }
202
+ @account.update_attributes!(
203
+ :name => "Kim",
204
+ :settings => { :foo => "1", :baz => "0", :pro => "1" }
205
+ )
210
206
 
211
- assert @account.update_attributes!(attribs)
207
+ @account.reload
212
208
 
209
+ # set
213
210
  assert @account.settings.foo?
214
- assert @account.settings.bar?
215
- assert @account.settings.baz?
211
+ assert_equal "1", @account.settings.foo
212
+
213
+ # kept
214
+ assert !@account.settings.bar?
215
+ assert_equal nil, @account.settings.bar
216
+
217
+ # unset
218
+ assert !@account.settings.baz?
219
+ assert_equal "0", @account.settings.baz
220
+
221
+ # protected -> not set
216
222
  assert !@account.settings.pro?
223
+ assert_equal nil, @account.settings.pro
217
224
  end
218
225
  end
219
226
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: property_sets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-11 00:00:00.000000000 Z
12
+ date: 2012-09-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -173,6 +173,22 @@ dependencies:
173
173
  - - ! '>='
174
174
  - !ruby/object:Gem::Version
175
175
  version: '0'
176
+ - !ruby/object:Gem::Dependency
177
+ name: test-unit
178
+ requirement: !ruby/object:Gem::Requirement
179
+ none: false
180
+ requirements:
181
+ - - ! '>='
182
+ - !ruby/object:Gem::Version
183
+ version: 2.5.2
184
+ type: :development
185
+ prerelease: false
186
+ version_requirements: !ruby/object:Gem::Requirement
187
+ none: false
188
+ requirements:
189
+ - - ! '>='
190
+ - !ruby/object:Gem::Version
191
+ version: 2.5.2
176
192
  description: This gem is an ActiveRecord extension which provides a convenient interface
177
193
  for managing per row properties.
178
194
  email: primdahl@me.com
@@ -229,7 +245,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
229
245
  version: '0'
230
246
  requirements: []
231
247
  rubyforge_project:
232
- rubygems_version: 1.8.24
248
+ rubygems_version: 1.8.23
233
249
  signing_key:
234
250
  specification_version: 3
235
251
  summary: Property sets for ActiveRecord.