ldp 0.6.4 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6c9572b864b81901aa96938e005067a143a02304
4
- data.tar.gz: c445078867b6a3e1a7443a97f92664c6fd281398
3
+ metadata.gz: f2edbca8909c350df3c7cd926b2e6883758dca0d
4
+ data.tar.gz: fd62a1e0f8a9cf283da1d8b7e3e2ed0ed70aaf13
5
5
  SHA512:
6
- metadata.gz: 7ed4e30b6127803dca0e85348894e896082636bbb4441b83636fd83100267af5c01718f71782a34f5edde0a42b6ecb5c6b3efbaa39f384402c835dbc58d41abc
7
- data.tar.gz: d541f160218cb123eab2a9ca7b236d6f0d6d4c72dc4c6931bbe6d7e50eb5bd520cb66423782b1cdb4b8755534ae4f49a19456f62846f2977d8a436232af546ea
6
+ metadata.gz: f93b786c175a70ed809b172c91109902387d2113e0f4254048724417e63e2a0fa3802f530a7738c9ddfbb37d1b86c2bd8adbe07ef1bdf8762a015ba2673255ae
7
+ data.tar.gz: a3a06bd9aab2f518eb5cd3ab37eae4e9ed7042eb7b88eea5a6f1aba08c118b08bffcb1fb4f71dc9268f73bd0aa3eebf0a496f403501dcb12f8626655aac57abc
@@ -9,6 +9,6 @@ env:
9
9
  global:
10
10
  - NOKOGIRI_USE_SYSTEM_LIBRARIES=true
11
11
  rvm:
12
- - 2.4.0
13
- - 2.3.3
14
- - jruby-9.0.5.0
12
+ - 2.4.1
13
+ - 2.3.4
14
+ - jruby-9.1.8.0
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
 
@@ -6,7 +6,7 @@ module Ldp
6
6
  attr_reader :client, :subject
7
7
  attr_accessor :content
8
8
 
9
- def self.for(client, subject, response = nil)
9
+ def self.for(client, subject, response)
10
10
  case
11
11
  when response.container?
12
12
  Ldp::Container.for client, subject, response
@@ -27,7 +27,17 @@ module Ldp
27
27
  end
28
28
 
29
29
  def graph
30
- @graph ||= new? ? build_empty_graph : filtered_graph(response_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
@@ -1,3 +1,3 @@
1
1
  module Ldp
2
- VERSION = "0.6.4"
2
+ VERSION = "0.7.0"
3
3
  end
@@ -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.6.4
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-02-13 00:00:00.000000000 Z
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.8
271
+ rubygems_version: 2.6.12
272
272
  signing_key:
273
273
  specification_version: 4
274
274
  summary: Linked Data Platform client library