cdek_client 0.0.1 → 0.0.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 +4 -1
- data/lib/cdek_client/util.rb +7 -7
- data/lib/cdek_client/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 256f923801cb7fab5d7dc1a2c7e20d2af86e0597
|
4
|
+
data.tar.gz: 61608d3f16ecce212f3f3399efe06f288b4ae36f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55ff6ecc7b38c9612ea59f3f6e539631dfb169b2ceaa576632d3c2edbd946373eef3679925ade4b6d93501d38d09fce509bfe7fe462aa796d1a0782705379773
|
7
|
+
data.tar.gz: 1dee770091b7f122e55d5ecc02583ab0b376fe110e58278ada5b2caca66f8a9ec38774af290981ad7268d9fe90716245f752ba566f3df628ac4f3f6dc96fe850
|
data/README.md
CHANGED
@@ -414,5 +414,8 @@ result = calculator.calculate params
|
|
414
414
|
|
415
415
|
## Ссылки
|
416
416
|
|
417
|
-
- [www.edostavka.ru](http://www.edostavka.ru/) -
|
417
|
+
- [www.edostavka.ru](http://www.edostavka.ru/) - Сайт СДЭК.
|
418
418
|
- [www.edostavka.ru/clients/integrator.html](http://www.edostavka.ru/clients/integrator.html/) - Документация к API.
|
419
|
+
|
420
|
+
|
421
|
+
Разработано при поддержке интернет-магазина настольных игр "[Танго и Кэш](http://tango-cash.ru/)"
|
data/lib/cdek_client/util.rb
CHANGED
@@ -12,8 +12,8 @@ module CdekClient
|
|
12
12
|
|
13
13
|
def hash_to_xml(hash)
|
14
14
|
root_key = hash.keys.first
|
15
|
-
Nokogiri::XML::Builder.new do |xml|
|
16
|
-
process_hash_to_xml(root_key, hash[root_key], xml)
|
15
|
+
Nokogiri::XML::Builder.new(encoding: 'UTF-8') do |xml|
|
16
|
+
process_hash_to_xml(root_key, hash[root_key], xml)
|
17
17
|
end.to_xml
|
18
18
|
end
|
19
19
|
|
@@ -42,7 +42,7 @@ module CdekClient
|
|
42
42
|
elsif keypath.length == 1
|
43
43
|
return hash[keypath[0]]
|
44
44
|
else
|
45
|
-
return hash_value_at_keypath hash[keypath[0]], keypath[1..-1]
|
45
|
+
return hash_value_at_keypath hash[keypath[0]], keypath[1..-1]
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
@@ -57,7 +57,7 @@ module CdekClient
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def blank?(value)
|
60
|
-
value.nil? ||
|
60
|
+
value.nil? ||
|
61
61
|
(value.is_a?(String) && value.strip == '') ||
|
62
62
|
((value.is_a?(Array) || (value.is_a?(Hash))) && value.empty?)
|
63
63
|
end
|
@@ -65,7 +65,7 @@ module CdekClient
|
|
65
65
|
private
|
66
66
|
|
67
67
|
def xml_node_to_hash(node)
|
68
|
-
# If we are at the root of the document, start the hash
|
68
|
+
# If we are at the root of the document, start the hash
|
69
69
|
if node.element?
|
70
70
|
result_hash = {}
|
71
71
|
if node.attributes != {}
|
@@ -120,6 +120,6 @@ module CdekClient
|
|
120
120
|
end
|
121
121
|
end
|
122
122
|
end
|
123
|
-
|
123
|
+
|
124
124
|
end
|
125
|
-
end
|
125
|
+
end
|
data/lib/cdek_client/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cdek_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Babur Usenakunov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -94,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
94
94
|
version: '0'
|
95
95
|
requirements: []
|
96
96
|
rubyforge_project:
|
97
|
-
rubygems_version: 2.4.
|
97
|
+
rubygems_version: 2.4.8
|
98
98
|
signing_key:
|
99
99
|
specification_version: 4
|
100
100
|
summary: Client for CDEK logistics service API
|