laximo 0.4.1 → 0.4.2
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
- data/README.md +1 -0
- data/laximo.gemspec +1 -1
- data/lib/laximo.rb +8 -0
- data/lib/laximo/oem.rb +25 -0
- data/lib/laximo/query.rb +18 -0
- data/lib/laximo/respond/exec_custom_operation.rb +26 -0
- data/lib/laximo/respond/find_detail.rb +3 -9
- data/lib/laximo/respond/find_oem.rb +3 -9
- data/lib/laximo/respond/list_catalogs.rb +2 -3
- data/lib/laximo/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 500db415d8c7bb15169823c962202d9713ce2e3b
|
|
4
|
+
data.tar.gz: 98058cc1d8580e420beaa073f90ac52ce49350d5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c3872ae2c4839fc9361511d9b44859626488673d06934fe2828fd32a5e990f192db9db35ff6001acd35d8547ef84c9fcb793d45fca0fbf2affda116c0bab2164
|
|
7
|
+
data.tar.gz: 82469f10ae4110cb6ce08de93494ac24472a22c95e85ea6685d1237128457e3bc34a9ea0ec26f3879362abe31c97cfbe2fcf7376213dc8145d01a33e5934d944
|
data/README.md
CHANGED
|
@@ -60,6 +60,7 @@ Laximo.options.debug false
|
|
|
60
60
|
* [Laximo.oem.find_vehicle_by_wizard(catalog, wizard_id, ssd: nil, localized: false, locale: 'ru_RU')](http://laximo.net/index.php/Laximo_Web-services:OEM:FindVehicleByWizard)
|
|
61
61
|
* [Laximo.oem.find_vehicle_by_wizard2(catalog, ssd, locale: 'ru_RU')](http://laximo.net/index.php/Laximo_Web-services:OEM:FindVehicleByWizard2)
|
|
62
62
|
* [Laximo.oem.get_vehicle_info(catalog, vehicle_id, ssd, localized: false, locale: 'ru_RU')](http://laximo.net/index.php/Laximo_Web-services:OEM:GetVehicleInfo)
|
|
63
|
+
* [Laximo.oem.exec_custom_operation(catalog, operation, param, locale: 'ru_RU')](http://laximo.net/index.php/Laximo_Web-services:OEM:ExecCustomOperation)
|
|
63
64
|
* [Laximo.oem.list_units(catalog, vehicle_id, ssd, category_id: nil, localized: false, locale: 'ru_RU')](http://laximo.net/index.php/Laximo_Web-services:OEM:ListUnits)
|
|
64
65
|
* [Laximo.oem.list_categories(catalog, vehicle_id, ssd, category_id: nil, locale: 'ru_RU')](http://laximo.net/index.php/Laximo_Web-services:OEM:ListCategories)
|
|
65
66
|
* [Laximo.oem.get_filter_by_unit(catalog, unit_id, vehicle_id, filter, ssd, locale: 'ru_RU')](http://laximo.net/index.php/Laximo_Web-services:OEM:GetFilterByUnit)
|
data/laximo.gemspec
CHANGED
|
@@ -7,7 +7,7 @@ Gem::Specification.new do |spec|
|
|
|
7
7
|
|
|
8
8
|
spec.name = "laximo"
|
|
9
9
|
spec.version = Laximo::VERSION
|
|
10
|
-
spec.authors = ["Ivan
|
|
10
|
+
spec.authors = ["Ivan Pilyaev"]
|
|
11
11
|
spec.email = ["piliaiev@gmail.com"]
|
|
12
12
|
spec.description = %q{Api for Laximo services}
|
|
13
13
|
spec.summary = %q{Api for Laximo services}
|
data/lib/laximo.rb
CHANGED
|
@@ -34,6 +34,14 @@ module Laximo
|
|
|
34
34
|
::Laximo::Oem.new
|
|
35
35
|
end # oem
|
|
36
36
|
|
|
37
|
+
def deprecated!
|
|
38
|
+
|
|
39
|
+
puts "***"
|
|
40
|
+
puts "*** DEPRECATION WARNING! Method `#{caller[0][/`.*'/][1..-2]}` is deprecated and will not support in the future"
|
|
41
|
+
puts "***"
|
|
42
|
+
|
|
43
|
+
end # depreecated!
|
|
44
|
+
|
|
37
45
|
end # Laximo
|
|
38
46
|
|
|
39
47
|
require 'laximo/defaults'
|
data/lib/laximo/oem.rb
CHANGED
|
@@ -88,6 +88,7 @@ module Laximo
|
|
|
88
88
|
|
|
89
89
|
end # find_vehicle_by_frame
|
|
90
90
|
|
|
91
|
+
# TODO: Устаревший метод
|
|
91
92
|
def get_wizard(
|
|
92
93
|
catalog,
|
|
93
94
|
wizard_id: nil,
|
|
@@ -95,6 +96,8 @@ module Laximo
|
|
|
95
96
|
locale: 'ru_RU'
|
|
96
97
|
)
|
|
97
98
|
|
|
99
|
+
::Laximo.deprecated!
|
|
100
|
+
|
|
98
101
|
resp = ::Laximo::Query.
|
|
99
102
|
new('GetWizard').
|
|
100
103
|
locale(locale).
|
|
@@ -141,6 +144,7 @@ module Laximo
|
|
|
141
144
|
|
|
142
145
|
end # get_wizard_next_step2
|
|
143
146
|
|
|
147
|
+
# TODO: Устаревший метод
|
|
144
148
|
def find_vehicle_by_wizard(
|
|
145
149
|
catalog,
|
|
146
150
|
wizard_id,
|
|
@@ -149,6 +153,8 @@ module Laximo
|
|
|
149
153
|
locale: 'ru_RU'
|
|
150
154
|
)
|
|
151
155
|
|
|
156
|
+
::Laximo.deprecated!
|
|
157
|
+
|
|
152
158
|
resp = ::Laximo::Query.
|
|
153
159
|
new('FindVehicleByWizard').
|
|
154
160
|
locale(locale).
|
|
@@ -200,6 +206,25 @@ module Laximo
|
|
|
200
206
|
|
|
201
207
|
end # get_vehicle_info
|
|
202
208
|
|
|
209
|
+
def exec_custom_operation(
|
|
210
|
+
catalog,
|
|
211
|
+
operation,
|
|
212
|
+
param,
|
|
213
|
+
locale: 'ru_RU'
|
|
214
|
+
)
|
|
215
|
+
|
|
216
|
+
resp = ::Laximo::Query.
|
|
217
|
+
new('GetVehicleInfo').
|
|
218
|
+
locale(locale).
|
|
219
|
+
catalog(catalog).
|
|
220
|
+
operation(operation).
|
|
221
|
+
param(param).
|
|
222
|
+
call(@request)
|
|
223
|
+
|
|
224
|
+
::Laximo::Respond::ExecCustomOperation.new(resp)
|
|
225
|
+
|
|
226
|
+
end # exec_custom_operation
|
|
227
|
+
|
|
203
228
|
def list_units(
|
|
204
229
|
catalog,
|
|
205
230
|
vehicle_id,
|
data/lib/laximo/query.rb
CHANGED
|
@@ -34,6 +34,24 @@ module Laximo
|
|
|
34
34
|
|
|
35
35
|
end # catalog
|
|
36
36
|
|
|
37
|
+
def operation(v = nil)
|
|
38
|
+
|
|
39
|
+
@str = nil
|
|
40
|
+
@query[:operation] = escape(v)
|
|
41
|
+
self
|
|
42
|
+
|
|
43
|
+
end # operation
|
|
44
|
+
|
|
45
|
+
def param(v = nil)
|
|
46
|
+
|
|
47
|
+
@str = nil
|
|
48
|
+
if v.is_a?(Hash) && !v.empty?
|
|
49
|
+
@query[v.keys.first] = escape(v.values.first)
|
|
50
|
+
end
|
|
51
|
+
self
|
|
52
|
+
|
|
53
|
+
end # param
|
|
54
|
+
|
|
37
55
|
def localized(v = false)
|
|
38
56
|
|
|
39
57
|
@str = nil
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
module Laximo
|
|
3
|
+
|
|
4
|
+
module Respond
|
|
5
|
+
|
|
6
|
+
class ExecCustomOperation < Laximo::Respond::Base
|
|
7
|
+
|
|
8
|
+
def parsing_result(str)
|
|
9
|
+
|
|
10
|
+
str.xpath('//ExecCustomOperation/row').inject([]) { |arr, node|
|
|
11
|
+
|
|
12
|
+
h = node_to_hash(node) { |h1, n1|
|
|
13
|
+
h1[:attributes] = nodes_to_hash(n1.xpath('./attribute'))
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
arr << h unless h.empty?
|
|
17
|
+
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
end # parsing_result
|
|
21
|
+
|
|
22
|
+
end # ExecCustomOperation
|
|
23
|
+
|
|
24
|
+
end # Respond
|
|
25
|
+
|
|
26
|
+
end # Laximo
|
|
@@ -11,15 +11,9 @@ module Laximo
|
|
|
11
11
|
|
|
12
12
|
h = node_to_hash(node)
|
|
13
13
|
|
|
14
|
-
h[:images]
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
h[:properties] = node.xpath('./properties/property').inject([]) { |arr1, n1|
|
|
19
|
-
arr1 << node_to_hash(n1)
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
h[:replacements] = node.xpath('./replacements/replacement').inject([]) { |arr1, n1|
|
|
14
|
+
h[:images] = nodes_to_hash(node.xpath('./images/image'))
|
|
15
|
+
h[:properties] = nodes_to_hash(node.xpath('./properties/property'))
|
|
16
|
+
h[:replacements] = node.xpath('./replacements/replacement').inject([]) { |arr1, n1|
|
|
23
17
|
|
|
24
18
|
h1 = node_to_hash(n1)
|
|
25
19
|
h2 = node_to_hash(n1.children[0])
|
|
@@ -11,15 +11,9 @@ module Laximo
|
|
|
11
11
|
|
|
12
12
|
h = node_to_hash(node)
|
|
13
13
|
|
|
14
|
-
h[:images]
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
h[:properties] = node.xpath('./properties/property').inject([]) { |arr1, n1|
|
|
19
|
-
arr1 << node_to_hash(n1)
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
h[:replacements] = node.xpath('./replacements/replacement').inject([]) { |arr1, n1|
|
|
14
|
+
h[:images] = nodes_to_hash(node.xpath('./images/image'))
|
|
15
|
+
h[:properties] = nodes_to_hash(node.xpath('./properties/property'))
|
|
16
|
+
h[:replacements] = node.xpath('./replacements/replacement').inject([]) { |arr1, n1|
|
|
23
17
|
|
|
24
18
|
h1 = node_to_hash(n1)
|
|
25
19
|
h2 = node_to_hash(n1.children[0])
|
|
@@ -11,9 +11,8 @@ module Laximo
|
|
|
11
11
|
|
|
12
12
|
h = node_to_hash(node)
|
|
13
13
|
|
|
14
|
-
h[:features]
|
|
15
|
-
|
|
16
|
-
h[:operations] = node.xpath('./extensions/operations/opration').inject([]) { |arr1, n1|
|
|
14
|
+
h[:features] = nodes_to_hash(node.xpath('./features/feature'))
|
|
15
|
+
h[:operations] = node.xpath('./extensions/operations/opration').inject([]) { |arr1, n1|
|
|
17
16
|
|
|
18
17
|
h1 = node_to_hash(n1)
|
|
19
18
|
h1[:params] = nodes_to_hash(n1.xpath('./params/param'))
|
data/lib/laximo/version.rb
CHANGED
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.4.
|
|
4
|
+
version: 0.4.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
|
-
- Ivan
|
|
7
|
+
- Ivan Pilyaev
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2016-03-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: nokogiri
|
|
@@ -45,6 +45,7 @@ files:
|
|
|
45
45
|
- lib/laximo/query.rb
|
|
46
46
|
- lib/laximo/request.rb
|
|
47
47
|
- lib/laximo/respond.rb
|
|
48
|
+
- lib/laximo/respond/exec_custom_operation.rb
|
|
48
49
|
- lib/laximo/respond/find_detail.rb
|
|
49
50
|
- lib/laximo/respond/find_oem.rb
|
|
50
51
|
- lib/laximo/respond/find_oem_correction.rb
|
|
@@ -91,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
91
92
|
version: '0'
|
|
92
93
|
requirements: []
|
|
93
94
|
rubyforge_project:
|
|
94
|
-
rubygems_version: 2.
|
|
95
|
+
rubygems_version: 2.5.1
|
|
95
96
|
signing_key:
|
|
96
97
|
specification_version: 4
|
|
97
98
|
summary: Api for Laximo services
|