simple_objects 1.1 → 1.2

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: 82482dc1635528f6205cc3e32a9b45103bb0e877
4
- data.tar.gz: 83fafa65a3df2863bc0466ab6d3cd92e2e440fbc
3
+ metadata.gz: ab02f3893258027a87a475debc9697c1e836c85a
4
+ data.tar.gz: 320905b1909bb80dafa2b600d05ade63c6c354ec
5
5
  SHA512:
6
- metadata.gz: 028e3668de42f379beab28284abe6b98bed97e3da45446561686037f8ec6d9aaf88fde0c5c1624fbd3eeeea67021b33798466fbe3293d4e23a7a6e802edbd527
7
- data.tar.gz: 9595843730d3b0bbe30afc0ed2ec68d0ac0873e6a3c1baa929744dc06e9657d6934a61b29c9049e4778b4890383a44a2ef2ae8d78ebdc5f522c3ad9afb276942
6
+ metadata.gz: 41c14767c423c5314a87e4411d6cfda157ff34b9750afbbe1270d748fa30470470b6115fdaa1c8c21baf57268b62413120a08701e9bf8d7307ba5cb8ffc9e9c5
7
+ data.tar.gz: bc4d8ca7287430490a758ee2bd118ff1bee6372ce298567779a840dc16623dfc83bb879c8e4df47f5977b1b1493514ce40a08f5205b6060f406da35d1ec64a61
data/.gitignore CHANGED
@@ -25,7 +25,7 @@
25
25
 
26
26
  # for a library or gem, you might want to ignore these files since the code is
27
27
  # intended to run in multiple environments; otherwise, check them in:
28
- # Gemfile.lock
28
+ Gemfile.lock
29
29
  .ruby-version
30
30
  .ruby-gemset
31
31
 
@@ -20,7 +20,11 @@ module SimpleObjects
20
20
  end
21
21
 
22
22
  def attributes
23
- @attributes || {}
23
+ unless @attributes
24
+ @attributes = superclass.attributes if defined?(superclass.attributes)
25
+ @attributes ||= {}
26
+ end
27
+ @attributes
24
28
  end
25
29
  end
26
30
 
@@ -1,3 +1,3 @@
1
1
  module SimpleObjects
2
- VERSION = '1.1'
2
+ VERSION = '1.2'
3
3
  end
@@ -18,8 +18,9 @@ Gem::Specification.new do |spec|
18
18
 
19
19
  spec.add_development_dependency 'bundler', '~> 1.7'
20
20
  spec.add_development_dependency 'coveralls', '~> 0.7'
21
+ spec.add_development_dependency 'pry-byebug'
21
22
  spec.add_development_dependency 'rake', '~> 10.0'
22
- spec.add_development_dependency 'rspec', '~> 3.1'
23
- spec.add_development_dependency 'rspec-its', '~> 1.0'
23
+ spec.add_development_dependency 'rspec', '~> 3.2'
24
+ spec.add_development_dependency 'rspec-its', '~> 1.2'
24
25
  spec.add_development_dependency 'simplecov', '~> 0.9'
25
26
  end
@@ -1,18 +1,30 @@
1
1
  require 'spec_helper'
2
+ require 'pry'
2
3
 
3
4
  module SimpleObjects
4
5
  describe Attributes do
6
+ class BasicExample
7
+ include Attributes
8
+
9
+ attribute :foo
10
+ end
5
11
 
6
12
  describe '.attribute' do
7
- class BasicExample
8
- include Attributes
13
+ subject { BasicExample.new }
14
+
15
+ it { is_expected.to respond_to :foo }
9
16
 
10
- attribute :foo
17
+ it 'is inherited' do
11
18
  end
19
+ end
12
20
 
13
- subject { BasicExample.new }
21
+ context 'when inherited' do
22
+ class AnotherBasicExample < BasicExample
23
+ end
14
24
 
15
- it { is_expected.to respond_to :foo }
25
+ subject { AnotherBasicExample.attributes }
26
+
27
+ its(:size) { is_expected.to eq 1 }
16
28
  end
17
29
 
18
30
  describe '#mass_assign' do
metadata CHANGED
@@ -1,97 +1,111 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_objects
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.1'
4
+ version: '1.2'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Callan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-27 00:00:00.000000000 Z
11
+ date: 2015-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.7'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.7'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: coveralls
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0.7'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0.7'
41
+ - !ruby/object:Gem::Dependency
42
+ name: pry-byebug
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: rake
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
- - - "~>"
59
+ - - ~>
46
60
  - !ruby/object:Gem::Version
47
61
  version: '10.0'
48
62
  type: :development
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
- - - "~>"
66
+ - - ~>
53
67
  - !ruby/object:Gem::Version
54
68
  version: '10.0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: rspec
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
- - - "~>"
73
+ - - ~>
60
74
  - !ruby/object:Gem::Version
61
- version: '3.1'
75
+ version: '3.2'
62
76
  type: :development
63
77
  prerelease: false
64
78
  version_requirements: !ruby/object:Gem::Requirement
65
79
  requirements:
66
- - - "~>"
80
+ - - ~>
67
81
  - !ruby/object:Gem::Version
68
- version: '3.1'
82
+ version: '3.2'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: rspec-its
71
85
  requirement: !ruby/object:Gem::Requirement
72
86
  requirements:
73
- - - "~>"
87
+ - - ~>
74
88
  - !ruby/object:Gem::Version
75
- version: '1.0'
89
+ version: '1.2'
76
90
  type: :development
77
91
  prerelease: false
78
92
  version_requirements: !ruby/object:Gem::Requirement
79
93
  requirements:
80
- - - "~>"
94
+ - - ~>
81
95
  - !ruby/object:Gem::Version
82
- version: '1.0'
96
+ version: '1.2'
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: simplecov
85
99
  requirement: !ruby/object:Gem::Requirement
86
100
  requirements:
87
- - - "~>"
101
+ - - ~>
88
102
  - !ruby/object:Gem::Version
89
103
  version: '0.9'
90
104
  type: :development
91
105
  prerelease: false
92
106
  version_requirements: !ruby/object:Gem::Requirement
93
107
  requirements:
94
- - - "~>"
108
+ - - ~>
95
109
  - !ruby/object:Gem::Version
96
110
  version: '0.9'
97
111
  description:
@@ -101,8 +115,8 @@ executables: []
101
115
  extensions: []
102
116
  extra_rdoc_files: []
103
117
  files:
104
- - ".gitignore"
105
- - ".travis.yml"
118
+ - .gitignore
119
+ - .travis.yml
106
120
  - Gemfile
107
121
  - LICENSE
108
122
  - README.md
@@ -131,17 +145,17 @@ require_paths:
131
145
  - lib
132
146
  required_ruby_version: !ruby/object:Gem::Requirement
133
147
  requirements:
134
- - - ">="
148
+ - - '>='
135
149
  - !ruby/object:Gem::Version
136
150
  version: '0'
137
151
  required_rubygems_version: !ruby/object:Gem::Requirement
138
152
  requirements:
139
- - - ">="
153
+ - - '>='
140
154
  - !ruby/object:Gem::Version
141
155
  version: '0'
142
156
  requirements: []
143
157
  rubyforge_project:
144
- rubygems_version: 2.4.5
158
+ rubygems_version: 2.0.14
145
159
  signing_key:
146
160
  specification_version: 4
147
161
  summary: Simple objects for Ruby