rexle 1.2.23 → 1.2.24

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: e8b88e2599dafffcfcf32beeff73f9b109bb124d
4
- data.tar.gz: 7b3352a3add259367e6b6c388e7e2d5deeb3f55e
3
+ metadata.gz: c587a7adf6153f298ab4f9c8d22b18739fa423a7
4
+ data.tar.gz: f417248f88dfb25dd2185d9c5588823598808a19
5
5
  SHA512:
6
- metadata.gz: 98711a471bbe8da7372875676923cf1ff0be403296f3356daf0caeb7b2aca2c58a18f7e6e1d6a9c358631f9c9bf6fcee2361d5e91fc16c2a6490fabc19509421
7
- data.tar.gz: 387c64ad771d0593cf125116dcd74af083f582780798b39019bb5b6d78c8bef099be28f42c9ad1f0dbe1b30d0eceb2d99f6c94bee2d984892a5a63099608ab9b
6
+ metadata.gz: d8669981d259758addaec1848a6be6cc62ae6f3e6314b48ca3fd45090c1b906e7f76243e6a886bd0fdc506b1a675ae2eafa443128fd1bfb7b240834a070da83e
7
+ data.tar.gz: bf6a08e14b84c7fd705865582dc369859670302371e1c67c0a42b50f39b9aedc9af4d49747526df2202561b3f21c6e9cb8339d78b202798191c441543987a7ea
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/lib/rexle.rb CHANGED
@@ -11,6 +11,7 @@ require 'cgi'
11
11
 
12
12
  # modifications:
13
13
 
14
+ # 24-Mar-2015: bug fix: Rexle::Elements no longer allows indexes less than 1
14
15
  # 20-Mar-2015: bug fix: Dynarex documents which fail to parse properly with the
15
16
  # Dynarex parser are now parsed by by the Rexle parser
16
17
  # 16-Mar-2015: feature: Implemented Rexle::Element#prepend
@@ -229,13 +230,13 @@ module XMLhelper
229
230
 
230
231
  if x.is_a? Rexle::Element then
231
232
 
232
- a = [x.name, x.attributes, x.value]
233
+ a = Array.new(String.new(x.name), Hash.new(x.attributes), String.new(x.value))
233
234
 
234
235
  (a.concat(scan_to_a(x.children))) if x.children.length > 1
235
236
  r << a
236
237
  elsif x.is_a? String then
237
238
 
238
- r << x
239
+ r << String.new(x)
239
240
  end
240
241
 
241
242
  end
@@ -900,7 +901,8 @@ class Rexle
900
901
  alias text= value=
901
902
 
902
903
  def to_a()
903
- [self.name, self.attributes, self.value, *scan_to_a(self.children)]
904
+ e = Array.new(String.new(self.name), Hash.new(self.attributes), String.new(self.value))
905
+ Array.new(*e, *scan_to_a(self.children))
904
906
  end
905
907
 
906
908
  def xml(options={})
@@ -1179,8 +1181,11 @@ class Rexle
1179
1181
  @elements = elements
1180
1182
  end
1181
1183
 
1182
- def [](i)
1183
- @elements[i-1]
1184
+ def [](raw_i)
1185
+
1186
+ raise 'Rexle::Elements index (-1) must be >= 1' unless raw_i > 0
1187
+ i = raw_i - 1
1188
+ @elements[i]
1184
1189
  end
1185
1190
 
1186
1191
  def each(&blk) @elements.each(&blk) 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.2.23
4
+ version: 1.2.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  Tkua07gB3/nVO3aPg7C3vEbDZCxT3WAMli2uZisYT6ozmdAlDsixLjipgFN4If3z
32
32
  Ej0QR3kvGcAvFQ==
33
33
  -----END CERTIFICATE-----
34
- date: 2015-03-20 00:00:00.000000000 Z
34
+ date: 2015-03-24 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rexleparser
metadata.gz.sig CHANGED
Binary file