the-experimenters-rdf-rdfxml 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,4 +13,19 @@ class Nokogiri::XML::Node
13
13
  when Nokogiri::XML::Attr then "#{parent.display_path}@#{name}"
14
14
  end
15
15
  end
16
+
17
+ alias_method :attribute_with_ns_without_ffi_null, :attribute_with_ns
18
+ ##
19
+ # Monkey patch attribute_with_ns, to insure nil is returned for #null?
20
+ #
21
+ # Get the attribute node with name and namespace
22
+ #
23
+ # @param [String] name
24
+ # @param [String] namespace
25
+ # @return [Nokogiri::XML::Attr]
26
+ def attribute_with_ns(name, namespace)
27
+ a = attribute_with_ns_without_ffi_null(name, namespace)
28
+
29
+ (a.respond_to?(:null?) && a.null?) ? nil : a # to ensure FFI Pointer compatibility
30
+ end
16
31
  end
@@ -59,11 +59,7 @@ module RDF::RDFXML
59
59
  # Extract Evaluation Context from an element
60
60
  def extract_from_element(el, &cb)
61
61
  b = el.attribute_with_ns("base", RDF::XML.to_s)
62
- b = nil if b.respond_to?(:null?) && b.null? # to ensure FFI Pointer compatibility
63
-
64
62
  lang = el.attribute_with_ns("lang", RDF::XML.to_s)
65
- lang = nil if lang.respond_to?(:null?) && lang.null? # to make FFI Pointer compatibility
66
-
67
63
  self.base = self.base.join(b) if b
68
64
  self.language = lang if lang
69
65
  self.uri_mappings.merge!(extract_mappings(el, &cb))
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{the-experimenters-rdf-rdfxml}
8
- s.version = "0.3.3"
8
+ s.version = "0.3.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Gregg Kellogg"]
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: the-experimenters-rdf-rdfxml
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.3.3
5
+ version: 0.3.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - Gregg Kellogg