arrest 0.0.25 → 0.0.27
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/arrest/abstract_resource.rb +72 -27
- data/lib/arrest/attributes/has_attributes.rb +18 -3
- data/lib/arrest/attributes/has_many_attribute.rb +1 -0
- data/lib/arrest/helper/child_collection.rb +2 -2
- data/lib/arrest/http_source.rb +2 -2
- data/lib/arrest/root_resource.rb +13 -26
- data/lib/arrest/version.rb +1 -1
- data/test/has_attributed.rb +42 -0
- data/test/unit.rb +2 -3
- metadata +149 -97
@@ -19,9 +19,26 @@ module Arrest
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def self.register_resource(clazz)
|
22
|
+
@classes ||= []
|
23
|
+
@classes << clazz
|
22
24
|
send :define_method, ClassUtils.simple_name(clazz) do ||
|
23
25
|
proxy = clazz.mk_proxy(self)
|
24
|
-
|
26
|
+
proxy
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.registered_classes
|
31
|
+
@classes ||= []
|
32
|
+
@classes
|
33
|
+
end
|
34
|
+
|
35
|
+
def delete_all
|
36
|
+
self.class.registered_classes.each do |clazz|
|
37
|
+
begin
|
38
|
+
clazz.delete_all(@context)
|
39
|
+
rescue
|
40
|
+
puts "couldnt delete #{clazz.name}s"
|
41
|
+
end
|
25
42
|
end
|
26
43
|
end
|
27
44
|
|
@@ -36,7 +53,6 @@ module Arrest
|
|
36
53
|
@context_provider = context_provider
|
37
54
|
end
|
38
55
|
|
39
|
-
|
40
56
|
def method_missing(*args, &block)
|
41
57
|
params = [@context_provider.get_context]
|
42
58
|
params += args.drop(1)
|
@@ -54,8 +70,9 @@ module Arrest
|
|
54
70
|
extend ActiveModel::Naming
|
55
71
|
include ActiveModel::Validations
|
56
72
|
include ActiveModel::Conversion
|
73
|
+
include ActiveModel::Dirty
|
57
74
|
include HasAttributes
|
58
|
-
attribute :id, String
|
75
|
+
attribute :id, String
|
59
76
|
|
60
77
|
attr_accessor :context
|
61
78
|
|
@@ -86,8 +103,16 @@ module Arrest
|
|
86
103
|
body
|
87
104
|
end
|
88
105
|
|
89
|
-
def build(hash)
|
90
|
-
resource = self.new(
|
106
|
+
def build(context, hash)
|
107
|
+
resource = self.new(context, hash, true)
|
108
|
+
|
109
|
+
# traverse fields for subresources and fill them in
|
110
|
+
self.all_fields.find_all{|f| f.is_a?(HasManySubResourceAttribute)}.each do |attr|
|
111
|
+
ids = AbstractResource::source.get_many_other_ids(context, "#{resource.resource_location}/#{attr.sub_resource_field_name}")
|
112
|
+
resource.send("#{attr.name}=", body_root(ids))
|
113
|
+
end
|
114
|
+
resource.clear_dirtiness()
|
115
|
+
|
91
116
|
resource
|
92
117
|
end
|
93
118
|
|
@@ -96,11 +121,11 @@ module Arrest
|
|
96
121
|
end
|
97
122
|
|
98
123
|
def resource_name
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
124
|
+
if @custom_resource_name
|
125
|
+
@custom_resource_name
|
126
|
+
else
|
127
|
+
StringUtils.plural(self.name.sub(/.*:/,'').downcase)
|
128
|
+
end
|
104
129
|
end
|
105
130
|
|
106
131
|
def has_many(*args)
|
@@ -140,18 +165,19 @@ module Arrest
|
|
140
165
|
def create_has_many_attribute(sub_resource, ids_field_name, method_name,
|
141
166
|
clazz_name, url_part, foreign_key, read_only)
|
142
167
|
if sub_resource
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
168
|
+
define_attribute_methods [ids_field_name]
|
169
|
+
return HasManySubResourceAttribute.new(ids_field_name,
|
170
|
+
method_name,
|
171
|
+
clazz_name,
|
172
|
+
url_part,
|
173
|
+
foreign_key)
|
148
174
|
else
|
149
|
-
HasManyAttribute.new(ids_field_name,
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
175
|
+
return HasManyAttribute.new(ids_field_name,
|
176
|
+
method_name,
|
177
|
+
clazz_name,
|
178
|
+
url_part,
|
179
|
+
foreign_key,
|
180
|
+
read_only)
|
155
181
|
end
|
156
182
|
end
|
157
183
|
|
@@ -196,8 +222,21 @@ module Arrest
|
|
196
222
|
def read_only_attributes(args)
|
197
223
|
args.each_pair do |name, clazz|
|
198
224
|
self.send :attr_accessor,name
|
199
|
-
add_attribute
|
225
|
+
add_attribute(Attribute.new(name, true, clazz))
|
226
|
+
end
|
227
|
+
end
|
228
|
+
|
229
|
+
def filters
|
230
|
+
@filters
|
231
|
+
end
|
232
|
+
|
233
|
+
def all_filters
|
234
|
+
all_filters = @filters
|
235
|
+
all_filters ||= []
|
236
|
+
if superclass.respond_to?('filters') && superclass.filters
|
237
|
+
all_fields += superclass.filters
|
200
238
|
end
|
239
|
+
all_filters
|
201
240
|
end
|
202
241
|
end
|
203
242
|
|
@@ -210,20 +249,26 @@ module Arrest
|
|
210
249
|
initialize_has_attributes(hash, from_json)
|
211
250
|
end
|
212
251
|
|
252
|
+
def clear_dirtiness
|
253
|
+
@changed_attributes.clear if @changed_attributes
|
254
|
+
end
|
255
|
+
|
213
256
|
def save
|
214
257
|
if Source.skip_validations || self.valid?
|
215
258
|
req_type = new_record? ? :post : :put
|
216
|
-
|
217
259
|
success = !!AbstractResource::source.send(req_type, @context, self)
|
218
260
|
|
219
261
|
if success
|
220
262
|
# check for sub resources in case of n:m relationships
|
221
263
|
self.class.all_fields.find_all{|f| f.is_a?(HasManySubResourceAttribute)}.each do |attr|
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
264
|
+
if self.send("#{attr.name}_changed?") # check whether this 'subresource' attribute has been touched
|
265
|
+
ids = self.send(attr.name) # get ids_field e.g. for team has_many :users get 'self.user_ids'
|
266
|
+
srifn = attr.sub_resource_field_name
|
267
|
+
result = !!AbstractResource::source.put_sub_resource(self, srifn, ids)
|
268
|
+
return false if !result
|
269
|
+
end
|
226
270
|
end
|
271
|
+
clear_dirtiness() # unset the dirtiness after saving (only used for HasManySubResourceAttributes), see ActiveModel::Dirty
|
227
272
|
return true
|
228
273
|
end
|
229
274
|
end
|
@@ -1,4 +1,6 @@
|
|
1
1
|
require "arrest/source"
|
2
|
+
require 'active_model'
|
3
|
+
|
2
4
|
module Arrest
|
3
5
|
|
4
6
|
|
@@ -15,6 +17,7 @@ module Arrest
|
|
15
17
|
end
|
16
18
|
|
17
19
|
module HasAttributes
|
20
|
+
|
18
21
|
attr_accessor :attribute_values
|
19
22
|
|
20
23
|
def initialize_has_attributes(hash, from_json = false, &blk)
|
@@ -38,8 +41,10 @@ module Arrest
|
|
38
41
|
end
|
39
42
|
end
|
40
43
|
|
44
|
+
# enables the implicit inclusion of these methods as class methods in the including class
|
45
|
+
# (AbstractResource)
|
41
46
|
def self.included(base) # :nodoc:
|
42
|
-
base.extend
|
47
|
+
base.extend HasAttributesClassMethods
|
43
48
|
end
|
44
49
|
|
45
50
|
def init_from_hash(as_i={}, from_json = false)
|
@@ -61,6 +66,10 @@ module Arrest
|
|
61
66
|
end
|
62
67
|
end
|
63
68
|
|
69
|
+
def attributes
|
70
|
+
self.attribute_values
|
71
|
+
end
|
72
|
+
|
64
73
|
def attributes=(attribute_hash = {})
|
65
74
|
fields = self.class.all_fields
|
66
75
|
field_names = fields.map(&:name)
|
@@ -111,8 +120,7 @@ module Arrest
|
|
111
120
|
result
|
112
121
|
end
|
113
122
|
|
114
|
-
module
|
115
|
-
|
123
|
+
module HasAttributesClassMethods
|
116
124
|
attr_accessor :fields
|
117
125
|
|
118
126
|
def initialize
|
@@ -132,10 +140,15 @@ module Arrest
|
|
132
140
|
|
133
141
|
def add_attribute(attribute)
|
134
142
|
@fields ||= []
|
143
|
+
# define setter for attribute value
|
135
144
|
if (attribute.is_a?(HasManySubResourceAttribute))
|
136
145
|
send :define_method, "#{attribute.name}=" do |v|
|
137
146
|
raise ArgumentError, 'Argument is not of Array type' unless v.is_a?(Array)
|
138
147
|
Arrest::debug "setter #{self.class.name} #{attribute.name} = #{v}"
|
148
|
+
|
149
|
+
# inform ActiveModel::Dirty about dirtiness of this attribute
|
150
|
+
self.send("#{attribute.name}_will_change!") unless v == self.attribute_values[attribute.name]
|
151
|
+
|
139
152
|
self.attribute_values[attribute.name] = v
|
140
153
|
end
|
141
154
|
else
|
@@ -144,6 +157,8 @@ module Arrest
|
|
144
157
|
self.attribute_values[attribute.name] = v
|
145
158
|
end
|
146
159
|
end
|
160
|
+
|
161
|
+
# define getter for attribute value
|
147
162
|
send :define_method, "#{attribute.name}" do
|
148
163
|
Arrest::debug "getter #{self.class.name} #{attribute.name}"
|
149
164
|
self.load_from_stub if @stubbed
|
@@ -7,7 +7,7 @@ module Arrest
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def build attributes = {}
|
10
|
-
resolved_class.new @parent, attributes
|
10
|
+
resolved_class.new(@parent.context, @parent, attributes)
|
11
11
|
end
|
12
12
|
|
13
13
|
def method_missing(*args, &block)
|
@@ -29,7 +29,7 @@ module Arrest
|
|
29
29
|
|
30
30
|
def children
|
31
31
|
if @children == nil
|
32
|
-
@children = resolved_class.all_for
|
32
|
+
@children = resolved_class.all_for(@parent)
|
33
33
|
end
|
34
34
|
@children
|
35
35
|
end
|
data/lib/arrest/http_source.rb
CHANGED
@@ -6,7 +6,7 @@ module Arrest
|
|
6
6
|
class HttpSource
|
7
7
|
|
8
8
|
attr_reader :base
|
9
|
-
|
9
|
+
|
10
10
|
def initialize base
|
11
11
|
@base = base
|
12
12
|
end
|
@@ -93,9 +93,9 @@ module Arrest
|
|
93
93
|
def put(context, rest_resource)
|
94
94
|
raise "To change an object it must have an id" unless rest_resource.respond_to?(:id) && rest_resource.id != nil
|
95
95
|
hash = rest_resource.to_jhash
|
96
|
+
insert_nulls!(rest_resource,hash)
|
96
97
|
hash.delete(:id)
|
97
98
|
hash.delete("id")
|
98
|
-
insert_nulls!(rest_resource,hash)
|
99
99
|
body = JSON.generate(hash)
|
100
100
|
|
101
101
|
internal_put(rest_resource, rest_resource.resource_location, body)
|
data/lib/arrest/root_resource.rb
CHANGED
@@ -16,10 +16,18 @@ module Arrest
|
|
16
16
|
end
|
17
17
|
body ||= []
|
18
18
|
body.map do |h|
|
19
|
-
self.build h
|
19
|
+
self.build(context, h)
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
+
def first(context, filter={})
|
24
|
+
all(context,filter).first
|
25
|
+
end
|
26
|
+
|
27
|
+
def end(context, filter={})
|
28
|
+
all(context,filter).last
|
29
|
+
end
|
30
|
+
|
23
31
|
def all(context, filter={})
|
24
32
|
begin
|
25
33
|
body = body_root(source().get_many(context, self.resource_path, filter))
|
@@ -29,9 +37,7 @@ module Arrest
|
|
29
37
|
end
|
30
38
|
body ||= []
|
31
39
|
body.map do |h|
|
32
|
-
|
33
|
-
obj.context = context
|
34
|
-
obj
|
40
|
+
self.build(context, h)
|
35
41
|
end
|
36
42
|
end
|
37
43
|
|
@@ -42,9 +48,7 @@ module Arrest
|
|
42
48
|
Arrest::logger.info "DocumentNotFoundError for #{self.resource_path}"
|
43
49
|
raise Errors::DocumentNotFoundError.new
|
44
50
|
end
|
45
|
-
|
46
|
-
res.context = context
|
47
|
-
res
|
51
|
+
self.build(context, body)
|
48
52
|
end
|
49
53
|
|
50
54
|
def find(context, id)
|
@@ -58,12 +62,7 @@ module Arrest
|
|
58
62
|
Arrest::logger.info "DocumentNotFoundError for #{self.resource_path}/#{id}"
|
59
63
|
raise Errors::DocumentNotFoundError.new
|
60
64
|
end
|
61
|
-
resource = self.build body.merge({:id => id})
|
62
|
-
# traverse fields for subresources and fill them in
|
63
|
-
self.all_fields.find_all{|f| f.is_a?(HasManySubResourceAttribute)}.each do |attr|
|
64
|
-
ids = AbstractResource::source.get_many_other_ids(context, "#{resource.resource_location}/#{attr.sub_resource_field_name}")
|
65
|
-
resource.send("#{attr.name}=", body_root(ids))
|
66
|
-
end
|
65
|
+
resource = self.build(context, body.merge({:id => id}))
|
67
66
|
resource
|
68
67
|
end
|
69
68
|
|
@@ -90,18 +89,6 @@ module Arrest
|
|
90
89
|
end
|
91
90
|
end
|
92
91
|
|
93
|
-
def filters
|
94
|
-
@filters
|
95
|
-
end
|
96
|
-
|
97
|
-
def all_filters
|
98
|
-
all_filters = @filters
|
99
|
-
all_filters ||= []
|
100
|
-
if superclass.respond_to?('filters') && superclass.filters
|
101
|
-
all_fields += superclass.filters
|
102
|
-
end
|
103
|
-
all_filters
|
104
|
-
end
|
105
92
|
|
106
93
|
def scope name, &block
|
107
94
|
super(name)
|
@@ -112,7 +99,7 @@ module Arrest
|
|
112
99
|
else
|
113
100
|
send :define_singleton_method, name do |context|
|
114
101
|
body_root(source().get_many(context, self.scoped_path(name))).map do |h|
|
115
|
-
self.build(h)
|
102
|
+
self.build(context, h)
|
116
103
|
end
|
117
104
|
end
|
118
105
|
end
|
data/lib/arrest/version.rb
CHANGED
data/test/has_attributed.rb
CHANGED
@@ -64,5 +64,47 @@ class HasAttributesTest < Test::Unit::TestCase
|
|
64
64
|
assert_equal 'foo42', h[:id]
|
65
65
|
end
|
66
66
|
|
67
|
+
class GotMe < Arrest::RootResource
|
68
|
+
end
|
69
|
+
# for dirty tracking of attributes we need class to be a resource (which includes ActiveModel::Dirty)
|
70
|
+
class ItHasResource < Arrest::RootResource
|
71
|
+
attribute :name, String
|
72
|
+
has_many :got_mes, :sub_resource => true
|
73
|
+
end
|
74
|
+
|
75
|
+
def test_dirty_attribute
|
76
|
+
Arrest::Source.source = nil
|
77
|
+
Arrest::Source.skip_validations = false
|
78
|
+
|
79
|
+
ih = ItHasResource.new({:name => "Bla"})
|
80
|
+
ih.save
|
81
|
+
assert !ih.got_me_ids_changed?
|
82
|
+
assert !ih.changed?
|
83
|
+
|
84
|
+
ih.got_me_ids = ["huhu"]
|
85
|
+
assert ih.got_me_ids_changed?
|
86
|
+
assert ih.changed?
|
87
|
+
ih.save
|
88
|
+
|
89
|
+
assert !ih.got_me_ids_changed?
|
90
|
+
assert !ih.changed?
|
91
|
+
|
92
|
+
ih.got_me_ids = ["huhu"]
|
93
|
+
assert !ih.got_me_ids_changed?
|
94
|
+
assert !ih.changed?
|
95
|
+
end
|
96
|
+
|
97
|
+
def test_dirty_with_reload
|
98
|
+
Arrest::Source.source = nil
|
99
|
+
Arrest::Source.skip_validations = false
|
100
|
+
@scope = Arrest::ScopedRoot.new
|
101
|
+
|
102
|
+
ih = @scope.ItHasResource.new({:name => "Bla", :got_me_ids => ["BistDuEinRuede?"]})
|
103
|
+
ih.save
|
104
|
+
|
105
|
+
ih.reload
|
106
|
+
assert_equal "Bla", ih.name
|
107
|
+
assert_equal ["BistDuEinRuede?"], ih.got_me_ids
|
108
|
+
end
|
67
109
|
end
|
68
110
|
|
data/test/unit.rb
CHANGED
@@ -27,7 +27,7 @@ class FirstTest < Test::Unit::TestCase
|
|
27
27
|
def test_create
|
28
28
|
zoo_count_before = @scope.Zoo.all.length
|
29
29
|
new_zoo = @scope.Zoo.new({:name => "Foo"})
|
30
|
-
assert_equal "Foo", new_zoo.name
|
30
|
+
assert_equal "Foo", new_zoo.name
|
31
31
|
assert new_zoo.save, new_zoo.errors.full_messages.to_s
|
32
32
|
zoo_count_after = @scope.Zoo.all.length
|
33
33
|
assert_not_nil new_zoo.id
|
@@ -636,7 +636,7 @@ class FirstTest < Test::Unit::TestCase
|
|
636
636
|
assert_equal zoo1.name, zoo2.name
|
637
637
|
end
|
638
638
|
|
639
|
-
def
|
639
|
+
def test_unset_property
|
640
640
|
# just taking a class that has a not mandatory attribute
|
641
641
|
zo = @scope.ZooOwner.new({ :name => 'meeeee' })
|
642
642
|
assert zo.save
|
@@ -647,4 +647,3 @@ class FirstTest < Test::Unit::TestCase
|
|
647
647
|
assert_nil zo.name, "Name should be unset"
|
648
648
|
end
|
649
649
|
end
|
650
|
-
|
metadata
CHANGED
@@ -1,133 +1,176 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: arrest
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 41
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 27
|
10
|
+
version: 0.0.27
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Axel Tetzlaff
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
17
|
+
|
18
|
+
date: 2012-02-16 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
15
21
|
name: json
|
16
|
-
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
17
24
|
none: false
|
18
|
-
requirements:
|
19
|
-
- -
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 3
|
29
|
+
segments:
|
30
|
+
- 0
|
31
|
+
version: "0"
|
22
32
|
type: :runtime
|
23
|
-
|
24
|
-
|
25
|
-
- !ruby/object:Gem::Dependency
|
33
|
+
version_requirements: *id001
|
34
|
+
- !ruby/object:Gem::Dependency
|
26
35
|
name: faraday
|
27
|
-
|
36
|
+
prerelease: false
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
28
38
|
none: false
|
29
|
-
requirements:
|
30
|
-
- - =
|
31
|
-
- !ruby/object:Gem::Version
|
39
|
+
requirements:
|
40
|
+
- - "="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
hash: 9
|
43
|
+
segments:
|
44
|
+
- 0
|
45
|
+
- 7
|
46
|
+
- 5
|
32
47
|
version: 0.7.5
|
33
48
|
type: :runtime
|
34
|
-
|
35
|
-
|
36
|
-
- !ruby/object:Gem::Dependency
|
49
|
+
version_requirements: *id002
|
50
|
+
- !ruby/object:Gem::Dependency
|
37
51
|
name: activemodel
|
38
|
-
|
52
|
+
prerelease: false
|
53
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
39
54
|
none: false
|
40
|
-
requirements:
|
55
|
+
requirements:
|
41
56
|
- - ~>
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
hash: 5
|
59
|
+
segments:
|
60
|
+
- 3
|
61
|
+
version: "3"
|
44
62
|
type: :runtime
|
45
|
-
|
46
|
-
|
47
|
-
- !ruby/object:Gem::Dependency
|
63
|
+
version_requirements: *id003
|
64
|
+
- !ruby/object:Gem::Dependency
|
48
65
|
name: bundler
|
49
|
-
|
66
|
+
prerelease: false
|
67
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
50
68
|
none: false
|
51
|
-
requirements:
|
52
|
-
- -
|
53
|
-
- !ruby/object:Gem::Version
|
69
|
+
requirements:
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
hash: 23
|
73
|
+
segments:
|
74
|
+
- 1
|
75
|
+
- 0
|
76
|
+
- 0
|
54
77
|
version: 1.0.0
|
55
78
|
type: :development
|
56
|
-
|
57
|
-
|
58
|
-
- !ruby/object:Gem::Dependency
|
79
|
+
version_requirements: *id004
|
80
|
+
- !ruby/object:Gem::Dependency
|
59
81
|
name: rake
|
60
|
-
|
82
|
+
prerelease: false
|
83
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
61
84
|
none: false
|
62
|
-
requirements:
|
63
|
-
- -
|
64
|
-
- !ruby/object:Gem::Version
|
65
|
-
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
hash: 3
|
89
|
+
segments:
|
90
|
+
- 0
|
91
|
+
version: "0"
|
66
92
|
type: :development
|
67
|
-
|
68
|
-
|
69
|
-
- !ruby/object:Gem::Dependency
|
93
|
+
version_requirements: *id005
|
94
|
+
- !ruby/object:Gem::Dependency
|
70
95
|
name: rdoc
|
71
|
-
|
96
|
+
prerelease: false
|
97
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
72
98
|
none: false
|
73
|
-
requirements:
|
74
|
-
- -
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
|
99
|
+
requirements:
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
hash: 3
|
103
|
+
segments:
|
104
|
+
- 0
|
105
|
+
version: "0"
|
77
106
|
type: :development
|
78
|
-
|
79
|
-
|
80
|
-
- !ruby/object:Gem::Dependency
|
107
|
+
version_requirements: *id006
|
108
|
+
- !ruby/object:Gem::Dependency
|
81
109
|
name: rspec
|
82
|
-
|
110
|
+
prerelease: false
|
111
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
83
112
|
none: false
|
84
|
-
requirements:
|
113
|
+
requirements:
|
85
114
|
- - ~>
|
86
|
-
- !ruby/object:Gem::Version
|
87
|
-
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
hash: 7
|
117
|
+
segments:
|
118
|
+
- 2
|
119
|
+
version: "2"
|
88
120
|
type: :development
|
89
|
-
|
90
|
-
|
91
|
-
- !ruby/object:Gem::Dependency
|
121
|
+
version_requirements: *id007
|
122
|
+
- !ruby/object:Gem::Dependency
|
92
123
|
name: rr
|
93
|
-
|
124
|
+
prerelease: false
|
125
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
94
126
|
none: false
|
95
|
-
requirements:
|
96
|
-
- -
|
97
|
-
- !ruby/object:Gem::Version
|
98
|
-
|
127
|
+
requirements:
|
128
|
+
- - ">="
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
hash: 3
|
131
|
+
segments:
|
132
|
+
- 0
|
133
|
+
version: "0"
|
99
134
|
type: :development
|
100
|
-
|
101
|
-
|
102
|
-
- !ruby/object:Gem::Dependency
|
135
|
+
version_requirements: *id008
|
136
|
+
- !ruby/object:Gem::Dependency
|
103
137
|
name: simplecov
|
104
|
-
|
138
|
+
prerelease: false
|
139
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
105
140
|
none: false
|
106
|
-
requirements:
|
107
|
-
- -
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
|
141
|
+
requirements:
|
142
|
+
- - ">="
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
hash: 3
|
145
|
+
segments:
|
146
|
+
- 0
|
147
|
+
version: "0"
|
110
148
|
type: :development
|
111
|
-
|
112
|
-
|
113
|
-
- !ruby/object:Gem::Dependency
|
149
|
+
version_requirements: *id009
|
150
|
+
- !ruby/object:Gem::Dependency
|
114
151
|
name: rack
|
115
|
-
|
152
|
+
prerelease: false
|
153
|
+
requirement: &id010 !ruby/object:Gem::Requirement
|
116
154
|
none: false
|
117
|
-
requirements:
|
118
|
-
- -
|
119
|
-
- !ruby/object:Gem::Version
|
120
|
-
|
155
|
+
requirements:
|
156
|
+
- - ">="
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
hash: 3
|
159
|
+
segments:
|
160
|
+
- 0
|
161
|
+
version: "0"
|
121
162
|
type: :development
|
122
|
-
|
123
|
-
version_requirements: *2165723360
|
163
|
+
version_requirements: *id010
|
124
164
|
description: Consume a rest API in a AR like fashion
|
125
|
-
email:
|
165
|
+
email:
|
126
166
|
- axel.tetzlaff@fortytools.com
|
127
167
|
executables: []
|
168
|
+
|
128
169
|
extensions: []
|
170
|
+
|
129
171
|
extra_rdoc_files: []
|
130
|
-
|
172
|
+
|
173
|
+
files:
|
131
174
|
- .gitignore
|
132
175
|
- .rspec
|
133
176
|
- Gemfile
|
@@ -169,31 +212,40 @@ files:
|
|
169
212
|
- test/nested_resource.rb
|
170
213
|
- test/unit.rb
|
171
214
|
- test/validations.rb
|
172
|
-
homepage:
|
215
|
+
homepage: ""
|
173
216
|
licenses: []
|
217
|
+
|
174
218
|
post_install_message:
|
175
219
|
rdoc_options: []
|
176
|
-
|
220
|
+
|
221
|
+
require_paths:
|
177
222
|
- lib
|
178
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
223
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
179
224
|
none: false
|
180
|
-
requirements:
|
181
|
-
- -
|
182
|
-
- !ruby/object:Gem::Version
|
183
|
-
|
184
|
-
|
225
|
+
requirements:
|
226
|
+
- - ">="
|
227
|
+
- !ruby/object:Gem::Version
|
228
|
+
hash: 3
|
229
|
+
segments:
|
230
|
+
- 0
|
231
|
+
version: "0"
|
232
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
185
233
|
none: false
|
186
|
-
requirements:
|
187
|
-
- -
|
188
|
-
- !ruby/object:Gem::Version
|
189
|
-
|
234
|
+
requirements:
|
235
|
+
- - ">="
|
236
|
+
- !ruby/object:Gem::Version
|
237
|
+
hash: 3
|
238
|
+
segments:
|
239
|
+
- 0
|
240
|
+
version: "0"
|
190
241
|
requirements: []
|
242
|
+
|
191
243
|
rubyforge_project: arrest
|
192
244
|
rubygems_version: 1.8.10
|
193
245
|
signing_key:
|
194
246
|
specification_version: 3
|
195
247
|
summary: Another ruby rest client
|
196
|
-
test_files:
|
248
|
+
test_files:
|
197
249
|
- spec/arrest_spec.rb
|
198
250
|
- spec/spec_helper.rb
|
199
251
|
- spec/support/models/user.rb
|