rasantiago-tiny_xpath_helper 0.1.6 → 0.1.7

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.
data/README.rdoc CHANGED
@@ -56,6 +56,11 @@ and defaults to true.
56
56
  >> xpath.all( 'node/@style', :auto_text => false )
57
57
  => [style='first']
58
58
 
59
+ If you find yourself writing iterative xpaths, you may want to use :format => :tiny_xpath_helper
60
+ >> node_xpath = xpath.first( 'node', :format => :tiny_xpath_helper)
61
+ >> node_xpath.first('@style')
62
+ => style='first'
63
+
59
64
  Option defaults can be passed to TinyXPathHelper#new
60
65
  >> xpath_with_options = TinyXPathHelper.new( File.open( 'test/xml/sample.xml' ), :format => :to_i, :find => :all )
61
66
  >> xpath_with_options.find_xpath( 'node' )
@@ -100,6 +100,9 @@ class TinyXPathHelper
100
100
  elsif format == :xml or format == :rexml
101
101
  auto_text = false
102
102
  format = nil
103
+ elsif format == :xpath_helper or format == :tiny_xpath_helper
104
+ auto_text = false
105
+ format = self.method(:new)
103
106
  end
104
107
 
105
108
  filter1 = auto_text ? self.method(:xml_node_to_text) : nil
@@ -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.6"
5
+ s.version = "0.1.7"
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.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jesse Wolfe