rexle 1.2.16 → 1.2.18

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: e9bc3bce82608e4761d52a679184393fe11ac992
4
- data.tar.gz: 39efe3a1172ee4cfccc9e40f0be490f8728cf5ab
3
+ metadata.gz: 96b06805f1f9fa28c3fd472f6b4b00151b27d241
4
+ data.tar.gz: ab2434b0abfcdca97aec40ffcdec8799987e3a59
5
5
  SHA512:
6
- metadata.gz: 599165fb1163e4274834373d98c8f4737e072800a6a1ed332f69af28fd7929925e33876a5e3b168694c5f357b2d1af00caac7c9848181cc9c09d73a94573705f
7
- data.tar.gz: f035e060d8a7dd824b3ff4dbc0b9b83b6f0e0ec633e44107d6eacbefe390b6882ac99bc62e5b6f8efb2fd35805dc9f31bd286f14014fdd89ddd5d8d4d8640d03
6
+ metadata.gz: 640a709e2412e6cb48d027a431bb277262e3286a6c351d7e88afa39e128dbe04b5db260feeeaae7a19df389d14fd5f5ae115d86f718a831923f0fc52ced02492
7
+ data.tar.gz: 379ae6600f4c7aa574131ed93fc75b244ba6a50a1aee79d2bc1eec6a902ab1717875a120a24c2143c22633654147ffd903d5f3598a951f24185aa23788d4483f
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/lib/rexle.rb CHANGED
@@ -13,6 +13,8 @@ require 'cgi'
13
13
 
14
14
  # 25-Feb-2015: feature: Rexle#inspect now displays the
15
15
  # 1st 100 characters of XML
16
+ # bug fix: If another parser can't be selected, the
17
+ # default parser is used
16
18
  # 16-Feb-2015: bug fix: Rexle::Element#value assignment is now made by
17
19
  # value instead of reference
18
20
  # 11-Feb-2015: bug fix: add_text now adds a String to @child_elements.
@@ -169,11 +171,8 @@ module XMLhelper
169
171
  end
170
172
  end
171
173
 
172
- def inspect()
173
-
174
- xml = self.xml declaration: false
175
- "#<Rexle:%s xml=\"%s\">" % \
176
- [self.object_id, xml.length > 100 ? xml[0..96] + '...>' : xml]
174
+ def inspect()
175
+ "#<Rexle:%s>" % [self.object_id]
177
176
  end
178
177
 
179
178
  def processing_instructions(s='')
@@ -1263,6 +1262,15 @@ class Rexle
1263
1262
 
1264
1263
  private
1265
1264
 
1265
+ def parse_rexle(x)
1266
+
1267
+ rp = RexleParser.new(x)
1268
+ a = rp.to_a
1269
+
1270
+ @instructions = rp.instructions
1271
+ return a
1272
+ end
1273
+
1266
1274
  def parse_string(x)
1267
1275
 
1268
1276
  # check if the XML string is a dynarex document
@@ -1276,22 +1284,26 @@ class Rexle
1276
1284
  #'polyrex' => proc {|x| PolyrexParser.new(x).to_a},
1277
1285
  'polyrex' => proc {|x| RexleParser.new(x).to_a}
1278
1286
  }
1279
- procs[recordx_type].call(x)
1287
+ other_parser = procs[recordx_type]
1288
+
1289
+ if other_parser then
1290
+
1291
+ other_parser.call(x)
1292
+
1293
+ else
1294
+
1295
+ parse_rexle x
1296
+
1297
+ end
1280
1298
 
1281
1299
  else
1282
1300
 
1283
- rp = RexleParser.new(x)
1284
- a = rp.to_a
1285
-
1286
- @instructions = rp.instructions
1287
- return a
1301
+ parse_rexle x
1302
+
1288
1303
  end
1289
1304
  else
1290
1305
 
1291
- rp = RexleParser.new(x)
1292
- a = rp.to_a
1293
- @instructions = rp.instructions
1294
- return a
1306
+ parse_rexle x
1295
1307
 
1296
1308
  end
1297
1309
 
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.16
4
+ version: 1.2.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file