ldp 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3a68882c3e0ea6d21e3819d632a92e88734bec0f
4
- data.tar.gz: a3f31f5e16fc2a60b109bef5f7da218ad008e949
3
+ metadata.gz: 242a8bac0d570bda5387a6883f122078b33be099
4
+ data.tar.gz: 3313163cca6a9daab1e152ab4712c1c0f507a4a0
5
5
  SHA512:
6
- metadata.gz: 4111cddaaccda626e39b8ba24619763ca217f97915855ba2fb936e7fcb7ba1f9d6afc78d268393f7c3a67128d6427a0a41f99b2d24d2f09d41e287e5aa1f1ae0
7
- data.tar.gz: 173b2d3954e4aa0184a5d87916c637c8348fe185ad561b51cdc28b844d81c14bf820bcdac27551d097f6ccf348c35eaf5c49d20759741ce3cf64571f963dd133
6
+ metadata.gz: a4ae6556d98e34e2852930d54148a65ee35daa122e11681013d6481b2ba8685a730788d8643c315c78091175c54fbd39634b4f3b868b00bcec4072ab34f4a1bb
7
+ data.tar.gz: dfdb01e0843f5bb894f1a1a83a8acfe46bb3e12c151283574bcede9eaaf11b2d1f09b182c7cebdad8f801756b66698b00fed319c4622d117fd7ed086e9433cd4
@@ -11,5 +11,4 @@ env:
11
11
  rvm:
12
12
  - 2.3.0
13
13
  - 2.2.4
14
- - 2.1.8
15
14
  - jruby-9.0.5.0
data/Gemfile CHANGED
@@ -6,5 +6,5 @@ gemspec
6
6
  gem 'slop', '~> 3.6' if RUBY_PLATFORM == "java"
7
7
  gem 'byebug', platforms: [:mri]
8
8
  gem 'activesupport'
9
- gem 'capybara_discoball'
10
- gem 'derby'
9
+ gem 'capybara_discoball', '~> 0.0.2'
10
+ gem 'derby', '~> 0.1.0'
@@ -20,8 +20,11 @@ Gem::Specification.new do |spec|
20
20
  spec.require_paths = ["lib"]
21
21
 
22
22
  spec.add_dependency "faraday"
23
- spec.add_dependency "linkeddata", ">= 1.1"
24
- spec.add_dependency "rdf-vocab"
23
+ spec.add_dependency "rdf", ">= 1.1"
24
+ spec.add_dependency "rdf-turtle"
25
+ spec.add_dependency "rdf-vocab", ">= 0.8"
26
+ spec.add_dependency "rdf-isomorphic"
27
+ spec.add_dependency "json-ld"
25
28
  spec.add_dependency "http_logger"
26
29
  spec.add_dependency "deprecation"
27
30
  spec.add_dependency "slop"
data/lib/ldp.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  require 'ldp/version'
2
- require 'linkeddata'
2
+ require 'rdf/turtle'
3
+ require 'json/ld'
4
+ require 'rdf/isomorphic'
3
5
  require 'rdf/vocab/ldp'
4
6
  require 'logger'
5
7
  require 'singleton'
@@ -132,7 +132,7 @@ module Ldp::Client::Methods
132
132
  when 410
133
133
  Ldp::Gone.new(resp.body)
134
134
  when 412
135
- Ldp::EtagMismatch.new(resp.body)
135
+ Ldp::PreconditionFailed.new(resp.body)
136
136
  else
137
137
  Ldp::HttpError.new("STATUS: #{resp.status} #{resp.body[0, 1000]}...")
138
138
  end
@@ -1,12 +1,12 @@
1
1
  module Ldp
2
2
  class Error < StandardError; end
3
3
 
4
- class HttpError < RuntimeError; end
5
- class BadRequest < HttpError; end # 400
6
- class NotFound < HttpError; end # 404
7
- class Conflict < HttpError; end # 409
8
- class Gone < HttpError; end # 410
9
- class EtagMismatch < HttpError; end # 412
4
+ class HttpError < RuntimeError; end
5
+ class BadRequest < HttpError; end # 400
6
+ class NotFound < HttpError; end # 404
7
+ class Conflict < HttpError; end # 409
8
+ class Gone < HttpError; end # 410
9
+ class PreconditionFailed < HttpError; end # 412
10
10
 
11
11
  class UnexpectedContentType < RuntimeError; end
12
12
 
@@ -17,4 +17,6 @@ module Ldp
17
17
  @diff = diff
18
18
  end
19
19
  end
20
+
21
+ ETagMismatch = PreconditionFailed # deprecation
20
22
  end
@@ -1,3 +1,3 @@
1
1
  module Ldp
2
- VERSION = "0.5.0"
2
+ VERSION = "0.6.0"
3
3
  end
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
  describe "Ldp::Client" do
3
3
 
4
4
  let(:simple_graph) do
5
- graph = RDF::Graph.new << [RDF::URI.new(""), RDF::DC.title, "Hello, world!"]
5
+ graph = RDF::Graph.new << [RDF::URI.new(""), RDF::Vocab::DC.title, "Hello, world!"]
6
6
  graph.dump(:ttl)
7
7
  end
8
8
 
@@ -236,7 +236,7 @@ describe "Ldp::Client" do
236
236
  end
237
237
 
238
238
  it "checks for 412 errors" do
239
- expect { subject.put "mismatch_resource", "some-payload" }.to raise_error Ldp::EtagMismatch
239
+ expect { subject.put "mismatch_resource", "some-payload" }.to raise_error Ldp::PreconditionFailed
240
240
  end
241
241
  end
242
242
 
@@ -4,7 +4,7 @@ describe Ldp::Orm do
4
4
  subject { Ldp::Orm.new test_resource }
5
5
 
6
6
  let(:simple_graph) do
7
- RDF::Graph.new << [RDF::URI.new(""), RDF::DC.title, "Hello, world!"]
7
+ RDF::Graph.new << [RDF::URI.new(""), RDF::Vocab::DC.title, "Hello, world!"]
8
8
  end
9
9
 
10
10
  let(:conn_stubs) do
@@ -67,19 +67,19 @@ 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::EtagMismatch, "Bad If-Match header value: 'ae43aa934dc4f4e15ea1b4dd1ca7a56791972836'")
70
+ expect { subject.save! }.to raise_exception(Ldp::PreconditionFailed, "Bad If-Match header value: 'ae43aa934dc4f4e15ea1b4dd1ca7a56791972836'")
71
71
  end
72
72
  end
73
73
 
74
74
  describe "#value" do
75
75
  it "should provide a convenience method for retrieving values" do
76
- expect(subject.value(RDF::DC.title).first.to_s).to eq "Hello, world!"
76
+ expect(subject.value(RDF::Vocab::DC.title).first.to_s).to eq "Hello, world!"
77
77
  end
78
78
  end
79
79
 
80
80
  describe "#reload" do
81
81
  before do
82
- updated_graph = RDF::Graph.new << [RDF::URI.new(""), RDF::DC.title, "Hello again, world!"]
82
+ updated_graph = RDF::Graph.new << [RDF::URI.new(""), RDF::Vocab::DC.title, "Hello again, world!"]
83
83
  conn_stubs.get('/a_resource') {[200,
84
84
  {"Link" => "<http://www.w3.org/ns/ldp#Resource>;rel=\"type\", <http://www.w3.org/ns/ldp#DirectContainer>;rel=\"type\"",
85
85
  "ETag" => "new-tag"},
@@ -87,9 +87,9 @@ describe Ldp::Orm do
87
87
  end
88
88
 
89
89
  it "loads the new values" do
90
- old_value = subject.value(RDF::DC.title).first.to_s
90
+ old_value = subject.value(RDF::Vocab::DC.title).first.to_s
91
91
  reloaded = subject.reload
92
- expect(reloaded.value(RDF::DC.title).first.to_s).not_to eq old_value
92
+ expect(reloaded.value(RDF::Vocab::DC.title).first.to_s).not_to eq old_value
93
93
  end
94
94
 
95
95
  it "uses the new ETag" do
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
 
4
4
  describe Ldp::Resource::RdfSource do
5
5
  let(:simple_graph) do
6
- RDF::Graph.new << [RDF::URI.new(), RDF::DC.title, "Hello, world!"]
6
+ RDF::Graph.new << [RDF::URI.new(), RDF::Vocab::DC.title, "Hello, world!"]
7
7
  end
8
8
 
9
9
  let(:simple_graph_source) do
@@ -4,10 +4,10 @@ $LOAD_PATH.unshift(File.dirname(__FILE__))
4
4
  require 'simplecov'
5
5
  require 'coveralls'
6
6
 
7
- SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
8
- SimpleCov::Formatter::HTMLFormatter,
9
- Coveralls::SimpleCov::Formatter
10
- ]
7
+ SimpleCov.formatter =
8
+ SimpleCov::Formatter::MultiFormatter.new([SimpleCov::Formatter::HTMLFormatter,
9
+ Coveralls::SimpleCov::Formatter])
10
+
11
11
  SimpleCov.start do
12
12
  add_filter 'spec/'
13
13
  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.5.0
4
+ version: 0.6.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: 2016-03-08 00:00:00.000000000 Z
11
+ date: 2016-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -25,7 +25,7 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: linkeddata
28
+ name: rdf
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
@@ -38,8 +38,50 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.1'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rdf-turtle
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: rdf-vocab
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0.8'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0.8'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rdf-isomorphic
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: json-ld
43
85
  requirement: !ruby/object:Gem::Requirement
44
86
  requirements:
45
87
  - - ">="
@@ -225,7 +267,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
225
267
  version: '0'
226
268
  requirements: []
227
269
  rubyforge_project:
228
- rubygems_version: 2.4.5.1
270
+ rubygems_version: 2.5.1
229
271
  signing_key:
230
272
  specification_version: 4
231
273
  summary: Linked Data Platform client library