ldp 0.7.0 → 0.7.1
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 +5 -5
- data/.travis.yml +8 -2
- data/README.md +8 -8
- data/lib/ldp/response.rb +12 -3
- data/lib/ldp/version.rb +1 -1
- data/spec/lib/ldp/response_spec.rb +4 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 25f60476bce9b0fdb0d082e3d202c3ad8e367edc08b8e8f8aa270f49055c74b0
|
4
|
+
data.tar.gz: 155cd50f61a3f90e2cb5c67da8403ff6df6db88daa8d50bc7aa7c8d52a025173
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30a830279a5739a019a4e219cc5437eed319a1cd38cbfcffe9a8485ae2fc7a14a244114d2b8836df7b76153b86bcfbff2e17ad6f1d8db4b2b7fec6a01cad76d9
|
7
|
+
data.tar.gz: cb414d1085f92f3e1e8737d52c75c9ad1051cba4d3a19f4c040a744d7ab16ae2f91d5bc0cdebcd921024f40944196f323f1c40fb324b9094c6ed7b71170f009b
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# Ldp.rb
|
2
2
|
|
3
|
-
[](https://travis-ci.org/samvera/ldp)
|
4
4
|
[](http://badge.fury.io/rb/ldp)
|
5
|
-
[](https://gemnasium.com/samvera/ldp)
|
6
|
+
[](https://coveralls.io/github/samvera/ldp?branch=master)
|
7
7
|
|
8
8
|
Linked Data Platform client library for Ruby
|
9
9
|
|
@@ -42,8 +42,8 @@ orm.save
|
|
42
42
|
|
43
43
|
### Fedora Commons notes
|
44
44
|
Due to some discrepancies with alpha version of Fedora Commons, you may need to do some things differently:
|
45
|
-
* [Can't load resources from Fedora 4](https://github.com/
|
46
|
-
* [orm.save with an rdf:type doesn't work with Fedora 4.0.0-alpha-3](https://github.com/
|
45
|
+
* [Can't load resources from Fedora 4](https://github.com/samvera/ldp/issues/1)
|
46
|
+
* [orm.save with an rdf:type doesn't work with Fedora 4.0.0-alpha-3](https://github.com/samvera/ldp/issues/2)
|
47
47
|
|
48
48
|
## Contributing
|
49
49
|
|
@@ -53,8 +53,8 @@ Due to some discrepancies with alpha version of Fedora Commons, you may need to
|
|
53
53
|
4. Push to the branch (`git push origin my-new-feature`)
|
54
54
|
5. Create new Pull Request
|
55
55
|
|
56
|
-
#
|
56
|
+
# Samvera
|
57
57
|
This software has been developed by and is brought to you by the Hydra community. Learn more at the
|
58
|
-
[
|
58
|
+
[Samvera website](http://samvera.org)
|
59
59
|
|
60
|
-

|
data/lib/ldp/response.rb
CHANGED
@@ -154,7 +154,7 @@ module Ldp
|
|
154
154
|
# Statements about the page
|
155
155
|
def page
|
156
156
|
@page_graph ||= begin
|
157
|
-
g = RDF::Graph.new
|
157
|
+
g = RDF::Graph.new
|
158
158
|
|
159
159
|
if resource?
|
160
160
|
res = graph.query RDF::Statement.new(page_subject, nil, nil)
|
@@ -199,12 +199,21 @@ module Ldp
|
|
199
199
|
end
|
200
200
|
|
201
201
|
def content_disposition_filename
|
202
|
-
|
203
|
-
URI.decode(
|
202
|
+
filename = content_disposition_attributes['filename']
|
203
|
+
URI.decode(filename) if filename
|
204
204
|
end
|
205
205
|
|
206
206
|
private
|
207
207
|
|
208
|
+
def content_disposition_attributes
|
209
|
+
parts = headers['Content-Disposition'].split(/;\s*/).collect { |entry| entry.split(/\s*=\s*/) }
|
210
|
+
entries = parts.collect do |part|
|
211
|
+
value = part[1].respond_to?(:sub) ? part[1].sub(%r{^"(.+)"$}, '\1') : part[1]
|
212
|
+
[part[0], value]
|
213
|
+
end
|
214
|
+
Hash[entries]
|
215
|
+
end
|
216
|
+
|
208
217
|
def headers
|
209
218
|
response.headers
|
210
219
|
end
|
data/lib/ldp/version.rb
CHANGED
@@ -199,12 +199,14 @@ describe Ldp::Response do
|
|
199
199
|
describe '#content_disposition_filename' do
|
200
200
|
before do
|
201
201
|
allow(mock_response).to receive(:headers).and_return(
|
202
|
-
'Content-Disposition' => 'filename="xyz.txt";'
|
202
|
+
{ 'Content-Disposition' => 'filename="xyz.txt";' },
|
203
|
+
{ 'Content-Disposition' => 'attachment; filename=xyz.txt' },
|
204
|
+
{ 'Content-Disposition' => 'attachment; filename="xyz.txt"; size="12345"' },
|
203
205
|
)
|
204
206
|
end
|
205
207
|
|
206
208
|
it 'provides the filename from the content disposition header' do
|
207
|
-
expect(subject.content_disposition_filename).to eq 'xyz.txt'
|
209
|
+
3.times { expect(subject.content_disposition_filename).to eq 'xyz.txt' }
|
208
210
|
end
|
209
211
|
end
|
210
212
|
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.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Beer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-03-13 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.
|
271
|
+
rubygems_version: 2.7.3
|
272
272
|
signing_key:
|
273
273
|
specification_version: 4
|
274
274
|
summary: Linked Data Platform client library
|