virtus 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. data/Gemfile +11 -15
  2. data/History.txt +10 -0
  3. data/TODO +4 -0
  4. data/VERSION +1 -1
  5. data/config/flay.yml +1 -1
  6. data/config/flog.yml +1 -1
  7. data/config/roodi.yml +6 -6
  8. data/config/site.reek +5 -5
  9. data/lib/virtus.rb +21 -11
  10. data/lib/virtus/attribute.rb +92 -59
  11. data/lib/virtus/attribute/array.rb +4 -3
  12. data/lib/virtus/attribute/boolean.rb +21 -9
  13. data/lib/virtus/attribute/date.rb +5 -3
  14. data/lib/virtus/attribute/date_time.rb +5 -3
  15. data/lib/virtus/attribute/decimal.rb +5 -3
  16. data/lib/virtus/attribute/float.rb +5 -3
  17. data/lib/virtus/attribute/hash.rb +4 -3
  18. data/lib/virtus/attribute/integer.rb +5 -3
  19. data/lib/virtus/attribute/numeric.rb +5 -3
  20. data/lib/virtus/attribute/object.rb +4 -4
  21. data/lib/virtus/attribute/string.rb +7 -9
  22. data/lib/virtus/attribute/time.rb +5 -3
  23. data/lib/virtus/attribute_set.rb +151 -0
  24. data/lib/virtus/class_methods.rb +19 -10
  25. data/lib/virtus/instance_methods.rb +51 -27
  26. data/lib/virtus/support/descendants_tracker.rb +30 -0
  27. data/lib/virtus/typecast/boolean.rb +7 -5
  28. data/lib/virtus/typecast/numeric.rb +13 -8
  29. data/lib/virtus/typecast/string.rb +24 -0
  30. data/lib/virtus/typecast/time.rb +7 -5
  31. data/spec/integration/virtus/class_methods/attribute_spec.rb +17 -5
  32. data/spec/integration/virtus/class_methods/attributes_spec.rb +2 -5
  33. data/spec/shared/idempotent_method_behaviour.rb +5 -0
  34. data/spec/spec_helper.rb +15 -0
  35. data/spec/unit/shared/attribute.rb +6 -155
  36. data/spec/unit/shared/attribute/accept_options.rb +55 -0
  37. data/spec/unit/shared/attribute/accepted_options.rb +11 -0
  38. data/spec/unit/shared/attribute/complex.rb +15 -0
  39. data/spec/unit/shared/attribute/get.rb +29 -0
  40. data/spec/unit/shared/attribute/options.rb +7 -0
  41. data/spec/unit/shared/attribute/set.rb +42 -0
  42. data/spec/unit/virtus/attribute/boolean_spec.rb +1 -2
  43. data/spec/unit/virtus/attribute/date_spec.rb +1 -2
  44. data/spec/unit/virtus/attribute/date_time_spec.rb +1 -2
  45. data/spec/unit/virtus/attribute/decimal_spec.rb +1 -2
  46. data/spec/unit/virtus/attribute/float_spec.rb +1 -2
  47. data/spec/unit/virtus/attribute/integer_spec.rb +1 -2
  48. data/spec/unit/virtus/attribute/numeric/class_methods/descendants_spec.rb +2 -2
  49. data/spec/unit/virtus/attribute/object/class_methods/descendants_spec.rb +6 -4
  50. data/spec/unit/virtus/attribute/string_spec.rb +1 -2
  51. data/spec/unit/virtus/attribute/time_spec.rb +1 -2
  52. data/spec/unit/virtus/attribute_set/append_spec.rb +35 -0
  53. data/spec/unit/virtus/attribute_set/each_spec.rb +60 -0
  54. data/spec/unit/virtus/attribute_set/element_reference_spec.rb +13 -0
  55. data/spec/unit/virtus/attribute_set/element_set_spec.rb +35 -0
  56. data/spec/unit/virtus/attribute_set/merge_spec.rb +36 -0
  57. data/spec/unit/virtus/attribute_set/parent_spec.rb +11 -0
  58. data/spec/unit/virtus/attribute_set/reset_spec.rb +60 -0
  59. data/spec/unit/virtus/class_methods/attribute_spec.rb +11 -0
  60. data/spec/unit/virtus/descendants_tracker/descendants_spec.rb +22 -0
  61. data/spec/unit/virtus/descendants_tracker/inherited_spec.rb +24 -0
  62. data/spec/unit/virtus/determine_type_spec.rb +21 -9
  63. data/spec/unit/virtus/instance_methods/{attribute_get_spec.rb → element_reference_spec.rb} +4 -2
  64. data/spec/unit/virtus/instance_methods/{attribute_set_spec.rb → element_set_spec.rb} +5 -7
  65. data/virtus.gemspec +35 -13
  66. metadata +96 -14
  67. data/lib/virtus/support/chainable.rb +0 -13
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ describe Virtus::AttributeSet, '#parent' do
4
+ subject { object.parent }
5
+
6
+ let(:attributes) { [] }
7
+ let(:parent) { described_class.new }
8
+ let(:object) { described_class.new(parent, attributes) }
9
+
10
+ it { should equal(parent) }
11
+ end
@@ -0,0 +1,60 @@
1
+ require 'spec_helper'
2
+
3
+ describe Virtus::AttributeSet, '#reset' do
4
+ subject { object.reset }
5
+
6
+ let(:name) { :name }
7
+ let(:attribute) { mock('Attribute', :name => name) }
8
+ let(:attributes) { [ attribute ] }
9
+ let(:object) { described_class.new(parent, attributes) }
10
+
11
+ context 'when the parent has no attributes' do
12
+ let(:parent) { described_class.new }
13
+
14
+ it { should equal(object) }
15
+
16
+ its(:to_set) { should == Set[ attribute ] }
17
+ end
18
+
19
+ context 'when the parent has attributes that are not duplicates' do
20
+ let(:parent_attribute) { mock('Parent Attribute', :name => :parent_name) }
21
+ let(:parent) { described_class.new([ parent_attribute ]) }
22
+
23
+ it { should equal(object) }
24
+
25
+ its(:to_set) { should == Set[ attribute, parent_attribute ] }
26
+ end
27
+
28
+ context 'when the parent has attributes that are duplicates' do
29
+ let(:parent_attribute) { mock('Parent Attribute', :name => name) }
30
+ let(:parent) { described_class.new([ parent_attribute ]) }
31
+
32
+ it { should equal(object) }
33
+
34
+ its(:to_set) { should == Set[ attribute ] }
35
+ end
36
+
37
+ context 'when the parent has changed' do
38
+ let(:parent_attribute) { mock('Parent Attribute', :name => :parent_name) }
39
+ let(:parent) { described_class.new([ parent_attribute ]) }
40
+ let(:new_attribute) { mock('New Attribute', :name => :parent_name) }
41
+
42
+ it { should equal(object) }
43
+
44
+ it 'includes changes from the parent' do
45
+ expect { parent << new_attribute; subject }.to change { object.to_set }.
46
+ from(Set[ attribute, parent_attribute ]).
47
+ to(Set[ attribute, new_attribute ])
48
+ end
49
+ end
50
+
51
+ context 'when the parent is nil' do
52
+ let(:parent) { nil }
53
+
54
+ it { should equal(object) }
55
+
56
+ it 'includes changes from the parent' do
57
+ expect { subject }.to_not change { object.to_set }
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ describe Virtus::ClassMethods, '.attribute' do
4
+ let(:described_class) do
5
+ Class.new { include Virtus }
6
+ end
7
+
8
+ it 'returns self' do
9
+ described_class.attribute(:name, String).should be(described_class)
10
+ end
11
+ end
@@ -0,0 +1,22 @@
1
+ require 'spec_helper'
2
+
3
+ describe Virtus::DescendantsTracker, '#descendants' do
4
+ subject { object.descendants }
5
+
6
+ let(:described_class) { Class.new { extend Virtus::DescendantsTracker } }
7
+ let(:object) { described_class }
8
+
9
+ context 'when there are no descendants' do
10
+ it_should_behave_like 'an idempotent method'
11
+
12
+ it { should be_empty }
13
+ end
14
+
15
+ context 'when there are descendants' do
16
+ let!(:descendant) { Class.new(object) } # trigger the class inhertance
17
+
18
+ it_should_behave_like 'an idempotent method'
19
+
20
+ it { should eql([ descendant ]) }
21
+ end
22
+ end
@@ -0,0 +1,24 @@
1
+ require 'spec_helper'
2
+
3
+ describe Virtus::DescendantsTracker, '#inherited' do
4
+ subject { object.inherited(descendant) }
5
+
6
+ let(:described_class) { Class.new { extend Virtus::DescendantsTracker } }
7
+ let(:object) { Class.new(described_class) }
8
+ let(:descendant) { Class.new }
9
+
10
+ it { should equal(object) }
11
+
12
+ it 'prepends the class to the descendants' do
13
+ object.descendants << original = Class.new
14
+ expect { subject }.to change { object.descendants.dup }.
15
+ from([ original ]).
16
+ to([ descendant, original ])
17
+ end
18
+
19
+ it 'prepends the class to the superclass descendants' do
20
+ expect { subject }.to change { object.superclass.descendants.dup }.
21
+ from([ object ]).
22
+ to([ descendant, object ])
23
+ end
24
+ end
@@ -1,20 +1,32 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Virtus, '.determine_type' do
4
+ Virtus::Attribute.descendants.each do |attribute_class|
4
5
 
5
- (Virtus::Attribute::Object.descendants - [
6
- Virtus::Attribute::Boolean,
7
- Virtus::Attribute::Object,
8
- Virtus::Attribute::Numeric ]).each do |attribute_class|
6
+ context "with class #{attribute_class.inspect}" do
7
+ subject { described_class.determine_type(attribute_class) }
9
8
 
10
- context "with #{attribute_primitive = attribute_class.primitive}" do
11
- subject { described_class.determine_type(attribute_primitive) }
9
+ it 'returns the corresponding attribute class' do
10
+ should be(attribute_class)
11
+ end
12
+ end
12
13
 
13
- it "returns the corresponding attribute class" do
14
- subject.should be(attribute_class)
14
+ primitive = attribute_class.primitive
15
+ context "with primitive #{primitive.inspect}" do
16
+ subject { described_class.determine_type(primitive) }
17
+
18
+ it 'returns the corresponding attribute class' do
19
+ should be(attribute_class)
15
20
  end
16
21
  end
17
22
 
18
- end
23
+ suffix = attribute_class.name['Virtus::Attribute::'.length..-1]
24
+ context "with string #{suffix.inspect}" do
25
+ subject { described_class.determine_type(suffix) }
19
26
 
27
+ it 'returns the corresponding attribute class' do
28
+ should be(attribute_class)
29
+ end
30
+ end
31
+ end
20
32
  end
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Virtus::InstanceMethods, '#attribute_get' do
3
+ describe Virtus::InstanceMethods, '#[]' do
4
+ subject { object[:name] }
5
+
4
6
  let(:described_class) do
5
7
  Class.new do
6
8
  include Virtus
@@ -17,6 +19,6 @@ describe Virtus::InstanceMethods, '#attribute_get' do
17
19
  end
18
20
 
19
21
  it "returns the value of an attribute" do
20
- object.attribute_get(:name).should eql(value)
22
+ should eql(value)
21
23
  end
22
24
  end
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Virtus::InstanceMethods, '#attribute_set' do
3
+ describe Virtus::InstanceMethods, '#[]=' do
4
+ subject { object[:name] = value }
5
+
4
6
  let(:described_class) do
5
7
  Class.new do
6
8
  include Virtus
@@ -16,15 +18,11 @@ describe Virtus::InstanceMethods, '#attribute_set' do
16
18
  'john'
17
19
  end
18
20
 
19
- before do
20
- object.attribute_set(:name, value)
21
- end
22
-
23
21
  it "returns the value" do
24
- object.attribute_set(:name, value).should eql(value)
22
+ should eql(value)
25
23
  end
26
24
 
27
25
  it "sets value of an attribute" do
28
- object.name.should eql(value)
26
+ expect { subject }.to change { object.name }.from(nil).to(value)
29
27
  end
30
28
  end
@@ -5,16 +5,17 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{virtus}
8
- s.version = "0.0.3"
8
+ s.version = "0.0.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = [%q{Piotr Solnica}]
12
- s.date = %q{2011-06-09}
11
+ s.authors = ["Piotr Solnica"]
12
+ s.date = %q{2011-07-08}
13
13
  s.description = %q{Attributes for your plain ruby objects}
14
- s.email = [%q{piotr@rubyverse.com}]
14
+ s.email = ["piotr@rubyverse.com"]
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE",
17
- "README.markdown"
17
+ "README.markdown",
18
+ "TODO"
18
19
  ]
19
20
  s.files = [
20
21
  ".gitignore",
@@ -25,6 +26,7 @@ Gem::Specification.new do |s|
25
26
  "LICENSE",
26
27
  "README.markdown",
27
28
  "Rakefile",
29
+ "TODO",
28
30
  "VERSION",
29
31
  "config/flay.yml",
30
32
  "config/flog.yml",
@@ -45,19 +47,28 @@ Gem::Specification.new do |s|
45
47
  "lib/virtus/attribute/object.rb",
46
48
  "lib/virtus/attribute/string.rb",
47
49
  "lib/virtus/attribute/time.rb",
50
+ "lib/virtus/attribute_set.rb",
48
51
  "lib/virtus/class_methods.rb",
49
52
  "lib/virtus/instance_methods.rb",
50
- "lib/virtus/support/chainable.rb",
53
+ "lib/virtus/support/descendants_tracker.rb",
51
54
  "lib/virtus/typecast/boolean.rb",
52
55
  "lib/virtus/typecast/numeric.rb",
56
+ "lib/virtus/typecast/string.rb",
53
57
  "lib/virtus/typecast/time.rb",
54
58
  "spec/integration/virtus/attributes/attribute/typecast_spec.rb",
55
59
  "spec/integration/virtus/class_methods/attribute_spec.rb",
56
60
  "spec/integration/virtus/class_methods/attributes_spec.rb",
57
61
  "spec/integration/virtus/class_methods/const_missing_spec.rb",
58
62
  "spec/rcov.opts",
63
+ "spec/shared/idempotent_method_behaviour.rb",
59
64
  "spec/spec_helper.rb",
60
65
  "spec/unit/shared/attribute.rb",
66
+ "spec/unit/shared/attribute/accept_options.rb",
67
+ "spec/unit/shared/attribute/accepted_options.rb",
68
+ "spec/unit/shared/attribute/complex.rb",
69
+ "spec/unit/shared/attribute/get.rb",
70
+ "spec/unit/shared/attribute/options.rb",
71
+ "spec/unit/shared/attribute/set.rb",
61
72
  "spec/unit/virtus/attribute/array_spec.rb",
62
73
  "spec/unit/virtus/attribute/attribute_spec.rb",
63
74
  "spec/unit/virtus/attribute/boolean_spec.rb",
@@ -71,11 +82,21 @@ Gem::Specification.new do |s|
71
82
  "spec/unit/virtus/attribute/object/class_methods/descendants_spec.rb",
72
83
  "spec/unit/virtus/attribute/string_spec.rb",
73
84
  "spec/unit/virtus/attribute/time_spec.rb",
85
+ "spec/unit/virtus/attribute_set/append_spec.rb",
86
+ "spec/unit/virtus/attribute_set/each_spec.rb",
87
+ "spec/unit/virtus/attribute_set/element_reference_spec.rb",
88
+ "spec/unit/virtus/attribute_set/element_set_spec.rb",
89
+ "spec/unit/virtus/attribute_set/merge_spec.rb",
90
+ "spec/unit/virtus/attribute_set/parent_spec.rb",
91
+ "spec/unit/virtus/attribute_set/reset_spec.rb",
92
+ "spec/unit/virtus/class_methods/attribute_spec.rb",
74
93
  "spec/unit/virtus/class_methods/new_spec.rb",
94
+ "spec/unit/virtus/descendants_tracker/descendants_spec.rb",
95
+ "spec/unit/virtus/descendants_tracker/inherited_spec.rb",
75
96
  "spec/unit/virtus/determine_type_spec.rb",
76
- "spec/unit/virtus/instance_methods/attribute_get_spec.rb",
77
- "spec/unit/virtus/instance_methods/attribute_set_spec.rb",
78
97
  "spec/unit/virtus/instance_methods/attributes_spec.rb",
98
+ "spec/unit/virtus/instance_methods/element_reference_spec.rb",
99
+ "spec/unit/virtus/instance_methods/element_set_spec.rb",
79
100
  "tasks/metrics/ci.rake",
80
101
  "tasks/metrics/flay.rake",
81
102
  "tasks/metrics/flog.rake",
@@ -89,22 +110,23 @@ Gem::Specification.new do |s|
89
110
  "virtus.gemspec"
90
111
  ]
91
112
  s.homepage = %q{https://github.com/solnic/virtus}
92
- s.require_paths = [%q{lib}]
93
- s.rubygems_version = %q{1.8.5}
113
+ s.require_paths = ["lib"]
114
+ s.rubygems_version = %q{1.6.2}
94
115
  s.summary = %q{Attributes for your plain ruby objects}
116
+ s.test_files = ["spec/integration/virtus/attributes/attribute/typecast_spec.rb", "spec/integration/virtus/class_methods/attribute_spec.rb", "spec/integration/virtus/class_methods/attributes_spec.rb", "spec/integration/virtus/class_methods/const_missing_spec.rb", "spec/rcov.opts", "spec/shared/idempotent_method_behaviour.rb", "spec/spec_helper.rb", "spec/unit/shared/attribute.rb", "spec/unit/shared/attribute/accept_options.rb", "spec/unit/shared/attribute/accepted_options.rb", "spec/unit/shared/attribute/complex.rb", "spec/unit/shared/attribute/get.rb", "spec/unit/shared/attribute/options.rb", "spec/unit/shared/attribute/set.rb", "spec/unit/virtus/attribute/array_spec.rb", "spec/unit/virtus/attribute/attribute_spec.rb", "spec/unit/virtus/attribute/boolean_spec.rb", "spec/unit/virtus/attribute/date_spec.rb", "spec/unit/virtus/attribute/date_time_spec.rb", "spec/unit/virtus/attribute/decimal_spec.rb", "spec/unit/virtus/attribute/float_spec.rb", "spec/unit/virtus/attribute/hash_spec.rb", "spec/unit/virtus/attribute/integer_spec.rb", "spec/unit/virtus/attribute/numeric/class_methods/descendants_spec.rb", "spec/unit/virtus/attribute/object/class_methods/descendants_spec.rb", "spec/unit/virtus/attribute/string_spec.rb", "spec/unit/virtus/attribute/time_spec.rb", "spec/unit/virtus/attribute_set/append_spec.rb", "spec/unit/virtus/attribute_set/each_spec.rb", "spec/unit/virtus/attribute_set/element_reference_spec.rb", "spec/unit/virtus/attribute_set/element_set_spec.rb", "spec/unit/virtus/attribute_set/merge_spec.rb", "spec/unit/virtus/attribute_set/parent_spec.rb", "spec/unit/virtus/attribute_set/reset_spec.rb", "spec/unit/virtus/class_methods/attribute_spec.rb", "spec/unit/virtus/class_methods/new_spec.rb", "spec/unit/virtus/descendants_tracker/descendants_spec.rb", "spec/unit/virtus/descendants_tracker/inherited_spec.rb", "spec/unit/virtus/determine_type_spec.rb", "spec/unit/virtus/instance_methods/attributes_spec.rb", "spec/unit/virtus/instance_methods/element_reference_spec.rb", "spec/unit/virtus/instance_methods/element_set_spec.rb"]
95
117
 
96
118
  if s.respond_to? :specification_version then
97
119
  s.specification_version = 3
98
120
 
99
121
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
100
- s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
122
+ s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
101
123
  s.add_development_dependency(%q<rspec>, ["~> 2.6.0"])
102
124
  else
103
- s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
125
+ s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
104
126
  s.add_dependency(%q<rspec>, ["~> 2.6.0"])
105
127
  end
106
128
  else
107
- s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
129
+ s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
108
130
  s.add_dependency(%q<rspec>, ["~> 2.6.0"])
109
131
  end
110
132
  end
metadata CHANGED
@@ -1,8 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: virtus
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 23
4
5
  prerelease:
5
- version: 0.0.3
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 4
10
+ version: 0.0.4
6
11
  platform: ruby
7
12
  authors:
8
13
  - Piotr Solnica
@@ -10,29 +15,40 @@ autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
17
 
13
- date: 2011-06-09 00:00:00 Z
18
+ date: 2011-07-08 00:00:00 +02:00
19
+ default_executable:
14
20
  dependencies:
15
21
  - !ruby/object:Gem::Dependency
16
- name: jeweler
22
+ prerelease: false
17
23
  requirement: &id001 !ruby/object:Gem::Requirement
18
24
  none: false
19
25
  requirements:
20
26
  - - ~>
21
27
  - !ruby/object:Gem::Version
22
- version: 1.5.2
28
+ hash: 7
29
+ segments:
30
+ - 1
31
+ - 6
32
+ - 4
33
+ version: 1.6.4
23
34
  type: :development
24
- prerelease: false
35
+ name: jeweler
25
36
  version_requirements: *id001
26
37
  - !ruby/object:Gem::Dependency
27
- name: rspec
38
+ prerelease: false
28
39
  requirement: &id002 !ruby/object:Gem::Requirement
29
40
  none: false
30
41
  requirements:
31
42
  - - ~>
32
43
  - !ruby/object:Gem::Version
44
+ hash: 23
45
+ segments:
46
+ - 2
47
+ - 6
48
+ - 0
33
49
  version: 2.6.0
34
50
  type: :development
35
- prerelease: false
51
+ name: rspec
36
52
  version_requirements: *id002
37
53
  description: Attributes for your plain ruby objects
38
54
  email:
@@ -44,6 +60,7 @@ extensions: []
44
60
  extra_rdoc_files:
45
61
  - LICENSE
46
62
  - README.markdown
63
+ - TODO
47
64
  files:
48
65
  - .gitignore
49
66
  - .rvmrc
@@ -53,6 +70,7 @@ files:
53
70
  - LICENSE
54
71
  - README.markdown
55
72
  - Rakefile
73
+ - TODO
56
74
  - VERSION
57
75
  - config/flay.yml
58
76
  - config/flog.yml
@@ -73,19 +91,28 @@ files:
73
91
  - lib/virtus/attribute/object.rb
74
92
  - lib/virtus/attribute/string.rb
75
93
  - lib/virtus/attribute/time.rb
94
+ - lib/virtus/attribute_set.rb
76
95
  - lib/virtus/class_methods.rb
77
96
  - lib/virtus/instance_methods.rb
78
- - lib/virtus/support/chainable.rb
97
+ - lib/virtus/support/descendants_tracker.rb
79
98
  - lib/virtus/typecast/boolean.rb
80
99
  - lib/virtus/typecast/numeric.rb
100
+ - lib/virtus/typecast/string.rb
81
101
  - lib/virtus/typecast/time.rb
82
102
  - spec/integration/virtus/attributes/attribute/typecast_spec.rb
83
103
  - spec/integration/virtus/class_methods/attribute_spec.rb
84
104
  - spec/integration/virtus/class_methods/attributes_spec.rb
85
105
  - spec/integration/virtus/class_methods/const_missing_spec.rb
86
106
  - spec/rcov.opts
107
+ - spec/shared/idempotent_method_behaviour.rb
87
108
  - spec/spec_helper.rb
88
109
  - spec/unit/shared/attribute.rb
110
+ - spec/unit/shared/attribute/accept_options.rb
111
+ - spec/unit/shared/attribute/accepted_options.rb
112
+ - spec/unit/shared/attribute/complex.rb
113
+ - spec/unit/shared/attribute/get.rb
114
+ - spec/unit/shared/attribute/options.rb
115
+ - spec/unit/shared/attribute/set.rb
89
116
  - spec/unit/virtus/attribute/array_spec.rb
90
117
  - spec/unit/virtus/attribute/attribute_spec.rb
91
118
  - spec/unit/virtus/attribute/boolean_spec.rb
@@ -99,11 +126,21 @@ files:
99
126
  - spec/unit/virtus/attribute/object/class_methods/descendants_spec.rb
100
127
  - spec/unit/virtus/attribute/string_spec.rb
101
128
  - spec/unit/virtus/attribute/time_spec.rb
129
+ - spec/unit/virtus/attribute_set/append_spec.rb
130
+ - spec/unit/virtus/attribute_set/each_spec.rb
131
+ - spec/unit/virtus/attribute_set/element_reference_spec.rb
132
+ - spec/unit/virtus/attribute_set/element_set_spec.rb
133
+ - spec/unit/virtus/attribute_set/merge_spec.rb
134
+ - spec/unit/virtus/attribute_set/parent_spec.rb
135
+ - spec/unit/virtus/attribute_set/reset_spec.rb
136
+ - spec/unit/virtus/class_methods/attribute_spec.rb
102
137
  - spec/unit/virtus/class_methods/new_spec.rb
138
+ - spec/unit/virtus/descendants_tracker/descendants_spec.rb
139
+ - spec/unit/virtus/descendants_tracker/inherited_spec.rb
103
140
  - spec/unit/virtus/determine_type_spec.rb
104
- - spec/unit/virtus/instance_methods/attribute_get_spec.rb
105
- - spec/unit/virtus/instance_methods/attribute_set_spec.rb
106
141
  - spec/unit/virtus/instance_methods/attributes_spec.rb
142
+ - spec/unit/virtus/instance_methods/element_reference_spec.rb
143
+ - spec/unit/virtus/instance_methods/element_set_spec.rb
107
144
  - tasks/metrics/ci.rake
108
145
  - tasks/metrics/flay.rake
109
146
  - tasks/metrics/flog.rake
@@ -115,6 +152,7 @@ files:
115
152
  - tasks/spec.rake
116
153
  - tasks/yard.rake
117
154
  - virtus.gemspec
155
+ has_rdoc: true
118
156
  homepage: https://github.com/solnic/virtus
119
157
  licenses: []
120
158
 
@@ -128,7 +166,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
128
166
  requirements:
129
167
  - - ">="
130
168
  - !ruby/object:Gem::Version
131
- hash: 403965839
169
+ hash: 3
132
170
  segments:
133
171
  - 0
134
172
  version: "0"
@@ -137,13 +175,57 @@ required_rubygems_version: !ruby/object:Gem::Requirement
137
175
  requirements:
138
176
  - - ">="
139
177
  - !ruby/object:Gem::Version
178
+ hash: 3
179
+ segments:
180
+ - 0
140
181
  version: "0"
141
182
  requirements: []
142
183
 
143
184
  rubyforge_project:
144
- rubygems_version: 1.8.5
185
+ rubygems_version: 1.6.2
145
186
  signing_key:
146
187
  specification_version: 3
147
188
  summary: Attributes for your plain ruby objects
148
- test_files: []
149
-
189
+ test_files:
190
+ - spec/integration/virtus/attributes/attribute/typecast_spec.rb
191
+ - spec/integration/virtus/class_methods/attribute_spec.rb
192
+ - spec/integration/virtus/class_methods/attributes_spec.rb
193
+ - spec/integration/virtus/class_methods/const_missing_spec.rb
194
+ - spec/rcov.opts
195
+ - spec/shared/idempotent_method_behaviour.rb
196
+ - spec/spec_helper.rb
197
+ - spec/unit/shared/attribute.rb
198
+ - spec/unit/shared/attribute/accept_options.rb
199
+ - spec/unit/shared/attribute/accepted_options.rb
200
+ - spec/unit/shared/attribute/complex.rb
201
+ - spec/unit/shared/attribute/get.rb
202
+ - spec/unit/shared/attribute/options.rb
203
+ - spec/unit/shared/attribute/set.rb
204
+ - spec/unit/virtus/attribute/array_spec.rb
205
+ - spec/unit/virtus/attribute/attribute_spec.rb
206
+ - spec/unit/virtus/attribute/boolean_spec.rb
207
+ - spec/unit/virtus/attribute/date_spec.rb
208
+ - spec/unit/virtus/attribute/date_time_spec.rb
209
+ - spec/unit/virtus/attribute/decimal_spec.rb
210
+ - spec/unit/virtus/attribute/float_spec.rb
211
+ - spec/unit/virtus/attribute/hash_spec.rb
212
+ - spec/unit/virtus/attribute/integer_spec.rb
213
+ - spec/unit/virtus/attribute/numeric/class_methods/descendants_spec.rb
214
+ - spec/unit/virtus/attribute/object/class_methods/descendants_spec.rb
215
+ - spec/unit/virtus/attribute/string_spec.rb
216
+ - spec/unit/virtus/attribute/time_spec.rb
217
+ - spec/unit/virtus/attribute_set/append_spec.rb
218
+ - spec/unit/virtus/attribute_set/each_spec.rb
219
+ - spec/unit/virtus/attribute_set/element_reference_spec.rb
220
+ - spec/unit/virtus/attribute_set/element_set_spec.rb
221
+ - spec/unit/virtus/attribute_set/merge_spec.rb
222
+ - spec/unit/virtus/attribute_set/parent_spec.rb
223
+ - spec/unit/virtus/attribute_set/reset_spec.rb
224
+ - spec/unit/virtus/class_methods/attribute_spec.rb
225
+ - spec/unit/virtus/class_methods/new_spec.rb
226
+ - spec/unit/virtus/descendants_tracker/descendants_spec.rb
227
+ - spec/unit/virtus/descendants_tracker/inherited_spec.rb
228
+ - spec/unit/virtus/determine_type_spec.rb
229
+ - spec/unit/virtus/instance_methods/attributes_spec.rb
230
+ - spec/unit/virtus/instance_methods/element_reference_spec.rb
231
+ - spec/unit/virtus/instance_methods/element_set_spec.rb