ldp 0.6.4 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -3
- data/README.md +3 -0
- data/lib/ldp/resource.rb +1 -1
- data/lib/ldp/resource/rdf_source.rb +11 -9
- data/lib/ldp/version.rb +1 -1
- data/spec/lib/ldp/resource/rdf_source_spec.rb +2 -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: f2edbca8909c350df3c7cd926b2e6883758dca0d
|
4
|
+
data.tar.gz: fd62a1e0f8a9cf283da1d8b7e3e2ed0ed70aaf13
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f93b786c175a70ed809b172c91109902387d2113e0f4254048724417e63e2a0fa3802f530a7738c9ddfbb37d1b86c2bd8adbe07ef1bdf8762a015ba2673255ae
|
7
|
+
data.tar.gz: a3a06bd9aab2f518eb5cd3ab37eae4e9ed7042eb7b88eea5a6f1aba08c118b08bffcb1fb4f71dc9268f73bd0aa3eebf0a496f403501dcb12f8626655aac57abc
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
# Ldp.rb
|
2
2
|
|
3
3
|
[![Build Status](https://travis-ci.org/projecthydra/ldp.png?branch=master)](https://travis-ci.org/projecthydra/ldp)
|
4
|
+
[![Version](https://badge.fury.io/rb/ldp.png)](http://badge.fury.io/rb/ldp)
|
5
|
+
[![Dependencies](https://gemnasium.com/projecthydra/ldp.png)](https://gemnasium.com/projecthydra/ldp)
|
6
|
+
[![Coverage Status](https://coveralls.io/repos/github/projecthydra/ldp/badge.svg?branch=master)](https://coveralls.io/github/projecthydra/ldp?branch=master)
|
4
7
|
|
5
8
|
Linked Data Platform client library for Ruby
|
6
9
|
|
data/lib/ldp/resource.rb
CHANGED
@@ -27,7 +27,17 @@ module Ldp
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def graph
|
30
|
-
@graph ||=
|
30
|
+
@graph ||= begin
|
31
|
+
if subject.nil?
|
32
|
+
build_empty_graph
|
33
|
+
else
|
34
|
+
filtered_graph(response_graph)
|
35
|
+
end
|
36
|
+
rescue Ldp::NotFound
|
37
|
+
# This is an optimization that lets us avoid doing HEAD + GET
|
38
|
+
# when the object exists. We just need to handle the 404 case
|
39
|
+
build_empty_graph
|
40
|
+
end
|
31
41
|
end
|
32
42
|
|
33
43
|
def build_empty_graph
|
@@ -49,14 +59,6 @@ module Ldp
|
|
49
59
|
@response_graph ||= response_as_graph(get)
|
50
60
|
end
|
51
61
|
|
52
|
-
# Get the body and ensure it's UTF-8 encoded. Since Fedora 9.3 isn't
|
53
|
-
# returning a charset, then Net::HTTP is just returning ASCII-8BIT
|
54
|
-
# See https://github.com/ruby-rdf/rdf-turtle/issues/13
|
55
|
-
# See https://jira.duraspace.org/browse/FCREPO-1750
|
56
|
-
def body
|
57
|
-
body.force_encoding('utf-8')
|
58
|
-
end
|
59
|
-
|
60
62
|
protected
|
61
63
|
|
62
64
|
def interaction_model
|
data/lib/ldp/version.rb
CHANGED
@@ -17,6 +17,7 @@ describe Ldp::Resource::RdfSource do
|
|
17
17
|
stub.post("/") { [201]}
|
18
18
|
stub.put("/abs_url_object") { [201]}
|
19
19
|
stub.head("/abs_url_object") {[404]}
|
20
|
+
stub.get("/abs_url_object") {[404]}
|
20
21
|
stub.head("/existing_object") {[200, {'Content-Type'=>'text/turtle'}]}
|
21
22
|
stub.get("/existing_object") {[200, {'Content-Type'=>'text/turtle'}, simple_graph_source]}
|
22
23
|
end
|
@@ -102,7 +103,7 @@ describe Ldp::Resource::RdfSource do
|
|
102
103
|
end
|
103
104
|
context 'for an existing object' do
|
104
105
|
subject { Ldp::Resource::RdfSource.new mock_client, "http://my.ldp.server/existing_object" }
|
105
|
-
it do
|
106
|
+
it do
|
106
107
|
expect(subject.graph.size).to eql(1)
|
107
108
|
end
|
108
109
|
end
|
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.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Beer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -268,7 +268,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
268
268
|
version: '0'
|
269
269
|
requirements: []
|
270
270
|
rubyforge_project:
|
271
|
-
rubygems_version: 2.6.
|
271
|
+
rubygems_version: 2.6.12
|
272
272
|
signing_key:
|
273
273
|
specification_version: 4
|
274
274
|
summary: Linked Data Platform client library
|