laximo 0.5.0 → 0.5.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 08247f7af2c6825a9b54dc0f3f1cdc04887389f9
4
- data.tar.gz: 1dccf010d351615a04ebe75f7e68e607b1a62c33
3
+ metadata.gz: 8a8a5cc64dce4a7534adb6d32c38d921f9cd0106
4
+ data.tar.gz: 39c12a89013080d1a370c1e43cf2fe6c7706969c
5
5
  SHA512:
6
- metadata.gz: d1e1640972e8ad09d64e18f6efb1c638f5b2a20d0f5f0b439361069f8c0b6ba77482a7b0dde410c770077f2138ecf04395268a7aebace3d6ce6b2548fe70cd8a
7
- data.tar.gz: be8d348848579683ff657bbff9269884799116494f11e2bd3af1379d70ee830a71e72ba9ebe74061b3a2eba1aa0fcd6304a52a1446a608a22e923b7f51c214e6
6
+ metadata.gz: 4857609dc8b4dbae7b3bac1175c9340d49fb836c9ad6e082dae0ce3088f46b161adda840f3bcefbee5d25aeef844667cf7a8bb602bff828c27e152a4ad4fbef6
7
+ data.tar.gz: 5f9b9d285774cf8440f3bea930f795ab937c893078b9b80a62d134fc65b9bcfcd1f696c7bdb5245a4889ff843af4af17098ea6278ad742edcb234f248c1f391b
@@ -1,6 +1,7 @@
1
1
  # encoding: utf-8
2
2
  require 'nokogiri'
3
3
 
4
+ require 'cgi'
4
5
  require 'uri'
5
6
  require 'net/http'
6
7
 
@@ -377,8 +377,8 @@ module Laximo
377
377
  def list_quick_group(
378
378
  catalog:,
379
379
  vehicle_id:,
380
- ssd: nil,
381
- locale: 'ru_RU'
380
+ ssd: nil,
381
+ locale: 'ru_RU'
382
382
  )
383
383
 
384
384
  resp = ::Laximo::Query.
@@ -397,10 +397,10 @@ module Laximo
397
397
  catalog:,
398
398
  vehicle_id:,
399
399
  quick_group_id:,
400
- all:,
401
- ssd: nil,
402
- localized: true,
403
- locale: 'ru_RU'
400
+ all: 1,
401
+ ssd: nil,
402
+ localized: true,
403
+ locale: 'ru_RU'
404
404
  )
405
405
 
406
406
  resp = ::Laximo::Query.
@@ -408,7 +408,7 @@ module Laximo
408
408
  locale(locale).
409
409
  catalog(catalog).
410
410
  vehicle_id(vehicle_id).
411
- quick_group_id(quick_group_id),
411
+ quick_group_id(quick_group_id).
412
412
  all(all).
413
413
  ssd(ssd).
414
414
  localized(localized).
@@ -67,7 +67,10 @@ module Laximo
67
67
  h[key.to_sym] = snd.value
68
68
  }
69
69
 
70
- h[:children] = nodes_to_hash(node.children, recursive: true) if recursive
70
+ if recursive
71
+ children = nodes_to_hash(node.children, recursive: true)
72
+ h[:children] = children unless children.empty?
73
+ end
71
74
  arr << h
72
75
 
73
76
  }
@@ -120,10 +123,11 @@ module Laximo
120
123
  doc.remove_namespaces!
121
124
 
122
125
  res = doc.xpath(RESPONSE_RESULT).children[0].to_s
123
- str_to_xml_tags!(res)
124
126
 
125
127
  @error = nil
126
- @result = parsing_result(::Nokogiri::XML(res)) || []
128
+ @result = parsing_result(
129
+ ::Nokogiri::XML(unescape(res))
130
+ ) || []
127
131
 
128
132
  rescue => ex
129
133
 
@@ -143,15 +147,9 @@ module Laximo
143
147
 
144
148
  end # soap_errors
145
149
 
146
- def str_to_xml_tags!(str)
147
-
148
- str.gsub!('&apos;', "'")
149
- str.gsub!('&quot;', '"')
150
- str.gsub!('&gt;', '>')
151
- str.gsub!('&lt;', '<')
152
- str
153
-
154
- end # str_to_xml_tags!
150
+ def unescape(str)
151
+ ::CGI::unescapeHTML str
152
+ end # unescape
155
153
 
156
154
  end # Base
157
155
 
@@ -15,8 +15,13 @@ module Laximo
15
15
 
16
16
  arr1 << node_to_hash(n2) { |h2, n3|
17
17
 
18
- h1[:attributes] = nodes_to_hash(n3.xpath('./attribute'))
19
- h1[:details] = nodes_to_hash(n3.xpath('./Detail/attribute'))
18
+ h2[:details] = n3.xpath('./Detail').inject([]) { |arr2, n4|
19
+
20
+ arr2 << node_to_hash(n4) { |h3, n5|
21
+ h3[:attributes] = nodes_to_hash(n5.xpath('./attribute'))
22
+ }
23
+
24
+ }
20
25
 
21
26
  }
22
27
 
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  module Laximo
3
3
 
4
- VERSION = '0.5.0'.freeze
4
+ VERSION = '0.5.1'.freeze
5
5
 
6
6
  end # Laximo
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: laximo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Pilyaev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-18 00:00:00.000000000 Z
11
+ date: 2016-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -92,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
92
92
  version: '0'
93
93
  requirements: []
94
94
  rubyforge_project:
95
- rubygems_version: 2.5.1
95
+ rubygems_version: 2.6.4
96
96
  signing_key:
97
97
  specification_version: 4
98
98
  summary: Api for Laximo services