rexle 1.5.2 → 1.5.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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/rexle.rb +18 -8
- metadata +45 -45
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f618c9f7362740fab8dd51fa97118b695effd37a7b1254992eb7bc45075256a9
|
4
|
+
data.tar.gz: 8fd18092107575476f66e8f46fc8251bd42a2bc9d0819867f2ba2ac4b292f47c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b98a5b59400eb42f562725e87c982e086446fe5ed8fafa777ac68214e345350efe567bab0b0da3e3d43eed2283cf2f550cb59a8ed3f0b44ce5c62a5298193a78
|
7
|
+
data.tar.gz: d3ef38f3a5bb0cba758d98d5f7ef8618f93af4e40edea315a557c6133a7d3fdbb0420ea7441bdea06df8e787abf43314b3f1970ec05e1f2340a8676df734cc1a
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/rexle.rb
CHANGED
@@ -13,6 +13,10 @@ require 'backtrack-xpath'
|
|
13
13
|
|
14
14
|
# modifications:
|
15
15
|
|
16
|
+
# 11-May-2020: bug fix: Rexle#css now responds correctly to valid selectors
|
17
|
+
# 23-Apr-2020: feature: Added public method *plaintext*.
|
18
|
+
# 04-Feb-2020: minor bug fix: Element A is now defined as a non self-closing tag
|
19
|
+
# 18-Sep-2019: minor bug fix: &apos is now unescaped properly
|
16
20
|
# 09-Jul-2019: minor improvement: A comment tag now has a
|
17
21
|
# new line when pretty printed
|
18
22
|
# 02-Feb-2019: feature: A comment tag can now have nested elements
|
@@ -99,7 +103,7 @@ module XMLhelper
|
|
99
103
|
|
100
104
|
tag = x.name + (a.empty? ? '' : ' ' + a.join(' '))
|
101
105
|
|
102
|
-
non_self_closing_tags = %w(script textarea iframe div object)
|
106
|
+
non_self_closing_tags = %w(script textarea iframe div object a)
|
103
107
|
|
104
108
|
if (x.children and x.children.length > 0 \
|
105
109
|
and not x.children.is_an_empty_string?) or \
|
@@ -205,6 +209,7 @@ class Rexle
|
|
205
209
|
def initialize(x=nil, rexle: self, debug: false)
|
206
210
|
|
207
211
|
@rexle, @debug = rexle, debug
|
212
|
+
$debug = @debug
|
208
213
|
|
209
214
|
puts 'inside Rexle'.debug if debug
|
210
215
|
|
@@ -253,9 +258,7 @@ class Rexle
|
|
253
258
|
a = selector.split(',').flat_map do |x|
|
254
259
|
@doc.root.xpath RexleCSS.new(x).to_xpath
|
255
260
|
end
|
256
|
-
|
257
|
-
a.shift if self.kind_of? Rexle
|
258
|
-
|
261
|
+
|
259
262
|
return a
|
260
263
|
end
|
261
264
|
|
@@ -646,6 +649,7 @@ class Rexle
|
|
646
649
|
attr_search = format_condition(condition) if condition \
|
647
650
|
and condition.length > 0
|
648
651
|
|
652
|
+
puts ('1. attr_search: ' + attr_search.inspect).debug if $debug
|
649
653
|
#@log.debug 'attr_search2 : ' + attr_search.inspect
|
650
654
|
attr_search2 = xpath_value[/^\[(.*)\]$/,1]
|
651
655
|
|
@@ -710,6 +714,7 @@ class Rexle
|
|
710
714
|
end
|
711
715
|
|
712
716
|
elsif element_name.nil?
|
717
|
+
puts ('attr_search: ' + attr_search.inspect).debug if $debug
|
713
718
|
return eval attr_search
|
714
719
|
else
|
715
720
|
|
@@ -995,6 +1000,11 @@ class Rexle
|
|
995
1000
|
def insert_before(node) insert(node) end
|
996
1001
|
def last(a) a.last end
|
997
1002
|
def map(&blk) self.children.map(&blk) end
|
1003
|
+
|
1004
|
+
def plaintext()
|
1005
|
+
xml().gsub(/<\/?[^>]+>/,'').gsub(' ',' ').gsub(/\n\s+/,' ')
|
1006
|
+
end
|
1007
|
+
|
998
1008
|
def root() self end
|
999
1009
|
|
1000
1010
|
def text(s='')
|
@@ -1016,7 +1026,7 @@ class Rexle
|
|
1016
1026
|
r.map do |x|
|
1017
1027
|
def x.unescape()
|
1018
1028
|
s = self.to_s.clone
|
1019
|
-
%w(< < > > & & &
|
1029
|
+
%w(< < > > & & ' ').each_slice(2){|x| s.gsub!(*x)}
|
1020
1030
|
s
|
1021
1031
|
end
|
1022
1032
|
end
|
@@ -1031,7 +1041,7 @@ class Rexle
|
|
1031
1041
|
|
1032
1042
|
def r.unescape()
|
1033
1043
|
s = self.clone
|
1034
|
-
%w(< < > > & & &
|
1044
|
+
%w(< < > > & & ' ').each_slice(2){|x| s.gsub!(*x)}
|
1035
1045
|
s
|
1036
1046
|
end
|
1037
1047
|
|
@@ -1042,7 +1052,7 @@ class Rexle
|
|
1042
1052
|
|
1043
1053
|
val = Value.new(raw_s.to_s.clone)
|
1044
1054
|
|
1045
|
-
escape_chars = %w(& & < < > >).each_slice(2).to_a
|
1055
|
+
escape_chars = %w(& & ' ' < < > >).each_slice(2).to_a
|
1046
1056
|
escape_chars.each{|x| val.gsub!(*x)}
|
1047
1057
|
|
1048
1058
|
t = val
|
@@ -1323,7 +1333,7 @@ class Rexle
|
|
1323
1333
|
|
1324
1334
|
def unescape()
|
1325
1335
|
s = @value.clone
|
1326
|
-
%w(< < > > & & &
|
1336
|
+
%w(< < > > & & ' ').each_slice(2){|x| s.gsub!(*x)}
|
1327
1337
|
s
|
1328
1338
|
end
|
1329
1339
|
|
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.5.
|
4
|
+
version: 1.5.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -11,31 +11,31 @@ cert_chain:
|
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIF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|
26
|
+
pZaniHSTxRjAZLUsoQswJgYDVR0RBB8wHYEbZ2VtbWFzdGVyQGphbWVzcm9iZXJ0
|
27
27
|
c29uLmV1MCYGA1UdEgQfMB2BG2dlbW1hc3RlckBqYW1lc3JvYmVydHNvbi5ldTAN
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
28
|
+
BgkqhkiG9w0BAQsFAAOCAYEAEdNcc2nDj8v6FdY75tULXii+F0m1pnfxri+wtd/1
|
29
|
+
wnRqNqmaKQGwAUhx4qLhs8MbGU5H4xe18Hmf7n6P++HSCKaFDwE3mo38vwnPmPr8
|
30
|
+
J+4+CWaB+avp9/wztZS3oQ0k/w9bN4b1RUk18z4rpG9Y8KH3v7L+b4rAzzBhs60S
|
31
|
+
Q2+963e3C7PFkFODn1vfGMRmBK2nuekE6RdzzxzRuUBwKHMggxPsHRQzaz8cy4fB
|
32
|
+
UWC8eX0y59rd/gA0WunPXgpuV24SHBtIqTLk76Z1Oz3P27Hwx2JPhURtzc3bNfSg
|
33
|
+
gvwYrdF1dTOwourN6uqQLksl7AjcCVUV+6hyoa5Fo9HcfURnlPdjVFax/KIQj3lA
|
34
|
+
X0bOYG6opdA3I0zyDHGx+mC9QuhM6oKYq3fu7i8RsVsihVImOovRYVagGbULBLDZ
|
35
|
+
yK32Ci6By/qMCdJdE8pLLZhHuZGIkoYJK7EN7OKPznwuXRCOq7jb44HAIDi4RZST
|
36
|
+
J+lqIOqNxqRJkYpuYSZr+tyd
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date:
|
38
|
+
date: 2020-06-22 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: c32
|
@@ -63,60 +63,60 @@ dependencies:
|
|
63
63
|
requirements:
|
64
64
|
- - "~>"
|
65
65
|
- !ruby/object:Gem::Version
|
66
|
-
version: '0.
|
66
|
+
version: '0.9'
|
67
67
|
- - ">="
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: 0.
|
69
|
+
version: 0.9.3
|
70
70
|
type: :runtime
|
71
71
|
prerelease: false
|
72
72
|
version_requirements: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
74
|
- - "~>"
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version: '0.
|
76
|
+
version: '0.9'
|
77
77
|
- - ">="
|
78
78
|
- !ruby/object:Gem::Version
|
79
|
-
version: 0.
|
79
|
+
version: 0.9.3
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: rexle-builder
|
82
82
|
requirement: !ruby/object:Gem::Requirement
|
83
83
|
requirements:
|
84
|
-
- - ">="
|
85
|
-
- !ruby/object:Gem::Version
|
86
|
-
version: 0.4.0
|
87
84
|
- - "~>"
|
88
85
|
- !ruby/object:Gem::Version
|
89
|
-
version: '0
|
86
|
+
version: '1.0'
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 1.0.2
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: 0.4.0
|
97
94
|
- - "~>"
|
98
95
|
- !ruby/object:Gem::Version
|
99
|
-
version: '0
|
96
|
+
version: '1.0'
|
97
|
+
- - ">="
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: 1.0.2
|
100
100
|
- !ruby/object:Gem::Dependency
|
101
101
|
name: rexle-css
|
102
102
|
requirement: !ruby/object:Gem::Requirement
|
103
103
|
requirements:
|
104
|
-
- - "~>"
|
105
|
-
- !ruby/object:Gem::Version
|
106
|
-
version: '0.1'
|
107
104
|
- - ">="
|
108
105
|
- !ruby/object:Gem::Version
|
109
|
-
version: 0.
|
106
|
+
version: 0.2.0
|
107
|
+
- - "~>"
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0.2'
|
110
110
|
type: :runtime
|
111
111
|
prerelease: false
|
112
112
|
version_requirements: !ruby/object:Gem::Requirement
|
113
113
|
requirements:
|
114
|
-
- - "~>"
|
115
|
-
- !ruby/object:Gem::Version
|
116
|
-
version: '0.1'
|
117
114
|
- - ">="
|
118
115
|
- !ruby/object:Gem::Version
|
119
|
-
version: 0.
|
116
|
+
version: 0.2.0
|
117
|
+
- - "~>"
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: '0.2'
|
120
120
|
- !ruby/object:Gem::Dependency
|
121
121
|
name: backtrack-xpath
|
122
122
|
requirement: !ruby/object:Gem::Requirement
|
@@ -163,7 +163,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
163
163
|
- !ruby/object:Gem::Version
|
164
164
|
version: '0'
|
165
165
|
requirements: []
|
166
|
-
rubygems_version: 3.0.
|
166
|
+
rubygems_version: 3.0.3
|
167
167
|
signing_key:
|
168
168
|
specification_version: 4
|
169
169
|
summary: Rexle is an XML parser written purely in Ruby
|
metadata.gz.sig
CHANGED
Binary file
|