rexslt 0.5.7 → 0.5.8

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: 8ca99a0049f03a0bf76ba1bc87348498c01cb69d
4
- data.tar.gz: 153e06d4ce746fc56efc35a2f20c3277619f7338
3
+ metadata.gz: b0e3088816349696ba1638c9ef11a2e3860ded09
4
+ data.tar.gz: af4f8749ff79cb81093e846769881466bb653215
5
5
  SHA512:
6
- metadata.gz: 67e2c9afadbc3b943cf80bfbe207e3e9b6a3f85ea456fa069fd8e9b94ab0bb46da06a901f357912bf85e6e10227de909b12614f153ed46f0db74aad58d3f722f
7
- data.tar.gz: ae950ac82c2fb673578165d04e1d3496c10e72a71d268f6a4b49032dfa0dc3c2818694c4c0119d5198180b05bcac2f85cb73e46ed6a974366d46e11156e51006
6
+ metadata.gz: aed1323f58672977919d163b51ac565534a6d7a82f80bc6dce8425a53bd1e7829a95916c6f8b9834edace9468afa325eb05c2a1100ad5dd6cacd45fd76359ad8
7
+ data.tar.gz: feca8fbf24c10d3c661f66da3c4a2a298aa06ac375f3dd3683cffb26656cf14695aae8992afb4d4946553c11edce04507ff52f2c9ecc46d5ad00dd825a6129d2
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/lib/rexslt.rb CHANGED
@@ -116,24 +116,22 @@ class Rexslt
116
116
  template_xpath, template = raw_template
117
117
 
118
118
  if sort_field then
119
+
119
120
  sort_order = lambda do |x|
121
+
120
122
  r = x.element(sort_field);
121
123
 
122
124
  if r.respond_to?(:text) then
123
- orderx == 'ascending' ? r.value : -r.value
125
+ r.value
124
126
  else
125
-
126
- if orderx == 'ascending' then
127
- data_type == 'text' ? r : r.to_i
128
- else
129
- data_type == 'text' ? -r : -r.to_i
130
- end
127
+ data_type == 'text' ? r : r.to_i
131
128
  end
132
129
  end
133
130
 
134
- matched_node.sort_by(&sort_order).each_with_index do |child_node,i|
131
+ a = matched_node.sort_by(&sort_order).each_with_index do |child_node,i|
135
132
  read_node template, child_node, doc_element, indent, i+1
136
133
  end
134
+ a.reverse! if orderx == 'descending'
137
135
  else
138
136
  r = matched_node.each_with_index do |child_node,i|
139
137
  read_node template, child_node, doc_element, indent, i+1
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rexslt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.7
4
+ version: 0.5.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  38j2+6ULVWalsVein3whb7qB6IOvxoSqjz6n7jAKFGHovoXPUqpv5y5Yor23rTrn
32
32
  0YwisIc3UkL30g==
33
33
  -----END CERTIFICATE-----
34
- date: 2016-03-29 00:00:00.000000000 Z
34
+ date: 2016-03-31 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rxfhelper
metadata.gz.sig CHANGED
Binary file