rexle 1.3.31 → 1.3.32

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c70918a9a9fcc6f391f61bcaf5487eb47279b742
4
- data.tar.gz: 6a46404468b391f7cc53c666ffa903343b25bb4f
3
+ metadata.gz: 82fcd328197c1d282c442001e905a24269c41978
4
+ data.tar.gz: 208fb18b0f81b218f4275b683c756573a757e7fe
5
5
  SHA512:
6
- metadata.gz: 2c9b4b0764b8493b06b57448b5321c10fa7b586129f634ca26fb0387800eb23072ada5b103b3af9ae8024b758edcc23a6547810780197d986f93f3a384e5a9d2
7
- data.tar.gz: 018db7a1dee71d94cb616d9650c46163140f82ff3d89720a19a35e9be2d55899ec6d84364911e545d8b36f105e9a3f485ede41e27cbc9b3140595b2a11cdacd9
6
+ metadata.gz: 33cc6131670d86d2a68cbecf30181b7814c98a15f64de398e91b33cf4338a4c2ca466e06bdafead1483aad2f30af02515f7c3e1597bcb57af316acf68961b425
7
+ data.tar.gz: d2e97f350be6b99d35d02f61b4d0f3e8486b270e7f8df2e5c7f11f0abd50fc43374a42119c3680877a659f79b2f7568c79a01db396b081ab190e006f26ebed07
checksums.yaml.gz.sig CHANGED
@@ -1,3 +1 @@
1
- "�`�~�%�a��^ �����o��$ ~�Q6I[Ue@�Y��(��@������*X%?fB����!�UY�����m �e`_��N�Z����{zv-A  ����Y׆o�$y���mDOId��3H\�xG =Wt���
2
- �� oSd�=g;������e�$�h?�e���[ v�����q���� W��䉑jd
3
- W�@N�e]Q8�@�5s���u���I�W�}���E��N�-��18L
1
+ ���/��r[ֳ�C�y�nx�����\�pm��w�EA��C���h]�rg����S�#����Wl�:md���]<�1� �z���@U���?o��w��� "eAZ1d)HiW�w��) �F��9X��.�2���''];+�;m|�\�N{�q���~^��f:�R2å3 }�q�d���h����d����e�:6_�M��N���� =��&����u�:#��\���,KH9�;�U�����k}�I
data.tar.gz.sig CHANGED
Binary file
data/lib/rexle.rb CHANGED
@@ -12,6 +12,8 @@ require 'backtrack-xpath'
12
12
 
13
13
  # modifications:
14
14
 
15
+ # 15-May-2016: bug fix: Rexle::Element::add_attribute can now handle the
16
+ # object Attribute::Value
15
17
  # 06-May-2016: feature: Rexle::Element.text now returns a
16
18
  # Rexle::Element::Value object which is a kind of
17
19
  # String which be used for comparing numbers
@@ -60,35 +62,6 @@ require 'backtrack-xpath'
60
62
  # Corrected method scan_to_a() which is used by to_a()
61
63
  # 02-May-2015: improvement: Rexle::Element#xpath function contains() can
62
64
  # now be used as a condition .e.g. b[contains(c,'10')]
63
- # 30-Apr-2015: improvement: Rexle::Element#xpath function contains() can
64
- # now handle string values
65
- # feature: Implemented Rexle::Element#backtrack which
66
- # uses the Backtrack-xpath gem
67
- # 24-Mar-2015: bug fix: Rexle::Elements no longer allows indexes less than 1
68
- # 20-Mar-2015: bug fix: Dynarex documents which fail to parse properly with the
69
- # Dynarex parser are now parsed by by the Rexle parser
70
- # 16-Mar-2015: feature: Implemented Rexle::Element#prepend
71
- # 09-Mar-2015: feature: Rexle::Element#attributes now returns object
72
- # Attributes instead of Hash
73
- # 08-Mar-2015: feature: Within Rexle:Elements,
74
- # implemented methods length() and empty?()
75
- # 01-Mar-2015: Rexle::Element#text now reuses the code from
76
- # Rexle::Element#value
77
- # 25-Feb-2015: feature: Rexle#inspect now displays the
78
- # 1st 100 characters of XML
79
- # bug fix: If another parser can't be selected, the
80
- # default parser is used
81
- # 16-Feb-2015: bug fix: Rexle::Element#value assignment is now made by
82
- # value instead of reference
83
- # 11-Feb-2015: bug fix: add_text now adds a String to @child_elements.
84
- # All references to @child_lookup have now been removed.
85
- # 08-Feb-2015: bug fix: Within method filter_xpath(), a new String is created
86
- # from raw_path to workaround a frozen string when slice! is called.
87
- # bug fix: A Rexle::Element#value will now only return an
88
- # object if the 1st child item is a String
89
- # Now stores any comment elements as well as printing them.
90
- # 07-Feb-2015: Implemented XPath function last() e.g.
91
- # doc.root.xpath('records/item[last()]')
92
65
 
93
66
 
94
67
 
@@ -876,14 +849,19 @@ class Rexle
876
849
  end
877
850
 
878
851
  def add_attribute(*x)
879
-
852
+
853
+ proc_hash = lambda {|x| Hash[*x]}
854
+
880
855
  procs = {
881
856
  Hash: lambda {|x| x[0] || {}},
882
- String: lambda {|x| Hash[*x]},
883
- Symbol: lambda {|x| Hash[*x]}
857
+ String: proc_hash,
858
+ Symbol: proc_hash,
859
+ :'Attributes::Value' => proc_hash
884
860
  }
885
861
 
886
- h = procs[x[0].class.to_s.to_sym].call(x)
862
+ type = x[0].class.to_s.to_sym
863
+
864
+ h = procs[type].call(x)
887
865
 
888
866
  @attributes.merge! h
889
867
  end
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: 1.3.31
4
+ version: 1.3.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  pOw2Fx4uv9tO6wagRTcaHduxkh4jYfPDQI9mODFccHeY+wRLDGTENQwIILvMgEa7
32
32
  50vRuyU+obGfjg==
33
33
  -----END CERTIFICATE-----
34
- date: 2016-05-06 00:00:00.000000000 Z
34
+ date: 2016-05-15 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rexleparser
metadata.gz.sig CHANGED
Binary file