selly 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 597fbb4b07ffb044811dc1c384117c49822bf49c
4
- data.tar.gz: 1cf58233e4aaa31a2e6a64db53d538441479ffa7
3
+ metadata.gz: 5519998b11cd7ef5513f69f6b0cef92320c38db1
4
+ data.tar.gz: 9ca3816b23f4293c506cbb6f078f52450410325b
5
5
  SHA512:
6
- metadata.gz: bccb7eb96e100c1cb74ea6533ac7147735dd0e157b1f1393b339e5f9ac9c8a8c8ec0476c73bafa0b4d84e657d6b458ebbcb087e16188f4e9d92a43ccce9ac7e1
7
- data.tar.gz: 4c98d8eb77bae42bfeb2b252e9ba7918e8863d8dcab08d3dbdb09dcb62786adeb83aefda6b5b726360f14ed27fa0061beff0de481de79d355da13f53c5b4d9b6
6
+ metadata.gz: 4ec704bd47a0544324493e614e82b7826ad5afd08925ecb0bb4c64f0b141c5c4e1eb3953f93d68de81a4486a3e431f0b472899c53dc983047f284009d47bad70
7
+ data.tar.gz: 10980b695cfca741cf15948afa8103a1222912a9a0ecf615e5894a52df723e5b8e7006cf1fc3a2c96686ec32123828dfd27c3e530a6700096d4274dd77562e83
data/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ .idea/
@@ -1,11 +1,14 @@
1
1
  require 'selly/version'
2
+ require 'selly/operations/create'
2
3
  require 'selly/operations/list'
3
4
  require 'selly/operations/show'
4
5
  require 'selly/resource'
5
6
  require 'selly/blacklist'
6
7
  require 'selly/exchange_rates'
7
8
  require 'selly/orders'
9
+ require 'selly/pay'
8
10
  require 'selly/products'
11
+ require 'selly/product_groups'
9
12
  require 'selly/statistics'
10
13
  require 'base64'
11
14
 
@@ -20,10 +23,9 @@ module Selly
20
23
 
21
24
  def request_headers
22
25
  {
23
- 'User-Agent': USER_AGENT,
24
- 'Accept': JSON_MIME,
25
- 'Content-Type': JSON_MIME,
26
- 'Authorization': 'Basic ' + Base64.encode64("#{@api_email}:#{@api_key}")
26
+ 'User-Agent': USER_AGENT.strip,
27
+ 'Accept': JSON_MIME.strip,
28
+ 'Authorization': 'Basic ' + Base64.encode64("#{@api_email}:#{@api_key}").delete!("\n")
27
29
  }
28
30
  end
29
31
  end
@@ -0,0 +1,11 @@
1
+ require 'http'
2
+
3
+ module Selly
4
+ module Operations
5
+ module Create
6
+ def create(params = {})
7
+ HTTP.post("#{API_ROOT}#{resource_url}", headers: Selly.request_headers, form: params).parse
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,5 @@
1
+ module Selly
2
+ class Pay < Resource
3
+ extend Selly::Operations::Create
4
+ end
5
+ end
@@ -0,0 +1,6 @@
1
+ module Selly
2
+ class ProductGroups < Resource
3
+ extend Selly::Operations::List
4
+ extend Selly::Operations::Show
5
+ end
6
+ end
@@ -1,3 +1,3 @@
1
1
  module Selly
2
- VERSION = '1.1.0'
2
+ VERSION = '1.1.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: selly
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Selly
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-16 00:00:00.000000000 Z
11
+ date: 2017-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http
@@ -70,9 +70,12 @@ files:
70
70
  - lib/selly.rb
71
71
  - lib/selly/blacklist.rb
72
72
  - lib/selly/exchange_rates.rb
73
+ - lib/selly/operations/create.rb
73
74
  - lib/selly/operations/list.rb
74
75
  - lib/selly/operations/show.rb
75
76
  - lib/selly/orders.rb
77
+ - lib/selly/pay.rb
78
+ - lib/selly/product_groups.rb
76
79
  - lib/selly/products.rb
77
80
  - lib/selly/resource.rb
78
81
  - lib/selly/statistics.rb
@@ -99,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
99
102
  version: '0'
100
103
  requirements: []
101
104
  rubyforge_project:
102
- rubygems_version: 2.6.8
105
+ rubygems_version: 2.6.13
103
106
  signing_key:
104
107
  specification_version: 4
105
108
  summary: Ruby library for Selly's API