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 +4 -4
- data/.gitignore +0 -1
- data/Gemfile +1 -0
- data/Gemfile.lock +35 -0
- data/Rakefile +1 -0
- data/lib/valuable.rb +1 -1
- data/test/typical_test.rb +5 -0
- data/valuable.version +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9bbc18a2b139f32386397c81db9c218fb26c6d31
|
4
|
+
data.tar.gz: b8fc0a4cdf580799818d8bfa9c012e2c8f2991ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 943a75a3b565042af7171d14e78264076cb27af3e71c3d263dae2e5946a0009fad12995aba3e44a83c34e1d5325e3e340370eac68221c6b96db159bc23ce941b
|
7
|
+
data.tar.gz: 2cf6bc7310fbcc1c2b6c4d8932eebd27f22f1acac12b68a88220cc7cb9559f6b8747df66256b60fbefa96624ec4a3cf91952603d3051212950d4498c75bb8aaf
|
data/Gemfile
CHANGED
data/Gemfile.lock
ADDED
@@ -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
data/lib/valuable.rb
CHANGED
@@ -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
|
data/test/typical_test.rb
CHANGED
@@ -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
|
|
data/valuable.version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.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.
|
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:
|
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,
|