to_api 1.1.4 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.ruby-version +1 -0
- data/Gemfile +2 -2
- data/README.md +24 -18
- data/lib/to_api/version.rb +1 -1
- data/lib/to_api.rb +24 -19
- data/spec/spec_helper.rb +44 -1
- data/spec/to_api_spec.rb +106 -87
- data/to_api.gemspec +7 -4
- metadata +42 -15
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.9.3-p448
|
data/Gemfile
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
source
|
1
|
+
source "https://rubygems.org"
|
2
2
|
|
3
|
-
gemspec
|
3
|
+
gemspec
|
data/README.md
CHANGED
@@ -10,39 +10,45 @@ Models shouldn't know about formats. Controllers shouldn't know what attributes
|
|
10
10
|
|
11
11
|
### How do I use it?
|
12
12
|
|
13
|
-
Implement to_api on your data objects to return a hash with all needed attributes.
|
13
|
+
Implement `to_api` on your data objects to return a hash with all needed attributes.
|
14
14
|
|
15
|
-
|
16
|
-
|
15
|
+
```ruby
|
16
|
+
class Person
|
17
|
+
attr_accessor :first_name, :last_name, :secret
|
17
18
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
19
|
+
def to_api
|
20
|
+
{:first_name => @first_name, :last_name => @last_name}.to_api
|
21
|
+
end
|
22
|
+
end
|
22
23
|
|
23
|
-
|
24
|
-
|
24
|
+
class Group
|
25
|
+
attr_accessor :name, :description, :people
|
25
26
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
27
|
+
def to_api
|
28
|
+
{:name => @name, :description => @description, :people => @people}.to_api
|
29
|
+
end
|
30
|
+
end
|
31
|
+
```
|
30
32
|
|
31
33
|
Now just call your to\_api method. You'll get back a hash of arrays, hashes, strings, numbers, and nil. All of these are very easily converted to a format of your choice.
|
32
34
|
|
33
|
-
|
35
|
+
```ruby
|
36
|
+
JSON.generate(group.to_api)
|
37
|
+
```
|
34
38
|
|
35
|
-
### If I have to implement
|
39
|
+
### If I have to implement `to_api`, what does the gem do for me?
|
36
40
|
|
37
|
-
The gem provides
|
41
|
+
The gem provides `to_api` for common Ruby classes, allowing simple conversion to JSON, XML, YAML, etc. Hash and Enumerable transform all their contents, allowing your data objects to simply call `to_api` on a hash of relevant attributes.
|
38
42
|
|
39
43
|
Fixnum, String, DateTime, Symbol, and NilClass are also provided.
|
40
44
|
|
41
45
|
### What about Ruby on Rails?
|
42
46
|
|
43
|
-
If ActiveRecord is present, ActiveRecord::Base#
|
47
|
+
If ActiveRecord is present, `ActiveRecord::Base#to_api` transforms and returns the attributes hash. It also supports an `:includes` option that mirrors the ActiveRecord finder usage.
|
44
48
|
|
45
|
-
|
49
|
+
```ruby
|
50
|
+
person.to_api([{:groups => :members}, :interests])
|
51
|
+
```
|
46
52
|
|
47
53
|
### What if I need support for other common classes?
|
48
54
|
|
data/lib/to_api/version.rb
CHANGED
data/lib/to_api.rb
CHANGED
@@ -10,7 +10,7 @@ end
|
|
10
10
|
module ToApiInstanceMethods
|
11
11
|
def build_to_api_include_hash(*includes)
|
12
12
|
include_hash = {}
|
13
|
-
includes.each do |i|
|
13
|
+
includes.each do |i|
|
14
14
|
if i.kind_of?(Hash)
|
15
15
|
i.each do |k,v|
|
16
16
|
include_hash[k] = v
|
@@ -34,10 +34,13 @@ module ToApiFilter
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def to_api_filters
|
37
|
-
|
38
|
-
|
37
|
+
if frozen?
|
38
|
+
@_to_api_filters || {}
|
39
|
+
else
|
40
|
+
@_to_api_filters ||= {}
|
41
|
+
end
|
39
42
|
end
|
40
|
-
end
|
43
|
+
end
|
41
44
|
|
42
45
|
if Object.const_defined? :ActiveRecord
|
43
46
|
|
@@ -47,8 +50,8 @@ if Object.const_defined? :ActiveRecord
|
|
47
50
|
def to_api(*includes) #assumes all attribute types are fine
|
48
51
|
hash = {}
|
49
52
|
valid_includes = (self.class.reflect_on_all_associations.map(&:name).map(&:to_s) | self.valid_api_includes | self.attributes.keys)
|
50
|
-
|
51
|
-
include_hash = build_to_api_ar_include_hash(*includes)
|
53
|
+
|
54
|
+
include_hash = build_to_api_ar_include_hash(*includes)
|
52
55
|
include_hash.keys.each do |inc|
|
53
56
|
if to_api_filters.has_key?(inc)
|
54
57
|
child_includes = include_hash.delete(inc) || []
|
@@ -62,7 +65,7 @@ if Object.const_defined? :ActiveRecord
|
|
62
65
|
v.to_api_filters = to_api_filters if v.respond_to? :to_api_filters
|
63
66
|
|
64
67
|
attribute_includes = include_hash[k] || []
|
65
|
-
to_api_v = v.to_api(*[attribute_includes].flatten.compact)
|
68
|
+
to_api_v = v.to_api(*[attribute_includes].flatten.compact)
|
66
69
|
hash[k] = to_api_v
|
67
70
|
end
|
68
71
|
end
|
@@ -76,7 +79,7 @@ if Object.const_defined? :ActiveRecord
|
|
76
79
|
hash[relation.to_s] = api_obj.respond_to?(:to_api) ? api_obj.to_api(*[relation_includes].flatten.compact) : api_obj
|
77
80
|
end
|
78
81
|
end
|
79
|
-
|
82
|
+
|
80
83
|
hash
|
81
84
|
end
|
82
85
|
|
@@ -92,7 +95,7 @@ if Object.const_defined? :ActiveRecord
|
|
92
95
|
private
|
93
96
|
def build_to_api_ar_include_hash(*includes)
|
94
97
|
include_hash = {}
|
95
|
-
includes.each do |i|
|
98
|
+
includes.each do |i|
|
96
99
|
if i.kind_of?(Hash)
|
97
100
|
i.each do |k,v|
|
98
101
|
include_hash[k.to_s] = v
|
@@ -106,14 +109,16 @@ if Object.const_defined? :ActiveRecord
|
|
106
109
|
|
107
110
|
end
|
108
111
|
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
e
|
115
|
-
|
116
|
-
|
112
|
+
if defined?(ActiveRecord::NamedScope)
|
113
|
+
#Sadly, Scope isn't enumerable
|
114
|
+
class ActiveRecord::NamedScope::Scope
|
115
|
+
include ToApiFilter
|
116
|
+
def to_api(*includes)
|
117
|
+
map{|e|
|
118
|
+
e.to_api_filters = to_api_filters if e.respond_to? :to_api_filters
|
119
|
+
e.to_api(*includes)
|
120
|
+
}
|
121
|
+
end
|
117
122
|
end
|
118
123
|
end
|
119
124
|
end
|
@@ -135,8 +140,8 @@ class Hash
|
|
135
140
|
def to_api(*includes)
|
136
141
|
values = {}
|
137
142
|
|
138
|
-
include_hash = build_to_api_include_hash(*includes)
|
139
|
-
|
143
|
+
include_hash = build_to_api_include_hash(*includes)
|
144
|
+
|
140
145
|
include_hash.keys.each do |inc|
|
141
146
|
if to_api_filters.has_key?(inc)
|
142
147
|
child_includes = include_hash[inc]
|
data/spec/spec_helper.rb
CHANGED
@@ -1,5 +1,48 @@
|
|
1
1
|
require "rubygems"
|
2
2
|
require "bundler/setup"
|
3
|
-
require '
|
3
|
+
require 'rspec'
|
4
4
|
require 'active_record'
|
5
|
+
require 'pry'
|
5
6
|
require 'to_api'
|
7
|
+
|
8
|
+
ActiveRecord::Base.establish_connection(
|
9
|
+
:adapter => 'sqlite3',
|
10
|
+
:database => ':memory:'
|
11
|
+
)
|
12
|
+
|
13
|
+
ActiveRecord::Schema.define do
|
14
|
+
self.verbose = false
|
15
|
+
|
16
|
+
create_table :fake_records, :force => true do |t|
|
17
|
+
t.integer :age
|
18
|
+
t.string :my_field
|
19
|
+
t.integer :associated_record_id
|
20
|
+
t.integer :other_record_id
|
21
|
+
t.integer :group_id
|
22
|
+
end
|
23
|
+
|
24
|
+
create_table :associated_records, :force => true do |t|
|
25
|
+
t.string :name
|
26
|
+
end
|
27
|
+
|
28
|
+
create_table :other_records, :force => true do |t|
|
29
|
+
t.string :description
|
30
|
+
end
|
31
|
+
|
32
|
+
create_table :groups, :force => true do |t|
|
33
|
+
t.string :group_name
|
34
|
+
end
|
35
|
+
|
36
|
+
create_table :child_records, :force => true do |t|
|
37
|
+
t.integer :fake_record_id
|
38
|
+
t.string :name
|
39
|
+
t.integer :category_id
|
40
|
+
end
|
41
|
+
|
42
|
+
create_table :categories, :force => true do |t|
|
43
|
+
t.string :name
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
RSpec.configure do |config|
|
48
|
+
end
|
data/spec/to_api_spec.rb
CHANGED
@@ -1,18 +1,36 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
class FakeRecord < ActiveRecord::Base
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
belongs_to :associated_record
|
5
|
+
belongs_to :other_record
|
6
|
+
belongs_to :group
|
7
|
+
has_many :child_records
|
8
|
+
|
9
|
+
if respond_to?(:named_scope)
|
10
|
+
named_scope :scopez, :conditions => '1=1'
|
11
|
+
else
|
12
|
+
scope :scopez, :conditions => '1=1'
|
13
|
+
end
|
14
|
+
|
15
|
+
attr_accessor :yarg
|
16
|
+
|
17
|
+
def valid_api_includes
|
18
|
+
[:associated_record, :other_record]
|
19
|
+
end
|
8
20
|
end
|
9
21
|
|
10
|
-
class
|
11
|
-
|
12
|
-
def my_field;'yar';end
|
22
|
+
class ChildRecord < ActiveRecord::Base
|
23
|
+
belongs_to :category
|
13
24
|
end
|
14
25
|
|
15
|
-
class
|
26
|
+
class AssociatedRecord < ActiveRecord::Base
|
27
|
+
end
|
28
|
+
|
29
|
+
class OtherRecord < ActiveRecord::Base
|
30
|
+
end
|
31
|
+
|
32
|
+
class Category < ActiveRecord::Base
|
33
|
+
|
16
34
|
end
|
17
35
|
|
18
36
|
describe '#to_api' do
|
@@ -25,8 +43,8 @@ describe '#to_api' do
|
|
25
43
|
describe Hash do
|
26
44
|
|
27
45
|
it "returns a new hash with all values to_api'ed" do
|
28
|
-
obj1 =
|
29
|
-
obj2 =
|
46
|
+
obj1 = double('1', :to_api => "1 to api")
|
47
|
+
obj2 = double('2', :to_api => "2 to the api")
|
30
48
|
|
31
49
|
hash = {:one => obj1, :two => obj2}
|
32
50
|
hash.to_api.should == {
|
@@ -99,7 +117,7 @@ describe '#to_api' do
|
|
99
117
|
end
|
100
118
|
end
|
101
119
|
|
102
|
-
describe Date do
|
120
|
+
describe Date do
|
103
121
|
it "returns self" do
|
104
122
|
now = Date.today
|
105
123
|
now.to_api.should == now
|
@@ -141,14 +159,10 @@ describe '#to_api' do
|
|
141
159
|
end
|
142
160
|
end
|
143
161
|
|
144
|
-
describe
|
145
|
-
it "returns to_api of
|
146
|
-
FakeRecord.
|
147
|
-
@base
|
148
|
-
@base.should_receive(:fake_child_records).and_return([{"foo" => "bar"}])
|
149
|
-
|
150
|
-
FakeRecord.stub!(:find_every => [@base])
|
151
|
-
FakeRecord.scopez.to_api("fake_child_records").should == [{"fake_child_records" => [{"foo" => "bar"}]}]
|
162
|
+
describe 'named scopes' do
|
163
|
+
it "returns to_api of the matching records" do
|
164
|
+
@base = FakeRecord.create(my_field: "Some Value")
|
165
|
+
FakeRecord.scopez.to_api.should == [@base.to_api]
|
152
166
|
end
|
153
167
|
end
|
154
168
|
|
@@ -169,7 +183,7 @@ describe '#to_api' do
|
|
169
183
|
[a].to_api(['bar']).should == [:apiz]
|
170
184
|
end
|
171
185
|
end
|
172
|
-
|
186
|
+
|
173
187
|
describe nil do
|
174
188
|
it "returns nil" do
|
175
189
|
nil.to_api.should be_nil
|
@@ -182,22 +196,26 @@ describe '#to_api' do
|
|
182
196
|
describe "with attributes" do
|
183
197
|
before do
|
184
198
|
@base = FakeRecord.new
|
185
|
-
@base.
|
199
|
+
@base.age = 95
|
200
|
+
@base.my_field = "why yes"
|
186
201
|
end
|
187
202
|
|
188
203
|
it "includes the to_api'd attributes" do
|
189
|
-
@base.to_api
|
204
|
+
result = @base.to_api
|
205
|
+
result["age"].should == 95
|
206
|
+
result["my_field"].should == "why yes"
|
190
207
|
end
|
191
208
|
end
|
192
209
|
|
193
210
|
describe "with to_api_attributes" do
|
194
211
|
before do
|
195
|
-
@base =
|
196
|
-
@base.
|
212
|
+
@base = FakeRecord.new
|
213
|
+
@base.age = 65
|
214
|
+
@base.my_field = "yar"
|
197
215
|
end
|
198
216
|
|
199
217
|
it "includes the to_api'd attributes" do
|
200
|
-
@base.to_api["age"].should ==
|
218
|
+
@base.to_api["age"].should == 65
|
201
219
|
end
|
202
220
|
|
203
221
|
it "allows the inclusion of attributes" do
|
@@ -207,83 +225,79 @@ describe '#to_api' do
|
|
207
225
|
|
208
226
|
describe "with includes" do
|
209
227
|
before do
|
210
|
-
@base = FakeRecord.new
|
211
|
-
@base.
|
212
|
-
|
213
|
-
@base.stub!(:foopy_pantz => "pantz of foop")
|
228
|
+
@base = FakeRecord.new(:my_field => "some value")
|
229
|
+
@base.save!
|
230
|
+
@associated_record = @base.create_associated_record("name" => "Joe")
|
214
231
|
end
|
215
232
|
|
216
233
|
it "includes the to_api'd attributes" do
|
217
|
-
|
234
|
+
# Without specifying an include the associated_record is not automatically included
|
235
|
+
@base.to_api["associated_record"].should be_nil
|
236
|
+
|
237
|
+
# But specify the association and it gets pulled in
|
238
|
+
@base.to_api("associated_record")["associated_record"]["name"].should == "Joe"
|
218
239
|
end
|
219
|
-
|
240
|
+
|
220
241
|
it "allows symbols" do
|
221
|
-
@base.to_api(:
|
242
|
+
@base.to_api(:associated_record)["associated_record"]["name"].should == "Joe"
|
222
243
|
end
|
223
|
-
|
244
|
+
|
224
245
|
it "ignores non association includes" do
|
225
|
-
@base.
|
246
|
+
@base.yarg = "YYYYARRGG"
|
226
247
|
@base.to_api("yarg")["yarg"].should be_nil
|
227
248
|
end
|
228
|
-
|
249
|
+
|
229
250
|
it "allows for explicitly declaring allowable includes" do
|
230
|
-
@base.
|
231
|
-
|
232
|
-
|
251
|
+
@base.to_api("associated_record")["associated_record"]["name"].should == "Joe"
|
252
|
+
|
253
|
+
# 'group' is not listed in valid_api_includes, so it won't be included even when requested
|
254
|
+
@base.to_api("group")["group"].should be_nil
|
233
255
|
end
|
234
|
-
|
256
|
+
|
235
257
|
describe "versions of params" do
|
236
|
-
|
258
|
+
|
237
259
|
before do
|
238
|
-
|
239
|
-
@child =
|
240
|
-
@child.
|
241
|
-
|
242
|
-
FakeRecord.should_receive(:reflect_on_all_associations).and_return([mock(:name => "fake_child_records"), mock(:name => "other_relation")])
|
243
|
-
@base = FakeRecord.new
|
244
|
-
|
245
|
-
@base.should_receive(:fake_child_records).and_return([@child])
|
246
|
-
@other_child = mock(:to_api => {"foo"=>"bar"})
|
260
|
+
@base = FakeRecord.create
|
261
|
+
@child = @base.child_records.create(:name => "Jane")
|
262
|
+
@child_category = @child.create_category(:name => "Child Category")
|
263
|
+
@other_record = @base.create_other_record(:description => "Some Other Record")
|
247
264
|
end
|
248
|
-
|
265
|
+
|
249
266
|
it "only passes includes to the correct objects" do
|
250
|
-
@
|
251
|
-
@base.to_api("fake_child_records","foopy_pantz").should == {"fake_child_records" => [{}]}
|
267
|
+
@base.to_api("child_records", "foo_records")["child_records"].should == [@child.to_api]
|
252
268
|
end
|
253
|
-
|
254
|
-
|
269
|
+
|
255
270
|
it "takes a single arg" do
|
256
|
-
@
|
257
|
-
|
271
|
+
result = @base.to_api("child_records")
|
272
|
+
result["child_records"].should == [@child.to_api]
|
273
|
+
result["child_records"].first["category"].should be_nil
|
274
|
+
result["other_record"].should be_nil
|
258
275
|
end
|
259
|
-
|
276
|
+
|
260
277
|
it "takes array with singles" do
|
261
|
-
@
|
262
|
-
|
278
|
+
result = @base.to_api("child_records", "other_record")
|
279
|
+
result["child_records"].should == [@child.to_api]
|
280
|
+
result["other_record"].should == @other_record.to_api
|
263
281
|
end
|
264
|
-
|
265
|
-
it "takes array with subhash" do
|
266
|
-
@
|
267
|
-
@
|
268
|
-
|
282
|
+
|
283
|
+
it "takes array with subhash and singles" do
|
284
|
+
result = @base.to_api({"child_records" => "category"}, "other_record")
|
285
|
+
result["child_records"].should == [@child.to_api("category")]
|
286
|
+
result["child_records"].first["category"]["name"].should == @child_category.name
|
287
|
+
result["other_record"].should == @other_record.to_api
|
269
288
|
end
|
270
289
|
|
271
290
|
it "takes array with subhash as symbols" do
|
272
|
-
@
|
273
|
-
@
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
it "takes array with singles and subhashes" do
|
278
|
-
@child.should_receive(:to_api).with("foopy_pantz").and_return({})
|
279
|
-
@base.to_api("fake_child_records" => "foopy_pantz").should == {"fake_child_records" => [{}]}
|
291
|
+
result = @base.to_api({:child_records => :category}, :other_record)
|
292
|
+
result["child_records"].should == [@child.to_api("category")]
|
293
|
+
result["child_records"].first["category"]["name"].should == @child_category.name
|
294
|
+
result["other_record"].should == @other_record.to_api
|
280
295
|
end
|
281
296
|
end
|
282
297
|
|
283
298
|
describe "#add_to_api_filter" do
|
284
299
|
it "adds a filter" do
|
285
|
-
@base =
|
286
|
-
@base.should_not_receive(:my_field)
|
300
|
+
@base = FakeRecord.new(:my_field => "foo")
|
287
301
|
@base.add_to_api_filter("my_field") do |parent, child_includes|
|
288
302
|
"YO-HO-HO"
|
289
303
|
end
|
@@ -292,23 +306,28 @@ describe '#to_api' do
|
|
292
306
|
end
|
293
307
|
|
294
308
|
it "sends filter to child" do
|
295
|
-
FakeRecord.
|
296
|
-
|
297
|
-
|
298
|
-
@base = FakeRecord.new
|
299
|
-
@base.stub!(:attributes => {})
|
309
|
+
@base = FakeRecord.create
|
310
|
+
@child = @base.child_records.create(:name => "Jane")
|
300
311
|
|
301
|
-
@
|
312
|
+
@base.add_to_api_filter("category") do |parent, child_includes|
|
313
|
+
"Not the real category"
|
314
|
+
end
|
302
315
|
|
303
|
-
@
|
304
|
-
|
305
|
-
|
316
|
+
result = @base.to_api("child_records" => "category")
|
317
|
+
child = result["child_records"].first
|
318
|
+
child["name"].should == @child.name
|
319
|
+
child["category"].should == "Not the real category"
|
320
|
+
end
|
306
321
|
|
307
|
-
|
308
|
-
|
309
|
-
|
322
|
+
it "doesn't blow up when a frozen object gets to_api'd" do
|
323
|
+
models = [FakeRecord.new, FakeRecord.new]
|
324
|
+
models.freeze
|
310
325
|
|
311
|
-
|
326
|
+
result = models.to_api
|
327
|
+
result.should == [
|
328
|
+
models[0].to_api,
|
329
|
+
models[1].to_api,
|
330
|
+
]
|
312
331
|
end
|
313
332
|
end
|
314
333
|
end
|
data/to_api.gemspec
CHANGED
@@ -11,15 +11,18 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.homepage = "http://github.com/atomicobject/to_api"
|
12
12
|
s.summary = %q{Helper for simplifying JSON api creation}
|
13
13
|
s.description = %q{Helper for simplifying JSON api creation.}
|
14
|
-
|
14
|
+
|
15
15
|
s.rubyforge_project = "to_api"
|
16
16
|
|
17
17
|
s.files = `git ls-files`.split("\n")
|
18
18
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
19
19
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
20
20
|
s.require_paths = ["lib"]
|
21
|
-
|
22
|
-
s.add_development_dependency "activerecord", ["
|
23
|
-
s.add_development_dependency "
|
21
|
+
|
22
|
+
s.add_development_dependency "activerecord", ["3.2.15"]
|
23
|
+
# s.add_development_dependency "activerecord", [">= 2.3", "< 3"]
|
24
|
+
s.add_development_dependency "rspec", "= 2.14.1"
|
24
25
|
s.add_development_dependency "rake", ">= 0.8.7"
|
26
|
+
s.add_development_dependency "pry"
|
27
|
+
s.add_development_dependency "sqlite3"
|
25
28
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: to_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,30 +10,24 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2013-11-26 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activerecord
|
17
17
|
requirement: !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
|
-
- -
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: '2.3'
|
23
|
-
- - <
|
20
|
+
- - '='
|
24
21
|
- !ruby/object:Gem::Version
|
25
|
-
version:
|
22
|
+
version: 3.2.15
|
26
23
|
type: :development
|
27
24
|
prerelease: false
|
28
25
|
version_requirements: !ruby/object:Gem::Requirement
|
29
26
|
none: false
|
30
27
|
requirements:
|
31
|
-
- -
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '2.3'
|
34
|
-
- - <
|
28
|
+
- - '='
|
35
29
|
- !ruby/object:Gem::Version
|
36
|
-
version:
|
30
|
+
version: 3.2.15
|
37
31
|
- !ruby/object:Gem::Dependency
|
38
32
|
name: rspec
|
39
33
|
requirement: !ruby/object:Gem::Requirement
|
@@ -41,7 +35,7 @@ dependencies:
|
|
41
35
|
requirements:
|
42
36
|
- - '='
|
43
37
|
- !ruby/object:Gem::Version
|
44
|
-
version:
|
38
|
+
version: 2.14.1
|
45
39
|
type: :development
|
46
40
|
prerelease: false
|
47
41
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -49,7 +43,7 @@ dependencies:
|
|
49
43
|
requirements:
|
50
44
|
- - '='
|
51
45
|
- !ruby/object:Gem::Version
|
52
|
-
version:
|
46
|
+
version: 2.14.1
|
53
47
|
- !ruby/object:Gem::Dependency
|
54
48
|
name: rake
|
55
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,6 +60,38 @@ dependencies:
|
|
66
60
|
- - ! '>='
|
67
61
|
- !ruby/object:Gem::Version
|
68
62
|
version: 0.8.7
|
63
|
+
- !ruby/object:Gem::Dependency
|
64
|
+
name: pry
|
65
|
+
requirement: !ruby/object:Gem::Requirement
|
66
|
+
none: false
|
67
|
+
requirements:
|
68
|
+
- - ! '>='
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0'
|
71
|
+
type: :development
|
72
|
+
prerelease: false
|
73
|
+
version_requirements: !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
75
|
+
requirements:
|
76
|
+
- - ! '>='
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '0'
|
79
|
+
- !ruby/object:Gem::Dependency
|
80
|
+
name: sqlite3
|
81
|
+
requirement: !ruby/object:Gem::Requirement
|
82
|
+
none: false
|
83
|
+
requirements:
|
84
|
+
- - ! '>='
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: '0'
|
87
|
+
type: :development
|
88
|
+
prerelease: false
|
89
|
+
version_requirements: !ruby/object:Gem::Requirement
|
90
|
+
none: false
|
91
|
+
requirements:
|
92
|
+
- - ! '>='
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '0'
|
69
95
|
description: Helper for simplifying JSON api creation.
|
70
96
|
email:
|
71
97
|
- shawn42@gmail.com
|
@@ -75,6 +101,7 @@ extensions: []
|
|
75
101
|
extra_rdoc_files: []
|
76
102
|
files:
|
77
103
|
- .gitignore
|
104
|
+
- .ruby-version
|
78
105
|
- Gemfile
|
79
106
|
- README.md
|
80
107
|
- Rakefile
|
@@ -103,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
130
|
version: '0'
|
104
131
|
requirements: []
|
105
132
|
rubyforge_project: to_api
|
106
|
-
rubygems_version: 1.8.
|
133
|
+
rubygems_version: 1.8.23
|
107
134
|
signing_key:
|
108
135
|
specification_version: 3
|
109
136
|
summary: Helper for simplifying JSON api creation
|