rdf-microdata 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/rdf/microdata/reader.rb +9 -3
  3. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -16,6 +16,12 @@ module RDF::Microdata
16
16
  class CrawlFailure < StandardError #:nodoc:
17
17
  end
18
18
 
19
+ ##
20
+ # Returns the base URI determined by this reader.
21
+ #
22
+ # @attr [RDF::URI]
23
+ attr_reader :base_uri
24
+
19
25
  ##
20
26
  # Initializes the Microdata reader instance.
21
27
  #
@@ -147,7 +153,7 @@ module RDF::Microdata
147
153
  if (base)
148
154
  # Strip any fragment from base
149
155
  base = base.to_s.split('#').first
150
- base = @options[:base_uri] = uri(base)
156
+ base = @base_uri = uri(base)
151
157
  add_debug(base_el, "parse_whole_doc: base='#{base}'")
152
158
  else
153
159
  base = RDF::URI("")
@@ -298,7 +304,7 @@ module RDF::Microdata
298
304
  # 5.3. If type does not have a : after its #, append a : to type.
299
305
  type += ':' unless type.to_s.match(/\#:/)
300
306
  # 5.4. If the last character of type is not a :, %20 to type.
301
- type += '%20' unless type.to_s[-1] == ':'
307
+ type += '%20' unless type.to_s[-1,1] == ':'
302
308
  # 5.5. Append the fragment-escaped value of fallback name to type.
303
309
  type += fallback_name.to_s.gsub('#', '%23')
304
310
  end
@@ -331,7 +337,7 @@ module RDF::Microdata
331
337
  name_uri
332
338
  elsif !name.include?(':')
333
339
  s = type.to_s
334
- s += '%20' unless s[-1] == ':'
340
+ s += '%20' unless s[-1,1] == ':'
335
341
  s += name
336
342
  RDF::MD[s.gsub('#', '%23')]
337
343
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: rdf-microdata
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.0
5
+ version: 0.1.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Gregg Kellogg
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-06-29 00:00:00 -07:00
13
+ date: 2011-07-13 00:00:00 -07:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency