rasantiago-tiny_xpath_helper 0.1.7 → 0.1.8

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.
@@ -17,7 +17,7 @@ class TinyXPathHelper
17
17
  r = default_options.dup
18
18
 
19
19
  options.reverse.each do |option|
20
- if not Hash === option
20
+ if not option.is_a?( Hash )
21
21
  option = {:format => option}
22
22
  end
23
23
  r.update(option)
@@ -49,20 +49,20 @@ class TinyXPathHelper
49
49
  end
50
50
 
51
51
  def self.xml_node_for_xmlish( xml, options = {} )
52
- if io_stream_classes.any?{|k| k === xml }
52
+ if io_stream_classes.any?{|k| xml.is_a?(k) }
53
53
  xml = xml.read
54
54
  end
55
- if String === xml
55
+ if xml.is_a?(String)
56
56
  xml = REXML::Document.new(xml)
57
57
  end
58
- if REXML::Document === xml
58
+ if xml.is_a?(REXML::Document)
59
59
  if options[:allow_empty_document] and ! xml.root
60
60
  xml = xml
61
61
  else
62
62
  xml = xml.root
63
63
  end
64
64
  end
65
- if not REXML::Element === xml
65
+ if not xml.is_a?(REXML::Element)
66
66
  raise TypeError.new("Expected REXML::Element, got #{xml.class}")
67
67
  end
68
68
  return xml
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{tiny_xpath_helper}
5
- s.version = "0.1.7"
5
+ s.version = "0.1.8"
6
6
 
7
7
  s.authors = ["Jesse Wolfe"]
8
8
  s.date = %q{2009-06-01}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rasantiago-tiny_xpath_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jesse Wolfe