beslist 0.2.4 → 0.2.5
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/VERSION +1 -1
- data/beslist.gemspec +4 -3
- data/lib/beslist/client.rb +1 -0
- data/lib/beslist/util/params_encoder.rb +18 -0
- data/lib/beslist.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea5f0a314ab7d8e3c6e4b604744b119afe73a69d
|
4
|
+
data.tar.gz: 530c91de6827fca4448d8a7f8352e7a0403078e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c928984efd569b6872151439fd2b1bd91f77ca620436a5c07f0028934f670129f09bff3373e1cd7a4b12f7efa09ec102839ad318f47cb0b83445a55921e8ec9
|
7
|
+
data.tar.gz: b496311e7bb8b0afab43fe5bfbd41e8d3463e7363a9a761a2c2c460eeef34a088562e30af928943fff171f5a9e89a2289918aa9c613a3eff77b36f027ee363e3
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.5
|
data/beslist.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: beslist 0.2.
|
5
|
+
# stub: beslist 0.2.5 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "beslist"
|
9
|
-
s.version = "0.2.
|
9
|
+
s.version = "0.2.5"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Tsyren Ochirov"]
|
14
|
-
s.date = "2016-01-
|
14
|
+
s.date = "2016-01-12"
|
15
15
|
s.description = "A Ruby client for the Beslist API."
|
16
16
|
s.email = "nsu1team@gmail.com"
|
17
17
|
s.extra_rdoc_files = [
|
@@ -34,6 +34,7 @@ Gem::Specification.new do |s|
|
|
34
34
|
"lib/beslist/connection/requests.rb",
|
35
35
|
"lib/beslist/error.rb",
|
36
36
|
"lib/beslist/util/config.rb",
|
37
|
+
"lib/beslist/util/params_encoder.rb",
|
37
38
|
"spec/connection.yml.example",
|
38
39
|
"spec/fixtures/shop_orders.xml",
|
39
40
|
"spec/fixtures/shop_orders_invalid_checksum.xml",
|
data/lib/beslist/client.rb
CHANGED
@@ -25,6 +25,7 @@ module Beslist
|
|
25
25
|
req.params.merge!(date_from: date_from) if date_from
|
26
26
|
req.params.merge!(date_to: date_to) if date_to
|
27
27
|
if Beslist::API::Config.mode == 'sandbox'
|
28
|
+
req.options.params_encoder = Beslist::ParamsEncoder
|
28
29
|
req.params.merge!(output_type: 'test', test_orders: '250')
|
29
30
|
req.params.merge!(test_products: options[:test_products]) unless options[:test_products].nil?
|
30
31
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Beslist
|
2
|
+
module ParamsEncoder
|
3
|
+
def self.encode(params)
|
4
|
+
params.map do |k, v|
|
5
|
+
case v
|
6
|
+
when Array, Hash
|
7
|
+
"#{k}=#{URI.escape(JSON.dump(v))}"
|
8
|
+
else
|
9
|
+
"#{k}=#{v}"
|
10
|
+
end
|
11
|
+
end.join('&')
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.decode(string)
|
15
|
+
string
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/lib/beslist.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beslist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tsyren Ochirov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-01-
|
11
|
+
date: 2016-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_xml
|
@@ -145,6 +145,7 @@ files:
|
|
145
145
|
- lib/beslist/connection/requests.rb
|
146
146
|
- lib/beslist/error.rb
|
147
147
|
- lib/beslist/util/config.rb
|
148
|
+
- lib/beslist/util/params_encoder.rb
|
148
149
|
- spec/connection.yml.example
|
149
150
|
- spec/fixtures/shop_orders.xml
|
150
151
|
- spec/fixtures/shop_orders_invalid_checksum.xml
|