rexle 0.9.73 → 0.9.74

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 41a70f1059933c4a4313548913c63f8d1cc2c2ab
4
- data.tar.gz: e77287544478c7d16b7cf435c3f7883ce4cd68d2
3
+ metadata.gz: 590eb51dca93ee47c6f09424ac9c67ac0f93f08d
4
+ data.tar.gz: e9cd05c97302109a4807d915ca2bfdd814905755
5
5
  SHA512:
6
- metadata.gz: 4c1a0102fe2e89709030b1349f4e1f3491ba71aeb8be86a2eaee843a8660c02ebbe0f3bda5c454ef3a5aa6677de5f5039cc4de8396e215f608b83e4e53fc4a79
7
- data.tar.gz: eee5d149f40da13bdbc0bd736c87a19115697c0b3c470bf17357d4a6f53a0fba4b7c2de2de536b62af3f7afc0694ba1f1e7ad1cd6431c20ed733c6af7ccb0ddd
6
+ metadata.gz: 2c44f01716888432242b46d564e4d9ffdc662e6dcfa799f7bf2d32997f973f9b653fcb5f9facbfbcca5e2611d07f2635c56a095f4f464a127271864d8b77fad0
7
+ data.tar.gz: b30abeb74306a72468277b68bbb9538b6746a49929ef96646adccd681340fa852c927afae3e60c47a1d4ec19a6ac43e08458b0364a23154d77df794cd7f84673
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/lib/rexle.rb CHANGED
@@ -10,6 +10,7 @@ require 'cgi'
10
10
  include REXML
11
11
 
12
12
  # modifications:
13
+ # 30-jul-2013: feature: Rexle::Element#xml now accepts an xpath
13
14
  # 25-jun-2013: bug fix: doc.root.delete(xpath) fixed
14
15
  # 10-Nov-2012: Elements can now be added starting from an empty document
15
16
  # 06-Nov-2012: additional xpath predicate now implemented e.g.
@@ -179,7 +180,7 @@ class Rexle
179
180
 
180
181
  end
181
182
 
182
- end
183
+ end
183
184
 
184
185
  def xpath(path, &blk)
185
186
  @doc.xpath(path, &blk)
@@ -583,9 +584,18 @@ class Rexle
583
584
  end
584
585
 
585
586
  def xml(options={})
586
- o = {pretty: false}.merge(options)
587
- msg = o[:pretty] == false ? :doc_print : :doc_pretty_print
588
- method(msg).call(self.children)
587
+ h = {
588
+ Hash: lambda {|x|
589
+ o = {pretty: false}.merge(x)
590
+ msg = o[:pretty] == false ? :doc_print : :doc_pretty_print
591
+ method(msg).call(self.children)
592
+ },
593
+ String: lambda {|x|
594
+ r = self.element(x)
595
+ r ? r.xml : ''
596
+ }
597
+ }
598
+ h[options.class.to_s.to_sym].call options
589
599
  end
590
600
 
591
601
  alias to_s xml
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rexle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.73
4
+ version: 0.9.74
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -29,7 +29,7 @@ cert_chain:
29
29
  EgghkUCgC30KsgaYheoN5ILHCE52JXCfr1Qto26qUSdC49xWkxnQz2yrSq8z085Q
30
30
  h0bKDk/qqjLsNUnSPxhypj3wTgJNdHKX
31
31
  -----END CERTIFICATE-----
32
- date: 2013-07-27 00:00:00.000000000 Z
32
+ date: 2013-07-30 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: rexleparser
metadata.gz.sig CHANGED
Binary file