spigot 0.2.2 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +5 -3
- data/Rakefile +1 -5
- data/examples/active_record.rb +18 -28
- data/examples/model.rb +4 -4
- data/examples/multi_resource.rb +61 -0
- data/lib/spigot.rb +11 -7
- data/lib/spigot/active_record.rb +28 -33
- data/lib/spigot/base.rb +5 -12
- data/lib/spigot/configuration.rb +1 -1
- data/lib/spigot/map/base.rb +4 -5
- data/lib/spigot/map/definition.rb +19 -9
- data/lib/spigot/map/option.rb +1 -13
- data/lib/spigot/map/resource.rb +11 -6
- data/lib/spigot/map/service.rb +5 -5
- data/lib/spigot/patch.rb +5 -5
- data/lib/spigot/proxy.rb +32 -20
- data/lib/spigot/record.rb +40 -13
- data/lib/spigot/translator.rb +27 -43
- data/lib/spigot/version.rb +2 -1
- data/script/active_record.rb +35 -0
- data/script/console.rb +19 -2
- data/spec/fixtures/data/active_user.rb +2 -4
- data/spec/fixtures/data/post.rb +1 -5
- data/spec/fixtures/data/user.rb +5 -5
- data/spec/fixtures/mappings/active_user_map.rb +11 -5
- data/spec/fixtures/mappings/post_map.rb +6 -18
- data/spec/fixtures/mappings/user_map.rb +1 -5
- data/spec/spec_helper.rb +13 -6
- data/spec/spigot/active_record_spec.rb +12 -5
- data/spec/spigot/base_spec.rb +2 -14
- data/spec/spigot/configuration_spec.rb +7 -7
- data/spec/spigot/map/base_spec.rb +12 -6
- data/spec/spigot/map/definition_spec.rb +51 -4
- data/spec/spigot/map/resource_spec.rb +4 -4
- data/spec/spigot/map/service_spec.rb +19 -14
- data/spec/spigot/patch_spec.rb +12 -0
- data/spec/spigot/proxy_spec.rb +17 -17
- data/spec/spigot/record_spec.rb +75 -4
- data/spec/spigot/spigot_spec.rb +9 -4
- data/spec/spigot/translator_spec.rb +86 -87
- data/spigot.gemspec +9 -10
- metadata +33 -47
- data/lib/spigot/config/spigot/github.yml +0 -7
- data/spec/support/active_record.rb +0 -15
@@ -2,15 +2,15 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe Spigot::Translator do
|
4
4
|
context '#initialize' do
|
5
|
-
before{ Spigot::Mapping::User.basic }
|
5
|
+
before { Spigot::Mapping::User.basic }
|
6
6
|
it 'does not require a service' do
|
7
|
-
expect{
|
7
|
+
expect {
|
8
8
|
Spigot::Translator.new(Struct, nil)
|
9
9
|
}.to_not raise_error(Spigot::InvalidServiceError)
|
10
10
|
end
|
11
11
|
|
12
12
|
it 'requires a resource' do
|
13
|
-
expect{
|
13
|
+
expect {
|
14
14
|
Spigot::Translator.new(nil, :github)
|
15
15
|
}.to raise_error(Spigot::InvalidResourceError)
|
16
16
|
end
|
@@ -22,20 +22,11 @@ describe Spigot::Translator do
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
context '.id' do
|
26
|
-
let(:subject){ Spigot::Translator.new(User.new, :github, Spigot::Data::User.basic) }
|
27
|
-
before{ Spigot::Mapping::User.basic }
|
28
|
-
it 'returns the value at the foreign_key' do
|
29
|
-
subject.stubs(:foreign_key).returns('id')
|
30
|
-
subject.id.should eq('123')
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
25
|
context '.format' do
|
35
26
|
context 'with a missing resource map' do
|
36
|
-
let(:subject){ Spigot::Translator.new(User.new, :github, Spigot::Data::User.basic) }
|
27
|
+
let(:subject) { Spigot::Translator.new(User.new, :github, Spigot::Data::User.basic) }
|
37
28
|
it 'raises error with a missing resource map' do
|
38
|
-
expect{
|
29
|
+
expect {
|
39
30
|
subject.format
|
40
31
|
}.to raise_error(Spigot::MissingResourceError)
|
41
32
|
end
|
@@ -43,23 +34,23 @@ describe Spigot::Translator do
|
|
43
34
|
|
44
35
|
context 'with a valid resource map' do
|
45
36
|
context 'with a simple map' do
|
46
|
-
let(:data){ Spigot::Data::User.basic }
|
47
|
-
let(:subject){ Spigot::Translator.new(User.new, :github, data) }
|
48
|
-
before{ Spigot::Mapping::User.basic }
|
37
|
+
let(:data) { Spigot::Data::User.basic }
|
38
|
+
let(:subject) { Spigot::Translator.new(User.new, :github, data) }
|
39
|
+
before { Spigot::Mapping::User.basic }
|
49
40
|
it 'returns empty hash from nil data' do
|
50
41
|
subject.data = {}
|
51
|
-
expect(subject.format).to eq(
|
42
|
+
expect(subject.format).to eq(name: nil, username: nil)
|
52
43
|
end
|
53
44
|
|
54
45
|
it 'reads one layer' do
|
55
|
-
expect(subject.format).to eq(
|
46
|
+
expect(subject.format).to eq(name: 'Dean Martin', username: 'classyasfuck')
|
56
47
|
end
|
57
48
|
end
|
58
49
|
|
59
50
|
context 'with a nested map' do
|
60
|
-
let(:data){ Spigot::Data::User.nested }
|
61
|
-
let(:subject){ Spigot::Translator.new(User.new, :github, data) }
|
62
|
-
before{ Spigot::Mapping::User.nested }
|
51
|
+
let(:data) { Spigot::Data::User.nested }
|
52
|
+
let(:subject) { Spigot::Translator.new(User.new, :github, data) }
|
53
|
+
before { Spigot::Mapping::User.nested }
|
63
54
|
|
64
55
|
it 'traverses into the nested hash' do
|
65
56
|
expect(subject.format).to eq({
|
@@ -70,15 +61,15 @@ describe Spigot::Translator do
|
|
70
61
|
end
|
71
62
|
end
|
72
63
|
|
73
|
-
context
|
74
|
-
let(:data){Spigot::Data::User.double_nested}
|
75
|
-
let(:subject){Spigot::Translator.new(User.new, :github, data)}
|
76
|
-
before{ Spigot::Mapping::User.nested_twice }
|
64
|
+
context 'nested twice' do
|
65
|
+
let(:data) { Spigot::Data::User.double_nested }
|
66
|
+
let(:subject) { Spigot::Translator.new(User.new, :github, data) }
|
67
|
+
before { Spigot::Mapping::User.nested_twice }
|
77
68
|
|
78
69
|
it 'traverses multiple levels' do
|
79
70
|
expect(subject.format).to eq({
|
80
71
|
name: 'Dean Martin',
|
81
|
-
ip:
|
72
|
+
ip: '127.0.0.1',
|
82
73
|
username: 'classyasfuck',
|
83
74
|
contact: 'dino@amore.io'
|
84
75
|
})
|
@@ -86,36 +77,39 @@ describe Spigot::Translator do
|
|
86
77
|
end
|
87
78
|
|
88
79
|
context 'with an array of values' do
|
89
|
-
let(:data){Spigot::Data::User.array}
|
90
|
-
let(:subject){Spigot::Translator.new(User.new, :github, data)}
|
91
|
-
before{ Spigot::Mapping::User.basic }
|
80
|
+
let(:data) { Spigot::Data::User.array }
|
81
|
+
let(:subject) { Spigot::Translator.new(User.new, :github, data) }
|
82
|
+
before { Spigot::Mapping::User.basic }
|
92
83
|
|
93
84
|
it 'returns an array of formatted data' do
|
94
85
|
subject.format.should eq([
|
95
|
-
{name:
|
96
|
-
{name:
|
86
|
+
{ name: 'Dean Martin', username: 'classyasfuck' },
|
87
|
+
{ name: 'Frank Sinatra', username: 'livetilidie' }
|
97
88
|
])
|
98
89
|
end
|
99
90
|
end
|
100
91
|
|
101
92
|
context 'with a nested array of values' do
|
102
|
-
let(:data){ Spigot::Data::User.nested_array }
|
103
|
-
let(:subject){Spigot::Translator.new(User.new, :github, data)}
|
104
|
-
before{ Spigot::Mapping::User.nested_array }
|
93
|
+
let(:data) { Spigot::Data::User.nested_array }
|
94
|
+
let(:subject) { Spigot::Translator.new(User.new, :github, data) }
|
95
|
+
before { Spigot::Mapping::User.nested_array }
|
105
96
|
|
106
97
|
it 'handles a nested array of values' do
|
107
98
|
subject.format.should eq({
|
108
99
|
name: 'Rockafella',
|
109
100
|
user_count: 2,
|
110
|
-
users: [
|
101
|
+
users: [
|
102
|
+
{ name: 'Dean Martin', username: 'classyasfuck' },
|
103
|
+
{ name: 'Frank Sinatra', username: 'livetilidie' }
|
104
|
+
]
|
111
105
|
})
|
112
106
|
end
|
113
107
|
end
|
114
108
|
|
115
109
|
context 'with a namedspaced resource' do
|
116
|
-
let(:data){ Spigot::Data::Post.basic }
|
117
|
-
let(:subject){Spigot::Translator.new(Wrapper::Post.new, :github, data)}
|
118
|
-
before{ Spigot::Mapping::Post.basic }
|
110
|
+
let(:data) { Spigot::Data::Post.basic }
|
111
|
+
let(:subject) { Spigot::Translator.new(Wrapper::Post.new, :github, data) }
|
112
|
+
before { Spigot::Mapping::Post.basic }
|
119
113
|
|
120
114
|
it 'accesses the wrapper/post key' do
|
121
115
|
subject.format.should eq({
|
@@ -126,29 +120,30 @@ describe Spigot::Translator do
|
|
126
120
|
end
|
127
121
|
|
128
122
|
context 'with an interpolated value' do
|
129
|
-
let(:data){ Spigot::Data::User.basic }
|
130
|
-
let(:subject){ Spigot::Translator.new(User.new, :github, data) }
|
131
|
-
before{ Spigot::Mapping::User.interpolated }
|
123
|
+
let(:data) { Spigot::Data::User.basic }
|
124
|
+
let(:subject) { Spigot::Translator.new(User.new, :github, data) }
|
125
|
+
before { Spigot::Mapping::User.interpolated }
|
132
126
|
it 'reads one layer' do
|
133
|
-
expect(subject.format).to eq(
|
127
|
+
expect(subject.format).to eq(name: 'Dean Martin', username: '@classyasfuck')
|
134
128
|
end
|
135
129
|
end
|
136
130
|
|
137
131
|
context 'with a nested interpolated value' do
|
138
|
-
let(:data){ Spigot::Data::User.nested }
|
139
|
-
let(:subject){ Spigot::Translator.new(User.new, :github, data) }
|
140
|
-
before{ Spigot::Mapping::User.nested_interpolation }
|
132
|
+
let(:data) { Spigot::Data::User.nested }
|
133
|
+
let(:subject) { Spigot::Translator.new(User.new, :github, data) }
|
134
|
+
before { Spigot::Mapping::User.nested_interpolation }
|
141
135
|
it 'reads one layer' do
|
142
|
-
|
136
|
+
result = { name: 'Dean Martin', contact: 'dino@amore.io', username: '@classyasfuck' }
|
137
|
+
expect(subject.format).to eq(result)
|
143
138
|
end
|
144
139
|
end
|
145
140
|
|
146
141
|
context 'without a service' do
|
147
|
-
let(:data){ Spigot::Data::User.basic }
|
148
|
-
let(:subject){ Spigot::Translator.new(User.new, nil, data) }
|
149
|
-
before{ Spigot::Mapping::User.serviceless }
|
142
|
+
let(:data) { Spigot::Data::User.basic }
|
143
|
+
let(:subject) { Spigot::Translator.new(User.new, nil, data) }
|
144
|
+
before { Spigot::Mapping::User.serviceless }
|
150
145
|
it 'reads one layer' do
|
151
|
-
expect(subject.format).to eq(
|
146
|
+
expect(subject.format).to eq(name: 'Dean Martin', username: 'classyasfuck')
|
152
147
|
end
|
153
148
|
|
154
149
|
it 'does not use the any definition with an invalid service' do
|
@@ -160,96 +155,100 @@ describe Spigot::Translator do
|
|
160
155
|
end
|
161
156
|
|
162
157
|
context 'multiple resources without a service' do
|
163
|
-
before{ Spigot::Mapping::User.multiple_serviceless }
|
158
|
+
before { Spigot::Mapping::User.multiple_serviceless }
|
164
159
|
it 'reads one layer' do
|
165
160
|
user = Spigot::Translator.new(User.new, nil, Spigot::Data::User.basic)
|
166
161
|
post = Spigot::Translator.new(Post.new, nil, Spigot::Data::Post.basic)
|
167
162
|
|
168
|
-
expect(user.format).to eq(
|
169
|
-
expect(post.format).to eq(
|
163
|
+
expect(user.format).to eq(name: 'Dean Martin', username: 'classyasfuck')
|
164
|
+
expect(post.format).to eq(headline: 'Brief Article', body: 'lorem ipsum')
|
170
165
|
end
|
171
166
|
end
|
172
167
|
|
173
168
|
context 'with and without service' do
|
174
|
-
before{ Spigot::Mapping::User.service_and_serviceless }
|
169
|
+
before { Spigot::Mapping::User.service_and_serviceless }
|
175
170
|
it 'prefers the service definition' do
|
176
171
|
service = Spigot::Translator.new(User.new, :github, Spigot::Data::User.basic)
|
177
172
|
no_service = Spigot::Translator.new(User.new, nil, Spigot::Data::User.basic)
|
178
173
|
|
179
|
-
expect(service.format).to eq(
|
180
|
-
expect(no_service.format).to eq(
|
174
|
+
expect(service.format).to eq(name: 'classyasfuck', username: 'Dean Martin')
|
175
|
+
expect(no_service.format).to eq(name: 'Dean Martin', username: 'classyasfuck')
|
181
176
|
end
|
182
177
|
end
|
183
178
|
|
184
179
|
context 'with an abridged definition' do
|
185
|
-
let(:data){ Spigot::Data::User.basic }
|
186
|
-
let(:subject){ Spigot::Translator.new(User.new, nil, data) }
|
187
|
-
before{ Spigot::Mapping::User.abridged }
|
180
|
+
let(:data) { Spigot::Data::User.basic }
|
181
|
+
let(:subject) { Spigot::Translator.new(User.new, nil, data) }
|
182
|
+
before { Spigot::Mapping::User.abridged }
|
188
183
|
it 'reads one layer' do
|
189
|
-
expect(subject.format).to eq(
|
184
|
+
expect(subject.format).to eq(name: 'Dean Martin', username: 'classyasfuck')
|
190
185
|
end
|
191
186
|
end
|
192
187
|
end
|
193
188
|
end
|
194
189
|
|
195
|
-
context '#lookup' do
|
196
|
-
let(:subject){Spigot::Translator.new(User.new, :github, {a: '1'})}
|
197
|
-
|
198
|
-
it 'returns the value at a given key' do
|
199
|
-
subject.lookup(:a).should eq('1')
|
200
|
-
end
|
201
|
-
end
|
202
|
-
|
203
190
|
context '#conditions' do
|
204
|
-
let(:data){ Spigot::Data::User.basic }
|
205
|
-
let(:subject){Spigot::Translator.new(User.new, :github, data)}
|
191
|
+
let(:data) { Spigot::Data::User.basic }
|
192
|
+
let(:subject) { Spigot::Translator.new(User.new, :github, data) }
|
206
193
|
|
207
194
|
context 'without conditions specified' do
|
208
|
-
before{ Spigot::Mapping::User.basic }
|
195
|
+
before { Spigot::Mapping::User.basic }
|
209
196
|
it 'should return a hash' do
|
210
|
-
subject.conditions.should eq(
|
197
|
+
subject.conditions.should eq('github_id' => nil)
|
211
198
|
end
|
212
199
|
end
|
213
200
|
|
214
201
|
context 'with conditions specified' do
|
215
|
-
before{ Spigot::Mapping::User.with_conditions }
|
202
|
+
before { Spigot::Mapping::User.with_conditions }
|
216
203
|
it 'can specify the keys used in the map options' do
|
217
|
-
subject.conditions.should eq(
|
204
|
+
subject.conditions.should eq(username: 'classyasfuck')
|
218
205
|
end
|
219
206
|
|
220
207
|
it 'can specify only one key' do
|
221
|
-
subject.conditions.should eq(
|
208
|
+
subject.conditions.should eq(username: 'classyasfuck')
|
209
|
+
end
|
210
|
+
|
211
|
+
context 'with an array of data' do
|
212
|
+
let(:data) { Spigot::Data::User.array }
|
213
|
+
let(:subject) { Spigot::Translator.new(User.new, :github, data) }
|
214
|
+
it 'can specify an array of values' do
|
215
|
+
subject.conditions.should eq(username: %w(classyasfuck livetilidie))
|
216
|
+
end
|
222
217
|
end
|
223
218
|
end
|
224
219
|
end
|
225
220
|
|
226
221
|
context '#options' do
|
227
|
-
let(:subject){ Spigot::Translator.new(User.new, :github,
|
222
|
+
let(:subject) { Spigot::Translator.new(User.new, :github, remote_id: '987') }
|
228
223
|
|
229
224
|
context 'without options provided' do
|
230
|
-
before{ Spigot::Mapping::User.basic }
|
225
|
+
before { Spigot::Mapping::User.basic }
|
231
226
|
it '#primary_key is the name of the service_id' do
|
232
227
|
subject.primary_key.should eq('github_id')
|
233
228
|
end
|
234
|
-
|
235
|
-
it '#foreign_key is id' do
|
236
|
-
subject.foreign_key.should eq('id')
|
237
|
-
end
|
238
229
|
end
|
239
230
|
|
240
231
|
context 'with options provided' do
|
241
|
-
before{ Spigot::Mapping::User.with_options }
|
232
|
+
before { Spigot::Mapping::User.with_options }
|
242
233
|
it 'reads a primary key from the mapping' do
|
243
234
|
subject.primary_key.should eq(:username)
|
244
235
|
end
|
245
236
|
|
246
|
-
it 'reads a foreign key from the mapping' do
|
247
|
-
subject.foreign_key.should eq(:login)
|
248
|
-
end
|
249
|
-
|
250
237
|
it 'reads options' do
|
251
238
|
subject.options.should be_a_kind_of(Spigot::Map::Option)
|
252
239
|
end
|
253
240
|
end
|
254
241
|
end
|
242
|
+
|
243
|
+
context '#resource_map' do
|
244
|
+
let(:subject) { Spigot::Translator.new(User.new) }
|
245
|
+
context 'without a service' do
|
246
|
+
before { Spigot::Mapping::User.basic }
|
247
|
+
it 'raises a missing resource error' do
|
248
|
+
expect {
|
249
|
+
subject.resource_map
|
250
|
+
}.to raise_error(Spigot::MissingResourceError)
|
251
|
+
end
|
252
|
+
end
|
253
|
+
end
|
255
254
|
end
|
data/spigot.gemspec
CHANGED
@@ -9,21 +9,20 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["Matthew Werner"]
|
10
10
|
spec.email = ["m@mjw.io"]
|
11
11
|
spec.description = %q{Spigot provides a clean interface translating API data into context relevant objects}
|
12
|
-
spec.summary =
|
13
|
-
spec.homepage = "http://github.
|
12
|
+
spec.summary = 'Spigot is a tool to parse and format data for the creation of ruby objects'
|
13
|
+
spec.homepage = "http://mwerner.github.io/spigot/"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files`.split($/)
|
17
17
|
spec.test_files = Dir.glob("spec/**/*")
|
18
18
|
spec.require_paths = ["lib"]
|
19
19
|
|
20
|
-
spec.add_dependency 'activerecord'
|
20
|
+
spec.add_dependency 'activerecord', '~> 3.0'
|
21
21
|
|
22
|
-
spec.add_development_dependency "bundler",
|
23
|
-
spec.add_development_dependency "rake"
|
24
|
-
spec.add_development_dependency "hashie"
|
25
|
-
spec.add_development_dependency "simplecov"
|
26
|
-
spec.add_development_dependency "rspec"
|
27
|
-
spec.add_development_dependency "
|
28
|
-
spec.add_development_dependency "sqlite3"
|
22
|
+
spec.add_development_dependency "bundler", '~> 1.3'
|
23
|
+
spec.add_development_dependency "rake", '~> 10.0'
|
24
|
+
spec.add_development_dependency "hashie", '~> 2.0'
|
25
|
+
spec.add_development_dependency "simplecov", '~> 0.7'
|
26
|
+
spec.add_development_dependency "rspec", '~> 2.13'
|
27
|
+
spec.add_development_dependency "sqlite3", '~> 1.3'
|
29
28
|
end
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spigot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Werner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
19
|
+
version: '3.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
26
|
+
version: '3.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -42,86 +42,72 @@ dependencies:
|
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
47
|
+
version: '10.0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
54
|
+
version: '10.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: hashie
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
61
|
+
version: '2.0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ~>
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
68
|
+
version: '2.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: simplecov
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ~>
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
75
|
+
version: '0.7'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ~>
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
82
|
+
version: '0.7'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rspec
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - '>='
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: mocha
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - '>='
|
87
|
+
- - ~>
|
102
88
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
89
|
+
version: '2.13'
|
104
90
|
type: :development
|
105
91
|
prerelease: false
|
106
92
|
version_requirements: !ruby/object:Gem::Requirement
|
107
93
|
requirements:
|
108
|
-
- -
|
94
|
+
- - ~>
|
109
95
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
96
|
+
version: '2.13'
|
111
97
|
- !ruby/object:Gem::Dependency
|
112
98
|
name: sqlite3
|
113
99
|
requirement: !ruby/object:Gem::Requirement
|
114
100
|
requirements:
|
115
|
-
- -
|
101
|
+
- - ~>
|
116
102
|
- !ruby/object:Gem::Version
|
117
|
-
version: '
|
103
|
+
version: '1.3'
|
118
104
|
type: :development
|
119
105
|
prerelease: false
|
120
106
|
version_requirements: !ruby/object:Gem::Requirement
|
121
107
|
requirements:
|
122
|
-
- -
|
108
|
+
- - ~>
|
123
109
|
- !ruby/object:Gem::Version
|
124
|
-
version: '
|
110
|
+
version: '1.3'
|
125
111
|
description: Spigot provides a clean interface translating API data into context relevant
|
126
112
|
objects
|
127
113
|
email:
|
@@ -137,10 +123,10 @@ files:
|
|
137
123
|
- Rakefile
|
138
124
|
- examples/active_record.rb
|
139
125
|
- examples/model.rb
|
126
|
+
- examples/multi_resource.rb
|
140
127
|
- lib/spigot.rb
|
141
128
|
- lib/spigot/active_record.rb
|
142
129
|
- lib/spigot/base.rb
|
143
|
-
- lib/spigot/config/spigot/github.yml
|
144
130
|
- lib/spigot/configuration.rb
|
145
131
|
- lib/spigot/errors.rb
|
146
132
|
- lib/spigot/map/base.rb
|
@@ -153,6 +139,7 @@ files:
|
|
153
139
|
- lib/spigot/record.rb
|
154
140
|
- lib/spigot/translator.rb
|
155
141
|
- lib/spigot/version.rb
|
142
|
+
- script/active_record.rb
|
156
143
|
- script/console.rb
|
157
144
|
- spec/fixtures/data/active_user.rb
|
158
145
|
- spec/fixtures/data/post.rb
|
@@ -168,13 +155,13 @@ files:
|
|
168
155
|
- spec/spigot/map/definition_spec.rb
|
169
156
|
- spec/spigot/map/resource_spec.rb
|
170
157
|
- spec/spigot/map/service_spec.rb
|
158
|
+
- spec/spigot/patch_spec.rb
|
171
159
|
- spec/spigot/proxy_spec.rb
|
172
160
|
- spec/spigot/record_spec.rb
|
173
161
|
- spec/spigot/spigot_spec.rb
|
174
162
|
- spec/spigot/translator_spec.rb
|
175
|
-
- spec/support/active_record.rb
|
176
163
|
- spigot.gemspec
|
177
|
-
homepage: http://github.
|
164
|
+
homepage: http://mwerner.github.io/spigot/
|
178
165
|
licenses:
|
179
166
|
- MIT
|
180
167
|
metadata: {}
|
@@ -194,11 +181,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
194
181
|
version: '0'
|
195
182
|
requirements: []
|
196
183
|
rubyforge_project:
|
197
|
-
rubygems_version: 2.
|
184
|
+
rubygems_version: 2.2.1
|
198
185
|
signing_key:
|
199
186
|
specification_version: 4
|
200
|
-
summary: Spigot
|
201
|
-
objects
|
187
|
+
summary: Spigot is a tool to parse and format data for the creation of ruby objects
|
202
188
|
test_files:
|
203
189
|
- spec/fixtures/data/active_user.rb
|
204
190
|
- spec/fixtures/data/post.rb
|
@@ -214,8 +200,8 @@ test_files:
|
|
214
200
|
- spec/spigot/map/definition_spec.rb
|
215
201
|
- spec/spigot/map/resource_spec.rb
|
216
202
|
- spec/spigot/map/service_spec.rb
|
203
|
+
- spec/spigot/patch_spec.rb
|
217
204
|
- spec/spigot/proxy_spec.rb
|
218
205
|
- spec/spigot/record_spec.rb
|
219
206
|
- spec/spigot/spigot_spec.rb
|
220
207
|
- spec/spigot/translator_spec.rb
|
221
|
-
- spec/support/active_record.rb
|