jekyll-rdf 2.1.0.alpha.pre.186 → 2.1.0.alpha.pre.194

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: 05c71bb1e8c3429261cc2f0751ce88548d7c3163
4
- data.tar.gz: 02fef96d8ea857b7ee5363a53bfa814c0a36ae9f
3
+ metadata.gz: 78d39e5cd1af8bc2a7ec53b5e048c651b061b822
4
+ data.tar.gz: b935903c86930ab76c5e41a96a62a4a768ed0696
5
5
  SHA512:
6
- metadata.gz: deb188f104ce4f767c84c65eea1d3a6485a7785356e67cf6ca5350f4e603e9b9685ba65555e0e23e47eaf87be902698524f37dd2b1dd39eed0995670083bbf82
7
- data.tar.gz: 3dbaa044e5d3a5ebaf43b194cf483e031fd467038a5e25162fa6103975a4ac8e21801f68665ba2c58f724d09b80baa653b96d03d8ca0d3b271ad48aa31b01b38
6
+ metadata.gz: 056948f57a367d4977e88acdef8bbcb5e54bf53f82bc2638ad7d57b6e54a26f4127cf35c4c60df79cf6c79bd4db8a28481e4bef677d6d9c067bc424e9dd87ed5
7
+ data.tar.gz: 28c850a074b305d25385c3beb8c7fab3c01b3ceb094449ab4334fd80421621b4c6c164c770be9fb62050e4347983a5268205e2e88dc0a38b194af853f09fe34a
@@ -214,38 +214,40 @@ module Jekyll #:nodoc:
214
214
  file_name = "rdfsites/blanknode/#{term.to_s}/"
215
215
  else
216
216
  begin
217
- uri = URI::split(term.to_s)
217
+ uri = Addressable::URI.parse(term.to_s).to_hash
218
218
  file_name = "rdfsites/" # in this directory all external RDF sites are stored
219
- if (uri[2] == domain_name)
219
+ if (uri[:host] == domain_name)
220
220
  file_name = ""
221
- uri[0] = nil
222
- uri[2] = nil
223
- if(uri[5].length > baseurl.length)
224
- if(uri[5][0..(baseurl.length)].eql? (baseurl + "/"))
225
- uri[5] = uri[5][(baseurl.length)..-1]
221
+ uri[:scheme] = nil
222
+ uri[:host] = nil
223
+ if(uri[:path].length > baseurl.length)
224
+ if(uri[:path][0..(baseurl.length)].eql? (baseurl + "/"))
225
+ uri[:path] = uri[:path][(baseurl.length)..-1]
226
226
  end
227
- elsif(uri[5].eql?(baseurl))
228
- uri[5] = nil
227
+ elsif(uri[:path].eql?(baseurl))
228
+ uri[:path] = nil
229
229
  end
230
230
  end
231
- (0..8).each do |i|
232
- if !(uri[i].nil?)
233
- case i
234
- when 5
235
- file_name += "#{uri[i][1..-1]}/"
236
- when 8
237
- file_name += "#/#{uri[i]}"
231
+ key_field = [:scheme, :userinfo, :host, :port, :registry, :path, :opaque, :query, :fragment]
232
+ key_field.each do |index|
233
+ if !(uri[index].nil?)
234
+ case index
235
+ when :path
236
+ file_name += "#{uri[index][1..-1]}/"
237
+ when :fragment
238
+ file_name += "#/#{uri[index]}"
238
239
  else
239
- file_name += "#{uri[i]}/"
240
+ file_name += "#{uri[index]}/"
240
241
  end
241
242
  end
242
243
  end
243
244
  unless file_name[-1] == '/'
244
245
  file_name += '/'
245
246
  end
246
- rescue URI::InvalidURIError #unclean coding: blanknodes are recognized through errors
247
+ rescue URI::InvalidURIError => x #unclean coding: blanknodes are recognized through errors
247
248
  file_name = "invalids/#{term.to_s}"
248
249
  Jekyll.logger.error("Invalid resource found: #{term.to_s} is not a proper uri")
250
+ Jekyll.logger.error("URI parser exited with message: #{x.message}")
249
251
  end
250
252
  end
251
253
  file_name = file_name.gsub('_','_u')
@@ -259,7 +261,6 @@ module Jekyll #:nodoc:
259
261
  @render_path = file_name
260
262
  file_name
261
263
  end
262
-
263
264
  end
264
265
  end
265
266
  end
data/lib/jekyll-rdf.rb CHANGED
@@ -30,6 +30,8 @@ require 'jekyll'
30
30
  require 'linkeddata'
31
31
  require 'sparql'
32
32
  require 'set'
33
+ require 'addressable/uri'
34
+ require 'pp'
33
35
 
34
36
  require 'jekyll/drops/rdf_term'
35
37
  require 'jekyll/drops/rdf_statement'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-rdf
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0.alpha.pre.186
4
+ version: 2.1.0.alpha.pre.194
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elias Saalmann
@@ -16,7 +16,7 @@ authors:
16
16
  autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
- date: 2017-07-14 00:00:00.000000000 Z
19
+ date: 2017-07-18 00:00:00.000000000 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: linkeddata