ldp 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ldp.rb +1 -0
- data/lib/ldp/client/methods.rb +8 -2
- data/lib/ldp/orm.rb +1 -4
- data/lib/ldp/version.rb +1 -1
- data/spec/lib/ldp/orm/orm_spec.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c435d58f60d41a302a24df4ebf7f3bd9323d87d8
|
4
|
+
data.tar.gz: 25e877748727f653488862222cee9aebbca30046
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 732e238782ff1a21407b629bc54a13ba63f621b6494fcde36d9d2b637e5562c946573108e852c3e2746e928a1afb35ece225a7a2d2879e78c872688a157c6f8e
|
7
|
+
data.tar.gz: 0149eaba7795e019401075761dfa9adfe5ad9b2496153e271c4753cb32d8d62017c922d1681bd1c3b6af946928d01038d3d8deb3071c7db4bef0e4dc84fc5ef8
|
data/lib/ldp.rb
CHANGED
data/lib/ldp/client/methods.rb
CHANGED
@@ -104,8 +104,14 @@ module Ldp::Client::Methods
|
|
104
104
|
def check_for_errors resp
|
105
105
|
resp.tap do |resp|
|
106
106
|
unless resp.success?
|
107
|
-
raise
|
108
|
-
|
107
|
+
raise case resp.status
|
108
|
+
when 404
|
109
|
+
Ldp::NotFound.new(resp.body) if resp.status == 404
|
110
|
+
when 412
|
111
|
+
Ldp::EtagMismatch.new(resp.body) if resp.status == 412
|
112
|
+
else
|
113
|
+
Ldp::HttpError.new("STATUS: #{resp.status} #{resp.body[0, 1000]}...")
|
114
|
+
end
|
109
115
|
end
|
110
116
|
end
|
111
117
|
end
|
data/lib/ldp/orm.rb
CHANGED
@@ -69,7 +69,7 @@ module Ldp
|
|
69
69
|
if result.is_a? RDF::Graph
|
70
70
|
raise GraphDifferenceException.new "", result
|
71
71
|
elsif !result
|
72
|
-
raise
|
72
|
+
raise @last_response
|
73
73
|
end
|
74
74
|
|
75
75
|
result
|
@@ -103,7 +103,4 @@ module Ldp
|
|
103
103
|
@diff = diff
|
104
104
|
end
|
105
105
|
end
|
106
|
-
|
107
|
-
class SaveException < RuntimeError
|
108
|
-
end
|
109
106
|
end
|
data/lib/ldp/version.rb
CHANGED
@@ -67,7 +67,7 @@ describe Ldp::Orm do
|
|
67
67
|
it "should raise an exception if the ETag didn't match" do
|
68
68
|
conn_stubs.instance_variable_get(:@stack)[:put] = [] # erases the stubs for :put
|
69
69
|
conn_stubs.put('/a_resource') {[412, {}, "Bad If-Match header value: 'ae43aa934dc4f4e15ea1b4dd1ca7a56791972836'"]}
|
70
|
-
expect { subject.save! }.to raise_exception(Ldp::
|
70
|
+
expect { subject.save! }.to raise_exception(Ldp::EtagMismatch, "Bad If-Match header value: 'ae43aa934dc4f4e15ea1b4dd1ca7a56791972836'")
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ldp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Beer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -166,7 +166,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
166
166
|
version: '0'
|
167
167
|
requirements: []
|
168
168
|
rubyforge_project:
|
169
|
-
rubygems_version: 2.
|
169
|
+
rubygems_version: 2.4.1
|
170
170
|
signing_key:
|
171
171
|
specification_version: 4
|
172
172
|
summary: Linked Data Platform client library
|