hal-client 2.3.1 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/hal-client.gemspec +7 -6
- data/lib/hal_client/collection.rb +9 -0
- data/lib/hal_client/links_section.rb +67 -0
- data/lib/hal_client/representation.rb +59 -46
- data/lib/hal_client/version.rb +1 -1
- data/lib/hal_client.rb +1 -0
- data/spec/hal_client/links_section_spec.rb +56 -0
- data/spec/hal_client/representation_set_spec.rb +11 -7
- data/spec/hal_client/representation_spec.rb +21 -31
- data/spec/spec_helper.rb +1 -0
- metadata +23 -40
data/hal-client.gemspec
CHANGED
@@ -18,12 +18,13 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_dependency "rest-client", "~> 1.6"
|
22
|
-
spec.add_dependency "addressable", "~> 2.3"
|
23
|
-
spec.add_dependency "multi_json", "~> 1.9"
|
21
|
+
spec.add_dependency "rest-client", "~> 1.6"
|
22
|
+
spec.add_dependency "addressable", "~> 2.3"
|
23
|
+
spec.add_dependency "multi_json", "~> 1.9"
|
24
24
|
|
25
25
|
spec.add_development_dependency "bundler", "~> 1.5"
|
26
|
-
spec.add_development_dependency "rake", "~> 10.1"
|
27
|
-
spec.add_development_dependency "rspec", "~>
|
28
|
-
spec.add_development_dependency "webmock", "~> 1.16"
|
26
|
+
spec.add_development_dependency "rake", "~> 10.1"
|
27
|
+
spec.add_development_dependency "rspec", "~> 3.0.0.beta"
|
28
|
+
spec.add_development_dependency "webmock", "~> 1.16"
|
29
|
+
spec.add_development_dependency "rspec-collection_matchers"
|
29
30
|
end
|
@@ -52,6 +52,15 @@ class HalClient
|
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
55
|
+
# Returns one or more randomly selected item from the first page
|
56
|
+
# of the collection.
|
57
|
+
#
|
58
|
+
# count - number of items to return. If specified return type will
|
59
|
+
# an collection. Default: return a single item
|
60
|
+
def sample(*arg)
|
61
|
+
first_page.related("item").sample(*arg)
|
62
|
+
end
|
63
|
+
|
55
64
|
protected
|
56
65
|
|
57
66
|
attr_reader :first_page
|
@@ -0,0 +1,67 @@
|
|
1
|
+
class HalClient
|
2
|
+
|
3
|
+
# Encapsulates a "_links" section.
|
4
|
+
class LinksSection
|
5
|
+
UNSET = Object.new
|
6
|
+
|
7
|
+
def initialize(section, namespaces=nil)
|
8
|
+
@namespaces = namespaces || CurieResolver.new(section.fetch("curies"){[]})
|
9
|
+
|
10
|
+
@section = fully_qualified section
|
11
|
+
end
|
12
|
+
|
13
|
+
attr_reader :namespaces
|
14
|
+
|
15
|
+
# Returns the URLs or URL templates of each link with the
|
16
|
+
# specified rel in this section.
|
17
|
+
#
|
18
|
+
# link_rel - The fully qualified link relation
|
19
|
+
# default_proc - (optional) A proc to execute to create a
|
20
|
+
# default value if the specified link_rel does not exist
|
21
|
+
#
|
22
|
+
# Yields the link_rel to the default_proc if the specified
|
23
|
+
# link_rel is not present and returns the return value of the
|
24
|
+
# default_proc.
|
25
|
+
#
|
26
|
+
# Raises KeyError if the specified link_rel is not present and no
|
27
|
+
# default_value or default_proc are provided.
|
28
|
+
def hrefs(link_rel, &default_proc)
|
29
|
+
default_proc ||= ->(link_rel){
|
30
|
+
raise KeyError, "No resources are related via `#{link_rel}`"
|
31
|
+
}
|
32
|
+
|
33
|
+
return default_proc.call(link_rel) unless section.key? link_rel
|
34
|
+
|
35
|
+
[section.fetch(link_rel)]
|
36
|
+
.flatten
|
37
|
+
.map{|link| resolve_to_url(link)}
|
38
|
+
end
|
39
|
+
|
40
|
+
protected
|
41
|
+
|
42
|
+
attr_reader :section
|
43
|
+
|
44
|
+
def resolve_to_url(link)
|
45
|
+
(fail HalClient::InvalidRepresentationError) unless link.respond_to? :fetch
|
46
|
+
|
47
|
+
url = link.fetch("href")
|
48
|
+
is_templated = link.fetch("templated", false)
|
49
|
+
|
50
|
+
if is_templated
|
51
|
+
Addressable::Template.new(url)
|
52
|
+
else
|
53
|
+
url
|
54
|
+
end
|
55
|
+
|
56
|
+
rescue KeyError
|
57
|
+
fail HalClient::InvalidRepresentationError
|
58
|
+
end
|
59
|
+
|
60
|
+
def fully_qualified(relations_section)
|
61
|
+
Hash[relations_section.map {|rel, link_info|
|
62
|
+
[(namespaces.resolve rel), link_info]
|
63
|
+
}]
|
64
|
+
end
|
65
|
+
|
66
|
+
end
|
67
|
+
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'forwardable'
|
1
2
|
require 'addressable/template'
|
2
3
|
|
3
4
|
require 'hal_client'
|
@@ -8,6 +9,7 @@ class HalClient
|
|
8
9
|
# HAL representation of a single resource. Provides access to
|
9
10
|
# properties, links and embedded representations.
|
10
11
|
class Representation
|
12
|
+
extend Forwardable
|
11
13
|
|
12
14
|
# Create a new Representation
|
13
15
|
#
|
@@ -65,7 +67,7 @@ class HalClient
|
|
65
67
|
|
66
68
|
# Returns the URL of the resource this representation represents.
|
67
69
|
def href
|
68
|
-
@href ||=
|
70
|
+
@href ||= links.hrefs('self').first
|
69
71
|
end
|
70
72
|
|
71
73
|
# Returns the value of the specified property or representations
|
@@ -129,14 +131,11 @@ class HalClient
|
|
129
131
|
raise KeyError, "No resources are related via `#{link_rel}`"
|
130
132
|
}
|
131
133
|
|
132
|
-
embedded =
|
133
|
-
linked =
|
134
|
+
embedded = embedded(link_rel) { nil }
|
135
|
+
linked = linked(link_rel, options) { nil }
|
136
|
+
return default_proc.call(link_rel) if embedded.nil? and linked.nil?
|
134
137
|
|
135
|
-
|
136
|
-
RepresentationSet.new (Array(embedded) + Array(linked))
|
137
|
-
else
|
138
|
-
default_proc.call link_rel
|
139
|
-
end
|
138
|
+
RepresentationSet.new (Array(embedded) + Array(linked))
|
140
139
|
end
|
141
140
|
|
142
141
|
# Returns urls of resources related via the specified
|
@@ -156,6 +155,32 @@ class HalClient
|
|
156
155
|
map(&:href)
|
157
156
|
end
|
158
157
|
|
158
|
+
# Returns values of the `href` member of links and the URL of
|
159
|
+
# embedded representations related via the specified link rel. The
|
160
|
+
# only difference between this and `#related_hrefs` is that this
|
161
|
+
# method makes no attempt to expand templated links. For templated
|
162
|
+
# links the returned collection will include the template pattern
|
163
|
+
# as encoded in the HAL document.
|
164
|
+
#
|
165
|
+
# link_rel - The link rel of interest
|
166
|
+
# default_proc - an option proc that will be called with `name`
|
167
|
+
# to produce default value if the specified property or link does not
|
168
|
+
# exist
|
169
|
+
#
|
170
|
+
# Raises KeyError if the specified link does not exist
|
171
|
+
# and no default_proc is provided.
|
172
|
+
def raw_related_hrefs(link_rel, &default_proc)
|
173
|
+
default_proc ||= ->(link_rel){
|
174
|
+
raise KeyError, "No resources are related via `#{link_rel}`"
|
175
|
+
}
|
176
|
+
|
177
|
+
embedded = embedded(link_rel) { nil }
|
178
|
+
linked = links.hrefs(link_rel) { nil }
|
179
|
+
return default_proc.call(link_rel) if embedded.nil? and linked.nil?
|
180
|
+
|
181
|
+
Array(linked) + Array(embedded).map(&:href)
|
182
|
+
end
|
183
|
+
|
159
184
|
# Returns a short human readable description of this
|
160
185
|
# representation.
|
161
186
|
def to_s
|
@@ -181,36 +206,44 @@ class HalClient
|
|
181
206
|
@raw
|
182
207
|
end
|
183
208
|
|
184
|
-
def
|
185
|
-
@
|
209
|
+
def links
|
210
|
+
@links ||= LinksSection.new raw.fetch("_links"){{}}
|
186
211
|
end
|
187
212
|
|
188
213
|
def embedded_section
|
189
214
|
@embedded_section ||= fully_qualified raw.fetch("_embedded", {})
|
190
215
|
end
|
191
216
|
|
192
|
-
def embedded(link_rel)
|
193
|
-
|
217
|
+
def embedded(link_rel, &default_proc)
|
218
|
+
default_proc ||= ->(link_rel) {
|
219
|
+
fail KeyError, "#{link_rel} embed not found"
|
220
|
+
}
|
221
|
+
|
222
|
+
relations = embedded_section.fetch(link_rel) { MISSING }
|
223
|
+
return default_proc.call(link_rel) if relations == MISSING
|
194
224
|
|
195
|
-
relations.map{|it| Representation.new hal_client: hal_client, parsed_json: it}
|
225
|
+
(boxed relations).map{|it| Representation.new hal_client: hal_client, parsed_json: it}
|
196
226
|
|
197
227
|
rescue InvalidRepresentationError => err
|
198
228
|
fail InvalidRepresentationError, "/_embedded/#{jpointer_esc(link_rel)} is not a valid representation"
|
199
229
|
end
|
200
230
|
|
201
|
-
def
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
nil
|
206
|
-
end
|
231
|
+
def linked(link_rel, options, &default_proc)
|
232
|
+
default_proc ||= ->(link_rel,_options) {
|
233
|
+
fail KeyError, "#{link_rel} link not found"
|
234
|
+
}
|
207
235
|
|
208
|
-
|
209
|
-
|
236
|
+
relations = links.hrefs(link_rel) { MISSING }
|
237
|
+
return default_proc.call(link_rel, options) if relations == MISSING
|
210
238
|
|
211
|
-
relations
|
212
|
-
map {|
|
213
|
-
|
239
|
+
relations
|
240
|
+
.map {|url_or_tmpl|
|
241
|
+
if url_or_tmpl.respond_to? :expand
|
242
|
+
url_or_tmpl.expand(options).to_s
|
243
|
+
else
|
244
|
+
url_or_tmpl
|
245
|
+
end }
|
246
|
+
.map {|href| Representation.new href: href, hal_client: hal_client }
|
214
247
|
|
215
248
|
rescue InvalidRepresentationError => err
|
216
249
|
fail InvalidRepresentationError, "/_links/#{jpointer_esc(link_rel)} is not a valid link"
|
@@ -220,14 +253,6 @@ end
|
|
220
253
|
str.gsub "/", "~1"
|
221
254
|
end
|
222
255
|
|
223
|
-
def linked_or_nil(link_rel, options)
|
224
|
-
linked link_rel, options
|
225
|
-
|
226
|
-
rescue KeyError
|
227
|
-
nil
|
228
|
-
end
|
229
|
-
|
230
|
-
|
231
256
|
def boxed(list_hash_or_nil)
|
232
257
|
if hashish? list_hash_or_nil
|
233
258
|
[list_hash_or_nil]
|
@@ -241,29 +266,17 @@ end
|
|
241
266
|
end
|
242
267
|
end
|
243
268
|
|
244
|
-
def href_from(link, options)
|
245
|
-
raw_href = link.fetch('href')
|
246
|
-
|
247
|
-
if link.fetch('templated', false)
|
248
|
-
Addressable::Template.new(raw_href).expand(options).to_s
|
249
|
-
else
|
250
|
-
raw_href
|
251
|
-
end
|
252
|
-
end
|
253
|
-
|
254
269
|
def fully_qualified(relations_section)
|
255
270
|
Hash[relations_section.map {|rel, link_info|
|
256
271
|
[(namespaces.resolve rel), link_info]
|
257
272
|
}]
|
258
273
|
end
|
259
274
|
|
260
|
-
def namespaces
|
261
|
-
@namespaces ||= CurieResolver.new raw.fetch("_links", {}).fetch("curies", [])
|
262
|
-
end
|
263
|
-
|
264
275
|
def hashish?(thing)
|
265
276
|
thing.respond_to?(:fetch) && thing.respond_to?(:key?)
|
266
277
|
end
|
267
278
|
|
279
|
+
def_delegators :links, :namespaces
|
280
|
+
|
268
281
|
end
|
269
282
|
end
|
data/lib/hal_client/version.rb
CHANGED
data/lib/hal_client.rb
CHANGED
@@ -7,6 +7,7 @@ class HalClient
|
|
7
7
|
autoload :Representation, 'hal_client/representation'
|
8
8
|
autoload :RepresentationSet, 'hal_client/representation_set'
|
9
9
|
autoload :CurieResolver, 'hal_client/curie_resolver'
|
10
|
+
autoload :LinksSection, 'hal_client/links_section'
|
10
11
|
autoload :Collection, 'hal_client/collection'
|
11
12
|
autoload :InvalidRepresentationError, 'hal_client/errors'
|
12
13
|
autoload :NotACollectionError, 'hal_client/errors'
|
@@ -0,0 +1,56 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
require 'hal-client'
|
3
|
+
|
4
|
+
describe HalClient::LinksSection, "namespaces embedded" do
|
5
|
+
subject(:section) { described_class.new(raw_section) }
|
6
|
+
|
7
|
+
specify { expect(section.hrefs("up"))
|
8
|
+
.to contain_exactly "http://example.com/parent" }
|
9
|
+
|
10
|
+
specify { expect(section.hrefs(fully_qualified_first_rel))
|
11
|
+
.to contain_exactly "http://example.com/foo" }
|
12
|
+
|
13
|
+
specify { expect(section.hrefs(fully_qualified_second_rel))
|
14
|
+
.to contain_exactly "http://example.com/bar", "http://example.com/baz" }
|
15
|
+
|
16
|
+
specify { expect(section.hrefs("search"))
|
17
|
+
.to all match respond_to(:pattern).and respond_to(:expand) }
|
18
|
+
specify { expect(section.hrefs("search").first.pattern).to eq "http://example.com/s{?q}" }
|
19
|
+
|
20
|
+
specify { expect{section.hrefs("nonexistent")}.to raise_error KeyError }
|
21
|
+
|
22
|
+
let(:fully_qualified_first_rel) { "http://rels.example.com/first" }
|
23
|
+
let(:fully_qualified_second_rel) { "http://rels.example.com/2/second" }
|
24
|
+
|
25
|
+
let(:raw_section) {
|
26
|
+
{ "curies" => [{ "name" => "ns1",
|
27
|
+
"href" => "http://rels.example.com/{rel}",
|
28
|
+
"templated" => true},
|
29
|
+
{ "name" => "ns2",
|
30
|
+
"href" => "http://rels.example.com/2/{rel}",
|
31
|
+
"templated" => true}],
|
32
|
+
"up" => {"href" => "http://example.com/parent"},
|
33
|
+
"search" => {"href" => "http://example.com/s{?q}", "templated" => true },
|
34
|
+
"ns1:first" => {"href" => "http://example.com/foo"},
|
35
|
+
"ns2:second" => [{"href" => "http://example.com/bar"},
|
36
|
+
{"href" => "http://example.com/baz"}]
|
37
|
+
} }
|
38
|
+
|
39
|
+
matcher :all do |expected|
|
40
|
+
match do |actual|
|
41
|
+
actual.all?{|it| expected === it}
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
describe HalClient::LinksSection, "invalid" do
|
47
|
+
subject(:section) { described_class.new(raw_section) }
|
48
|
+
|
49
|
+
specify { expect{section.hrefs("bareurl")}
|
50
|
+
.to raise_error HalClient::InvalidRepresentationError }
|
51
|
+
|
52
|
+
let(:raw_section) {
|
53
|
+
{ "bareurl" => "http://example.com/boom" }
|
54
|
+
}
|
55
|
+
|
56
|
+
end
|
@@ -21,16 +21,20 @@ describe HalClient::RepresentationSet do
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
-
|
25
|
-
|
24
|
+
specify { expect(repr_set.count).to eq 2 }
|
25
|
+
specify { expect(repr_set.empty?).to be false }
|
26
26
|
|
27
27
|
describe "#any?" do
|
28
|
-
it "returns true if there are any" do
|
29
|
-
expect(subject.any?{|it| it == foo_repr }).to
|
28
|
+
it "returns true if there are any matching" do
|
29
|
+
expect(subject.any?{|it| it == foo_repr }).to be true
|
30
30
|
end
|
31
31
|
|
32
|
-
it "returns
|
33
|
-
expect(subject.any?
|
32
|
+
it "returns true if there are any matchin" do
|
33
|
+
expect(subject.any?).to be true
|
34
|
+
end
|
35
|
+
|
36
|
+
it "returns false if there aren't any matching" do
|
37
|
+
expect(subject.any?{|it| false }).to be false
|
34
38
|
end
|
35
39
|
end
|
36
40
|
|
@@ -126,7 +130,7 @@ describe HalClient::RepresentationSet do
|
|
126
130
|
match { |repr_set|
|
127
131
|
repr_set.any?{|it| it.href == url}
|
128
132
|
}
|
129
|
-
|
133
|
+
failure_message { |repr_set|
|
130
134
|
"Expected representation of <#{url}> but found only #{repr_set.map(&:href)}"
|
131
135
|
}
|
132
136
|
end
|
@@ -8,7 +8,7 @@ describe HalClient::Representation do
|
|
8
8
|
,"_links": {
|
9
9
|
"self": { "href": "http://example.com/foo" }
|
10
10
|
,"link1": { "href": "http://example.com/bar" }
|
11
|
-
,"
|
11
|
+
,"templated_link": { "href": "http://example.com/people{?name}"
|
12
12
|
,"templated": true }
|
13
13
|
,"link3": [{ "href": "http://example.com/link3-a" }
|
14
14
|
,{ "href": "http://example.com/link3-b" }]
|
@@ -32,18 +32,17 @@ HAL
|
|
32
32
|
repr.related("link1").post("abc")
|
33
33
|
end
|
34
34
|
|
35
|
-
specify {
|
36
|
-
expect(
|
37
|
-
|
38
|
-
|
39
|
-
).to have_been_made
|
35
|
+
specify("makes request") {
|
36
|
+
expect(post_request.with(:body => "abc",
|
37
|
+
:headers => {'Content-Type' => 'application/hal+json'}))
|
38
|
+
.to have_been_made
|
40
39
|
}
|
41
40
|
end
|
42
41
|
|
43
42
|
describe "#to_s" do
|
44
43
|
subject(:return_val) { repr.to_s }
|
45
44
|
|
46
|
-
it {
|
45
|
+
it { is_expected.to eq "#<HalClient::Representation: http://example.com/foo>" }
|
47
46
|
end
|
48
47
|
|
49
48
|
specify { expect(repr.property "prop1").to eq 1 }
|
@@ -55,7 +54,7 @@ HAL
|
|
55
54
|
specify { expect(repr.has_property? "nonexistent-prop").to be false }
|
56
55
|
|
57
56
|
|
58
|
-
|
57
|
+
specify { expect(subject.href).to eq "http://example.com/foo" }
|
59
58
|
|
60
59
|
describe "#fetch" do
|
61
60
|
context "for existent property" do
|
@@ -135,7 +134,7 @@ HAL
|
|
135
134
|
end
|
136
135
|
|
137
136
|
context "for existent templated link" do
|
138
|
-
subject { repr.related "
|
137
|
+
subject { repr.related "templated_link", name: "bob" }
|
139
138
|
it { should have(1).item }
|
140
139
|
it { should include_representation_of "http://example.com/people?name=bob" }
|
141
140
|
end
|
@@ -153,25 +152,16 @@ HAL
|
|
153
152
|
end
|
154
153
|
end
|
155
154
|
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
end
|
155
|
+
specify { expect(repr.related_hrefs "link1")
|
156
|
+
.to contain_exactly "http://example.com/bar" }
|
157
|
+
specify { expect(repr.related_hrefs "embed1")
|
158
|
+
.to contain_exactly "http://example.com/baz" }
|
159
|
+
specify { expect { repr.related_hrefs 'wat' }.to raise_exception KeyError }
|
162
160
|
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
end
|
168
|
-
|
169
|
-
context "non-existent item w/o default" do
|
170
|
-
it "raises exception" do
|
171
|
-
expect{repr.related_hrefs 'wat'}.to raise_exception KeyError
|
172
|
-
end
|
173
|
-
end
|
174
|
-
end
|
161
|
+
specify { expect(repr.raw_related_hrefs("templated_link").map(&:pattern))
|
162
|
+
.to contain_exactly "http://example.com/people{?name}" }
|
163
|
+
specify { expect(repr.raw_related_hrefs("link1"))
|
164
|
+
.to contain_exactly "http://example.com/bar" }
|
175
165
|
|
176
166
|
specify { expect(subject.has_related? "link1").to be true }
|
177
167
|
specify { expect(subject.related? "link1").to be true }
|
@@ -193,17 +183,17 @@ HAL
|
|
193
183
|
}
|
194
184
|
HAL
|
195
185
|
|
196
|
-
describe "#related return value
|
186
|
+
describe "#related return value" do
|
197
187
|
subject(:return_val) { repr.related("http://example.com/rels/bar") }
|
198
188
|
it { should include_representation_of "http://example.com/bar" }
|
199
189
|
end
|
200
190
|
|
201
|
-
describe "#[] return value
|
191
|
+
describe "#[] return value" do
|
202
192
|
subject(:return_val) { repr["http://example.com/rels/bar"] }
|
203
193
|
it { should include_representation_of "http://example.com/bar" }
|
204
194
|
end
|
205
195
|
|
206
|
-
describe "#related_hrefs return value
|
196
|
+
describe "#related_hrefs return value" do
|
207
197
|
subject(:return_val) { repr.related_hrefs("http://example.com/rels/bar") }
|
208
198
|
it { should include "http://example.com/bar" }
|
209
199
|
end
|
@@ -276,7 +266,7 @@ HAL
|
|
276
266
|
match { |repr_set|
|
277
267
|
repr_set.any?{|it| it.href == url}
|
278
268
|
}
|
279
|
-
|
269
|
+
failure_message { |repr_set|
|
280
270
|
"Expected representation of <#{url}> but found only #{repr_set.map(&:href)}"
|
281
271
|
}
|
282
272
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hal-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-04-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|
@@ -19,9 +19,6 @@ dependencies:
|
|
19
19
|
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: '1.6'
|
22
|
-
- - ! '>='
|
23
|
-
- !ruby/object:Gem::Version
|
24
|
-
version: 1.6.0
|
25
22
|
type: :runtime
|
26
23
|
prerelease: false
|
27
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -30,9 +27,6 @@ dependencies:
|
|
30
27
|
- - ~>
|
31
28
|
- !ruby/object:Gem::Version
|
32
29
|
version: '1.6'
|
33
|
-
- - ! '>='
|
34
|
-
- !ruby/object:Gem::Version
|
35
|
-
version: 1.6.0
|
36
30
|
- !ruby/object:Gem::Dependency
|
37
31
|
name: addressable
|
38
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -41,9 +35,6 @@ dependencies:
|
|
41
35
|
- - ~>
|
42
36
|
- !ruby/object:Gem::Version
|
43
37
|
version: '2.3'
|
44
|
-
- - ! '>='
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
version: 2.3.0
|
47
38
|
type: :runtime
|
48
39
|
prerelease: false
|
49
40
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -52,9 +43,6 @@ dependencies:
|
|
52
43
|
- - ~>
|
53
44
|
- !ruby/object:Gem::Version
|
54
45
|
version: '2.3'
|
55
|
-
- - ! '>='
|
56
|
-
- !ruby/object:Gem::Version
|
57
|
-
version: 2.3.0
|
58
46
|
- !ruby/object:Gem::Dependency
|
59
47
|
name: multi_json
|
60
48
|
requirement: !ruby/object:Gem::Requirement
|
@@ -63,9 +51,6 @@ dependencies:
|
|
63
51
|
- - ~>
|
64
52
|
- !ruby/object:Gem::Version
|
65
53
|
version: '1.9'
|
66
|
-
- - ! '>='
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: 1.9.0
|
69
54
|
type: :runtime
|
70
55
|
prerelease: false
|
71
56
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -74,9 +59,6 @@ dependencies:
|
|
74
59
|
- - ~>
|
75
60
|
- !ruby/object:Gem::Version
|
76
61
|
version: '1.9'
|
77
|
-
- - ! '>='
|
78
|
-
- !ruby/object:Gem::Version
|
79
|
-
version: 1.9.0
|
80
62
|
- !ruby/object:Gem::Dependency
|
81
63
|
name: bundler
|
82
64
|
requirement: !ruby/object:Gem::Requirement
|
@@ -101,9 +83,6 @@ dependencies:
|
|
101
83
|
- - ~>
|
102
84
|
- !ruby/object:Gem::Version
|
103
85
|
version: '10.1'
|
104
|
-
- - ! '>='
|
105
|
-
- !ruby/object:Gem::Version
|
106
|
-
version: 10.1.0
|
107
86
|
type: :development
|
108
87
|
prerelease: false
|
109
88
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -112,9 +91,6 @@ dependencies:
|
|
112
91
|
- - ~>
|
113
92
|
- !ruby/object:Gem::Version
|
114
93
|
version: '10.1'
|
115
|
-
- - ! '>='
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: 10.1.0
|
118
94
|
- !ruby/object:Gem::Dependency
|
119
95
|
name: rspec
|
120
96
|
requirement: !ruby/object:Gem::Requirement
|
@@ -122,10 +98,7 @@ dependencies:
|
|
122
98
|
requirements:
|
123
99
|
- - ~>
|
124
100
|
- !ruby/object:Gem::Version
|
125
|
-
version:
|
126
|
-
- - ! '>='
|
127
|
-
- !ruby/object:Gem::Version
|
128
|
-
version: 2.14.0
|
101
|
+
version: 3.0.0.beta
|
129
102
|
type: :development
|
130
103
|
prerelease: false
|
131
104
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -133,10 +106,7 @@ dependencies:
|
|
133
106
|
requirements:
|
134
107
|
- - ~>
|
135
108
|
- !ruby/object:Gem::Version
|
136
|
-
version:
|
137
|
-
- - ! '>='
|
138
|
-
- !ruby/object:Gem::Version
|
139
|
-
version: 2.14.0
|
109
|
+
version: 3.0.0.beta
|
140
110
|
- !ruby/object:Gem::Dependency
|
141
111
|
name: webmock
|
142
112
|
requirement: !ruby/object:Gem::Requirement
|
@@ -145,9 +115,6 @@ dependencies:
|
|
145
115
|
- - ~>
|
146
116
|
- !ruby/object:Gem::Version
|
147
117
|
version: '1.16'
|
148
|
-
- - ! '>='
|
149
|
-
- !ruby/object:Gem::Version
|
150
|
-
version: 1.16.0
|
151
118
|
type: :development
|
152
119
|
prerelease: false
|
153
120
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -156,9 +123,22 @@ dependencies:
|
|
156
123
|
- - ~>
|
157
124
|
- !ruby/object:Gem::Version
|
158
125
|
version: '1.16'
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: rspec-collection_matchers
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
130
|
+
requirements:
|
131
|
+
- - ! '>='
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
134
|
+
type: :development
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
159
139
|
- - ! '>='
|
160
140
|
- !ruby/object:Gem::Version
|
161
|
-
version:
|
141
|
+
version: '0'
|
162
142
|
description: An easy to use interface for REST APIs that use HAL.
|
163
143
|
email:
|
164
144
|
- pezra@barelyenough.org
|
@@ -178,11 +158,13 @@ files:
|
|
178
158
|
- lib/hal_client/collection.rb
|
179
159
|
- lib/hal_client/curie_resolver.rb
|
180
160
|
- lib/hal_client/errors.rb
|
161
|
+
- lib/hal_client/links_section.rb
|
181
162
|
- lib/hal_client/representation.rb
|
182
163
|
- lib/hal_client/representation_set.rb
|
183
164
|
- lib/hal_client/version.rb
|
184
165
|
- spec/hal_client/collection_spec.rb
|
185
166
|
- spec/hal_client/curie_resolver_spec.rb
|
167
|
+
- spec/hal_client/links_section_spec.rb
|
186
168
|
- spec/hal_client/representation_set_spec.rb
|
187
169
|
- spec/hal_client/representation_spec.rb
|
188
170
|
- spec/hal_client_spec.rb
|
@@ -202,7 +184,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
202
184
|
version: '0'
|
203
185
|
segments:
|
204
186
|
- 0
|
205
|
-
hash: -
|
187
|
+
hash: -1767932783931261453
|
206
188
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
207
189
|
none: false
|
208
190
|
requirements:
|
@@ -211,7 +193,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
211
193
|
version: '0'
|
212
194
|
segments:
|
213
195
|
- 0
|
214
|
-
hash: -
|
196
|
+
hash: -1767932783931261453
|
215
197
|
requirements: []
|
216
198
|
rubyforge_project:
|
217
199
|
rubygems_version: 1.8.23
|
@@ -221,6 +203,7 @@ summary: Use HAL APIs easily
|
|
221
203
|
test_files:
|
222
204
|
- spec/hal_client/collection_spec.rb
|
223
205
|
- spec/hal_client/curie_resolver_spec.rb
|
206
|
+
- spec/hal_client/links_section_spec.rb
|
224
207
|
- spec/hal_client/representation_set_spec.rb
|
225
208
|
- spec/hal_client/representation_spec.rb
|
226
209
|
- spec/hal_client_spec.rb
|