beslist 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/beslist.gemspec +3 -3
- data/lib/beslist/client.rb +2 -1
- data/lib/beslist/connection.rb +1 -1
- data/lib/beslist/util/config.rb +0 -2
- data/spec/lib/beslist/connection_spec.rb +2 -4
- data/spec/support/config.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5c73a67dbc5649df7d62933128148810aafbc58
|
4
|
+
data.tar.gz: 57e31af00dfba822784bee2ba6d6359de0baf4be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1bf64ea6b37f6371da84b20396aba888d8b17508b48aa6ccce3892144f6a64931a2042b538e9d94a6972c7590ede42de93854fefcbb868ea8dc4c06be770700e
|
7
|
+
data.tar.gz: 0b32cbb547fa569e694c718bdeffd8122ee2053d3d2872076a0681e7aabbd6cda4bae266810e08b9107a02422e6f3539eb61a78026f76517627dd9d5fdb95594
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.2
|
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.2 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.2"
|
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 = "2015-12-
|
14
|
+
s.date = "2015-12-24"
|
15
15
|
s.description = "A Ruby client for the Beslist API."
|
16
16
|
s.email = "nsu1team@gmail.com"
|
17
17
|
s.extra_rdoc_files = [
|
data/lib/beslist/client.rb
CHANGED
@@ -7,7 +7,8 @@ module Beslist
|
|
7
7
|
|
8
8
|
def initialize(options = {})
|
9
9
|
@connection = Beslist::API::Connection.new( :client_id => options[:client_id],
|
10
|
-
:shop_id => options[:shop_id]
|
10
|
+
:shop_id => options[:shop_id],
|
11
|
+
:personal_key => options[:personal_key])
|
11
12
|
end
|
12
13
|
|
13
14
|
def orders(options)
|
data/lib/beslist/connection.rb
CHANGED
@@ -24,7 +24,7 @@ module Beslist
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def checksum(*dynamic_parts)
|
27
|
-
base =
|
27
|
+
base = options[:personal_key]+options[:client_id]+options[:shop_id]
|
28
28
|
Digest::MD5.hexdigest(base+dynamic_parts.join(''))
|
29
29
|
end
|
30
30
|
|
data/lib/beslist/util/config.rb
CHANGED
@@ -6,13 +6,11 @@ module Beslist
|
|
6
6
|
class << self
|
7
7
|
attr_accessor :endpoint
|
8
8
|
attr_accessor :prefix
|
9
|
-
attr_accessor :personal_key
|
10
9
|
attr_accessor :mode
|
11
10
|
end
|
12
11
|
|
13
12
|
self.endpoint = "https://www.beslist.nl"
|
14
13
|
self.prefix = "/xml"
|
15
|
-
self.personal_key = nil
|
16
14
|
self.mode = 'sandbox'
|
17
15
|
|
18
16
|
end
|
@@ -4,13 +4,11 @@ describe Beslist::API::Connection do
|
|
4
4
|
|
5
5
|
before do
|
6
6
|
@connection = Beslist::API::Connection.new( :client_id => Beslist::Spec.client_id,
|
7
|
-
:shop_id => Beslist::Spec.shop_id
|
7
|
+
:shop_id => Beslist::Spec.shop_id,
|
8
|
+
:personal_key => Beslist::Spec.personal_key)
|
8
9
|
end
|
9
10
|
|
10
11
|
describe '#checksum' do
|
11
|
-
before do
|
12
|
-
Beslist::API::Config.personal_key = '31f1a5832cc7db98fbd6ab5e802af159'
|
13
|
-
end
|
14
12
|
it 'returns md5 hexdigest' do
|
15
13
|
expect(@connection.checksum('2015-09-01', '2015-09-03')).to eq("5439de2fa578c75d1d9ba4195efc663c")
|
16
14
|
end
|
data/spec/support/config.rb
CHANGED
@@ -2,12 +2,12 @@ require "yaml"
|
|
2
2
|
|
3
3
|
config = YAML.load_file "spec/connection.yml"
|
4
4
|
|
5
|
-
Beslist::
|
6
|
-
Beslist::Spec.personal_key = Beslist::API::Config.personal_key
|
5
|
+
Beslist::Spec.personal_key = '31f1a5832cc7db98fbd6ab5e802af159'
|
7
6
|
Beslist::Spec.client_id = '99999'
|
8
7
|
Beslist::Spec.shop_id = '88888'
|
9
8
|
Beslist::Spec.instance = Beslist::API::Client.new(:client_id => Beslist::Spec.client_id,
|
10
|
-
:shop_id => Beslist::Spec.shop_id
|
9
|
+
:shop_id => Beslist::Spec.shop_id,
|
10
|
+
:personal_key => Beslist::Spec.personal_key)
|
11
11
|
|
12
12
|
Beslist::Spec.date_from = '2015-09-01'
|
13
13
|
Beslist::Spec.date_to = '2015-09-03'
|
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.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tsyren Ochirov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_xml
|