hal-client 4.3.0 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/lib/hal_client/representation_editor.rb +1 -0
- data/lib/hal_client/version.rb +1 -1
- data/spec/hal_client/representation_editor_spec.rb +8 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c3528fbb7facf2ddaaf7cab9634d158b385edc3
|
4
|
+
data.tar.gz: c67b245256c4d41e8f859bfa90c0b2b14c58e450
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 296b8c5870795fb49c223bde5526ac3d2be9a9e506545919910752fb28bde495048e33bca1f24c4b88108c5ffbb127d328ac02f9e7752675ee3a2fbf017bcb53
|
7
|
+
data.tar.gz: 612db56ad0eb2dae52f6fd26004349d6d55bb2ec08471a645c6eafcb89e841ee79e95ef616e42935fbf236e0cefaf3e5eea2b40460e57f0cb4c2c10f69b853fb
|
data/README.md
CHANGED
@@ -188,6 +188,10 @@ Or install it yourself as:
|
|
188
188
|
|
189
189
|
$ gem install hal-client
|
190
190
|
|
191
|
+
## Upgrading from 4.x to 5.x
|
192
|
+
|
193
|
+
`HalClient::RepresentationEditor#add_link` now raises if passed nil or empty values. This is the only breaking change.
|
194
|
+
|
191
195
|
## Upgrading from 3.x to 4.x
|
192
196
|
|
193
197
|
Support for ruby 2.0 has been removed. Please upgrade to ruby 2.1 or later. No other breaking changes were made.
|
@@ -122,6 +122,7 @@ class HalClient
|
|
122
122
|
# opts
|
123
123
|
# :templated - is this link templated? Default: false
|
124
124
|
def add_link(rel, target, opts={})
|
125
|
+
raise ArgumentError, "target must not be nil or empty" if target.nil? || target.empty?
|
125
126
|
templated = opts.fetch(:templated, false)
|
126
127
|
|
127
128
|
link_obj = { "href" => target.to_s }
|
data/lib/hal_client/version.rb
CHANGED
@@ -122,6 +122,14 @@ RSpec.describe HalClient::RepresentationEditor do
|
|
122
122
|
.and have_link("about", with_href("http://example.com/another"))
|
123
123
|
end
|
124
124
|
|
125
|
+
it "raises if target is nil" do
|
126
|
+
expect { subject.add_link("nowhere", nil) }.to raise_error(ArgumentError)
|
127
|
+
end
|
128
|
+
|
129
|
+
it "raises if target is empty" do
|
130
|
+
expect { subject.add_link("nowhere", "") }.to raise_error(ArgumentError)
|
131
|
+
end
|
132
|
+
|
125
133
|
it "adds templated links" do
|
126
134
|
expect(subject.add_link("related", "http://example.com/third{?wat}", templated: true))
|
127
135
|
.to have_link "related", with_href("http://example.com/third{?wat}")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hal-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 5.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-06-
|
11
|
+
date: 2018-06-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http
|