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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: f2edbca8909c350df3c7cd926b2e6883758dca0d
4
- data.tar.gz: fd62a1e0f8a9cf283da1d8b7e3e2ed0ed70aaf13
2
+ SHA256:
3
+ metadata.gz: 25f60476bce9b0fdb0d082e3d202c3ad8e367edc08b8e8f8aa270f49055c74b0
4
+ data.tar.gz: 155cd50f61a3f90e2cb5c67da8403ff6df6db88daa8d50bc7aa7c8d52a025173
5
5
  SHA512:
6
- metadata.gz: f93b786c175a70ed809b172c91109902387d2113e0f4254048724417e63e2a0fa3802f530a7738c9ddfbb37d1b86c2bd8adbe07ef1bdf8762a015ba2673255ae
7
- data.tar.gz: a3a06bd9aab2f518eb5cd3ab37eae4e9ed7042eb7b88eea5a6f1aba08c118b08bffcb1fb4f71dc9268f73bd0aa3eebf0a496f403501dcb12f8626655aac57abc
6
+ metadata.gz: 30a830279a5739a019a4e219cc5437eed319a1cd38cbfcffe9a8485ae2fc7a14a244114d2b8836df7b76153b86bcfbff2e17ad6f1d8db4b2b7fec6a01cad76d9
7
+ data.tar.gz: cb414d1085f92f3e1e8737d52c75c9ad1051cba4d3a19f4c040a744d7ab16ae2f91d5bc0cdebcd921024f40944196f323f1c40fb324b9094c6ed7b71170f009b
@@ -9,6 +9,12 @@ env:
9
9
  global:
10
10
  - NOKOGIRI_USE_SYSTEM_LIBRARIES=true
11
11
  rvm:
12
- - 2.4.1
13
- - 2.3.4
12
+ - ruby-head
13
+ - 2.4
14
+ - 2.3
15
+ - 2.2
14
16
  - jruby-9.1.8.0
17
+
18
+ matrix:
19
+ allow_failures:
20
+ - rvm: ruby-head
data/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # Ldp.rb
2
2
 
3
- [![Build Status](https://travis-ci.org/projecthydra/ldp.png?branch=master)](https://travis-ci.org/projecthydra/ldp)
3
+ [![Build Status](https://travis-ci.org/samvera/ldp.png?branch=master)](https://travis-ci.org/samvera/ldp)
4
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)
5
+ [![Dependencies](https://gemnasium.com/samvera/ldp.png)](https://gemnasium.com/samvera/ldp)
6
+ [![Coverage Status](https://coveralls.io/repos/github/samvera/ldp/badge.svg?branch=master)](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/projecthydra/ldp/issues/1)
46
- * [orm.save with an rdf:type doesn't work with Fedora 4.0.0-alpha-3](https://github.com/projecthydra/ldp/issues/2)
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
- # Project Hydra
56
+ # Samvera
57
57
  This software has been developed by and is brought to you by the Hydra community. Learn more at the
58
- [Project Hydra website](http://projecthydra.org)
58
+ [Samvera website](http://samvera.org)
59
59
 
60
- ![Project Hydra Logo](https://github.com/uvalib/libra-oa/blob/a6564a9e5c13b7873dc883367f5e307bf715d6cf/public/images/powered_by_hydra.png?raw=true)
60
+ ![Samvera Logo](https://wiki.duraspace.org/download/thumbnails/87459292/samvera-fall-font2-200w.png?version=1&modificationDate=1498550535816&api=v2)
@@ -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
- m = headers['Content-Disposition'].match(/filename="(?<filename>[^"]*)";/)
203
- URI.decode(m[:filename]) if m
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
@@ -1,3 +1,3 @@
1
1
  module Ldp
2
- VERSION = "0.7.0"
2
+ VERSION = "0.7.1"
3
3
  end
@@ -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.0
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: 2017-06-12 00:00:00.000000000 Z
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.6.12
271
+ rubygems_version: 2.7.3
272
272
  signing_key:
273
273
  specification_version: 4
274
274
  summary: Linked Data Platform client library