valuable 0.9.9 → 0.9.10

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: 8b73106fa82246539ba8267f4fe67f37fa852bcc
4
- data.tar.gz: e3129d8e0e5cb8598724a8b3e9d0e8b03e75a120
3
+ metadata.gz: 9bbc18a2b139f32386397c81db9c218fb26c6d31
4
+ data.tar.gz: b8fc0a4cdf580799818d8bfa9c012e2c8f2991ea
5
5
  SHA512:
6
- metadata.gz: ca0da48eac6c68d6eab0c89810912326dff0dad697ed7dd60ded222b36ce3ea877a22e71d9319f2685879af3136ed695b702a234a693dbdf73fbf448654f2b37
7
- data.tar.gz: 1a273f03d269426b36ce6d889c19126b5cdcd1c224370404dadae8340d2c4004fa8155014500d57be3f2f552c810cb066db01684eeedebedca801f240f733dcd
6
+ metadata.gz: 943a75a3b565042af7171d14e78264076cb27af3e71c3d263dae2e5946a0009fad12995aba3e44a83c34e1d5325e3e340370eac68221c6b96db159bc23ce941b
7
+ data.tar.gz: 2cf6bc7310fbcc1c2b6c4d8932eebd27f22f1acac12b68a88220cc7cb9559f6b8747df66256b60fbefa96624ec4a3cf91952603d3051212950d4498c75bb8aaf
data/.gitignore CHANGED
@@ -7,5 +7,4 @@
7
7
  .svn
8
8
  pkg
9
9
  vendor
10
- Gemfile.lock
11
10
  *.gem
data/Gemfile CHANGED
@@ -6,6 +6,7 @@ gemspec
6
6
  gem 'rake'
7
7
 
8
8
  group :test do
9
+ gem 'rspec', '2.14.1'
9
10
  gem 'test-unit'
10
11
  gem 'mocha'
11
12
  end
@@ -0,0 +1,35 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ valuable (0.9.10)
5
+
6
+ GEM
7
+ remote: http://rubygems.org/
8
+ specs:
9
+ diff-lcs (1.2.5)
10
+ metaclass (0.0.1)
11
+ mocha (0.13.2)
12
+ metaclass (~> 0.0.1)
13
+ rake (10.0.3)
14
+ rspec (2.14.1)
15
+ rspec-core (~> 2.14.0)
16
+ rspec-expectations (~> 2.14.0)
17
+ rspec-mocks (~> 2.14.0)
18
+ rspec-core (2.14.8)
19
+ rspec-expectations (2.14.5)
20
+ diff-lcs (>= 1.1.3, < 2.0)
21
+ rspec-mocks (2.14.6)
22
+ test-unit (2.5.4)
23
+
24
+ PLATFORMS
25
+ ruby
26
+
27
+ DEPENDENCIES
28
+ mocha
29
+ rake
30
+ rspec (= 2.14.1)
31
+ test-unit
32
+ valuable!
33
+
34
+ BUNDLED WITH
35
+ 1.10.6
data/Rakefile CHANGED
@@ -28,3 +28,4 @@ task :clean => [:clobber_package, :clobber_rdoc] do
28
28
  File.delete(*temp_files)
29
29
  end
30
30
 
31
+ task :default => [:test]
@@ -283,7 +283,7 @@ class Valuable
283
283
  name = name.to_sym
284
284
  options[:item_klass] = options[:klass] if options[:klass]
285
285
  options[:klass] = :collection
286
- options[:default] = []
286
+ options[:default] ||= []
287
287
  options[:extend] = [options[:extend]].flatten.compact
288
288
 
289
289
  _attributes[name] = options
@@ -6,6 +6,7 @@ require 'date'
6
6
  require File.expand_path(File.dirname(__FILE__) + '/../examples/phone_number')
7
7
  class Person < Valuable
8
8
  has_value :dob, :klass => :date
9
+ has_collection :dreams, :default => [:happiness, :respect]
9
10
  end
10
11
 
11
12
  class Chemical < Valuable
@@ -56,5 +57,9 @@ class TypicalTest < Test::Unit::TestCase
56
57
  lemon_juice = Chemical.new(:ph => nil)
57
58
  assert_equal nil, lemon_juice.ph
58
59
  end
60
+
61
+ def test_that_it_uses_the_default_collection
62
+ assert_equal Person.new.dreams, [:happiness, :respect]
63
+ end
59
64
  end
60
65
 
@@ -1 +1 @@
1
- 0.9.9
1
+ 0.9.10
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: valuable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.9
4
+ version: 0.9.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johnathon Wright
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-05 00:00:00.000000000 Z
11
+ date: 2016-01-13 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Valuable is a ruby base class that is essentially attr_accessor on steroids.
14
14
  A simple and intuitive interface allows you to get on with modeling in your app.
@@ -19,6 +19,7 @@ extra_rdoc_files: []
19
19
  files:
20
20
  - ".gitignore"
21
21
  - Gemfile
22
+ - Gemfile.lock
22
23
  - LICENSE
23
24
  - README.markdown
24
25
  - Rakefile
@@ -63,7 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
63
64
  version: '0'
64
65
  requirements: []
65
66
  rubyforge_project:
66
- rubygems_version: 2.4.5
67
+ rubygems_version: 2.4.5.1
67
68
  signing_key:
68
69
  specification_version: 4
69
70
  summary: attr_accessor on steroids with defaults, attribute formatting, alias methods,