pwinty 3.0.4 → 3.0.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/.env.sample +2 -0
- data/.gitignore +1 -0
- data/Gemfile.lock +40 -38
- data/README.md +2 -0
- data/lib/pwinty/http_errors.rb +1 -1
- data/lib/pwinty/order.rb +9 -2
- data/lib/pwinty/version.rb +1 -1
- data/pwinty.gemspec +2 -1
- metadata +19 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ed7db0843764844edfd7aa88b2c2bcfd9ea3445363cce5ac04a099f0db05478a
|
|
4
|
+
data.tar.gz: 0c8dfce677943320fa92a672a739c5ec05ae323357af47bcc3856426e44b06c1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dea713ec0c5667fa2578f9c82d8654f8b0bd25e2240715cc630db018414a3398f3744a7278c6b373363d74a2eae72e6b27a049904110aef013095d2c636475ea
|
|
7
|
+
data.tar.gz: b816f723de43d8ac43d03077ad6d6ca1002d95ba12808caae6291fde1215ff9c3b57256a09ab0c890f8f7a95f22a869e1d9c1ee32706b40a93ee624ffc127287
|
data/.env.sample
ADDED
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
pwinty (3.0.
|
|
4
|
+
pwinty (3.0.5)
|
|
5
5
|
dry-struct (~> 1.0)
|
|
6
6
|
dry-struct-setters (~> 0.2)
|
|
7
7
|
faraday (~> 0.15)
|
|
@@ -11,72 +11,73 @@ PATH
|
|
|
11
11
|
GEM
|
|
12
12
|
remote: https://rubygems.org/
|
|
13
13
|
specs:
|
|
14
|
-
addressable (2.
|
|
15
|
-
public_suffix (>= 2.0.2, <
|
|
16
|
-
concurrent-ruby (1.1.
|
|
14
|
+
addressable (2.7.0)
|
|
15
|
+
public_suffix (>= 2.0.2, < 5.0)
|
|
16
|
+
concurrent-ruby (1.1.6)
|
|
17
17
|
crack (0.4.3)
|
|
18
18
|
safe_yaml (~> 1.0.0)
|
|
19
19
|
diff-lcs (1.3)
|
|
20
20
|
docile (1.3.2)
|
|
21
|
-
|
|
21
|
+
dotenv (2.7.5)
|
|
22
|
+
dry-configurable (0.11.5)
|
|
22
23
|
concurrent-ruby (~> 1.0)
|
|
23
24
|
dry-core (~> 0.4, >= 0.4.7)
|
|
25
|
+
dry-equalizer (~> 0.2)
|
|
24
26
|
dry-container (0.7.2)
|
|
25
27
|
concurrent-ruby (~> 1.0)
|
|
26
28
|
dry-configurable (~> 0.1, >= 0.1.3)
|
|
27
29
|
dry-core (0.4.9)
|
|
28
30
|
concurrent-ruby (~> 1.0)
|
|
29
|
-
dry-equalizer (0.
|
|
30
|
-
dry-inflector (0.
|
|
31
|
-
dry-logic (1.0.
|
|
31
|
+
dry-equalizer (0.3.0)
|
|
32
|
+
dry-inflector (0.2.0)
|
|
33
|
+
dry-logic (1.0.6)
|
|
32
34
|
concurrent-ruby (~> 1.0)
|
|
33
35
|
dry-core (~> 0.2)
|
|
34
36
|
dry-equalizer (~> 0.2)
|
|
35
|
-
dry-struct (1.
|
|
36
|
-
dry-core (~> 0.4, >= 0.4.
|
|
37
|
-
dry-equalizer (~> 0.
|
|
38
|
-
dry-types (~> 1.
|
|
37
|
+
dry-struct (1.3.0)
|
|
38
|
+
dry-core (~> 0.4, >= 0.4.4)
|
|
39
|
+
dry-equalizer (~> 0.3)
|
|
40
|
+
dry-types (~> 1.3)
|
|
39
41
|
ice_nine (~> 0.11)
|
|
40
42
|
dry-struct-setters (0.2.0)
|
|
41
43
|
dry-struct (>= 0.5.0)
|
|
42
|
-
dry-types (1.
|
|
44
|
+
dry-types (1.4.0)
|
|
43
45
|
concurrent-ruby (~> 1.0)
|
|
44
46
|
dry-container (~> 0.3)
|
|
45
47
|
dry-core (~> 0.4, >= 0.4.4)
|
|
46
|
-
dry-equalizer (~> 0.
|
|
48
|
+
dry-equalizer (~> 0.3)
|
|
47
49
|
dry-inflector (~> 0.1, >= 0.1.2)
|
|
48
50
|
dry-logic (~> 1.0, >= 1.0.2)
|
|
49
|
-
faraday (0.
|
|
51
|
+
faraday (0.17.3)
|
|
50
52
|
multipart-post (>= 1.2, < 3)
|
|
51
|
-
faraday_middleware (0.
|
|
53
|
+
faraday_middleware (0.14.0)
|
|
52
54
|
faraday (>= 0.7.4, < 1.0)
|
|
53
|
-
hashdiff (1.0.
|
|
55
|
+
hashdiff (1.0.1)
|
|
54
56
|
ice_nine (0.11.2)
|
|
55
|
-
json (2.
|
|
57
|
+
json (2.3.0)
|
|
56
58
|
multipart-post (2.1.1)
|
|
57
|
-
public_suffix (
|
|
58
|
-
rake (
|
|
59
|
-
rspec (3.
|
|
60
|
-
rspec-core (~> 3.
|
|
61
|
-
rspec-expectations (~> 3.
|
|
62
|
-
rspec-mocks (~> 3.
|
|
63
|
-
rspec-core (3.
|
|
64
|
-
rspec-support (~> 3.
|
|
65
|
-
rspec-expectations (3.
|
|
59
|
+
public_suffix (4.0.5)
|
|
60
|
+
rake (13.0.1)
|
|
61
|
+
rspec (3.9.0)
|
|
62
|
+
rspec-core (~> 3.9.0)
|
|
63
|
+
rspec-expectations (~> 3.9.0)
|
|
64
|
+
rspec-mocks (~> 3.9.0)
|
|
65
|
+
rspec-core (3.9.2)
|
|
66
|
+
rspec-support (~> 3.9.3)
|
|
67
|
+
rspec-expectations (3.9.2)
|
|
66
68
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
67
|
-
rspec-support (~> 3.
|
|
68
|
-
rspec-mocks (3.
|
|
69
|
+
rspec-support (~> 3.9.0)
|
|
70
|
+
rspec-mocks (3.9.1)
|
|
69
71
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
70
|
-
rspec-support (~> 3.
|
|
71
|
-
rspec-support (3.
|
|
72
|
+
rspec-support (~> 3.9.0)
|
|
73
|
+
rspec-support (3.9.3)
|
|
72
74
|
safe_yaml (1.0.5)
|
|
73
|
-
simplecov (0.
|
|
75
|
+
simplecov (0.18.5)
|
|
74
76
|
docile (~> 1.1)
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
webmock (3.6.2)
|
|
77
|
+
simplecov-html (~> 0.11)
|
|
78
|
+
simplecov-html (0.12.2)
|
|
79
|
+
vcr (5.1.0)
|
|
80
|
+
webmock (3.8.3)
|
|
80
81
|
addressable (>= 2.3.6)
|
|
81
82
|
crack (>= 0.3.2)
|
|
82
83
|
hashdiff (>= 0.4.0, < 2.0.0)
|
|
@@ -86,8 +87,9 @@ PLATFORMS
|
|
|
86
87
|
|
|
87
88
|
DEPENDENCIES
|
|
88
89
|
bundler (~> 1.17)
|
|
90
|
+
dotenv (~> 2.7.5)
|
|
89
91
|
pwinty!
|
|
90
|
-
rake (~>
|
|
92
|
+
rake (~> 13.0)
|
|
91
93
|
rspec (~> 3.0)
|
|
92
94
|
simplecov (~> 0.17)
|
|
93
95
|
vcr (~> 5.0)
|
data/README.md
CHANGED
|
@@ -216,6 +216,8 @@ which are used in the existing tests.
|
|
|
216
216
|
|
|
217
217
|
To install this gem onto your local machine, run `bundle exec rake install`.
|
|
218
218
|
|
|
219
|
+
You can create a `.env` file based on the provided `.env.sample` to hold your Pwinty sandbox credentials.
|
|
220
|
+
|
|
219
221
|
#### For project owners only:
|
|
220
222
|
To release a new version, update the version number in `version.rb`, and then
|
|
221
223
|
run `bundle exec rake release`, which will create a git tag for the version,
|
data/lib/pwinty/http_errors.rb
CHANGED
|
@@ -5,7 +5,7 @@ module Pwinty
|
|
|
5
5
|
case env[:status]
|
|
6
6
|
when 401; raise Pwinty::AuthenticationError, msg
|
|
7
7
|
when 403; raise Pwinty::StateIsInvalid, msg
|
|
8
|
-
when 404; raise Pwinty::
|
|
8
|
+
when 404; raise Pwinty::NotFound, msg
|
|
9
9
|
when 500; raise Pwinty::Error, msg
|
|
10
10
|
end
|
|
11
11
|
end
|
data/lib/pwinty/order.rb
CHANGED
|
@@ -100,8 +100,15 @@ module Pwinty
|
|
|
100
100
|
|
|
101
101
|
def add_images images
|
|
102
102
|
response = Pwinty.conn.post("orders/#{self.id}/images/batch", images)
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
success = response.status == 200
|
|
104
|
+
unless success
|
|
105
|
+
Pwinty.logger.warn response.body['statusTxt']
|
|
106
|
+
end
|
|
107
|
+
if response.body['data'] && response.body['data']['items']
|
|
108
|
+
images = Pwinty.collate_results(response.body['data']['items'], Pwinty::Image)
|
|
109
|
+
self.images = self.images + images
|
|
110
|
+
end
|
|
111
|
+
self.images
|
|
105
112
|
end
|
|
106
113
|
|
|
107
114
|
protected
|
data/lib/pwinty/version.rb
CHANGED
data/pwinty.gemspec
CHANGED
|
@@ -28,12 +28,13 @@ Gem::Specification.new do |spec|
|
|
|
28
28
|
spec.require_paths = ["lib"]
|
|
29
29
|
|
|
30
30
|
spec.add_development_dependency "bundler", "~> 1.17"
|
|
31
|
-
spec.add_development_dependency "rake", "~>
|
|
31
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
|
32
32
|
spec.add_development_dependency "rspec", "~> 3.0"
|
|
33
33
|
|
|
34
34
|
spec.add_development_dependency "vcr", "~> 5.0"
|
|
35
35
|
spec.add_development_dependency "webmock", "~> 3.6"
|
|
36
36
|
spec.add_development_dependency "simplecov", "~> 0.17"
|
|
37
|
+
spec.add_development_dependency "dotenv", "~> 2.7.5"
|
|
37
38
|
|
|
38
39
|
spec.add_dependency "dry-struct", "~> 1.0"
|
|
39
40
|
spec.add_dependency "dry-struct-setters", "~> 0.2"
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pwinty
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.0.
|
|
4
|
+
version: 3.0.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Thomas Harvey
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-
|
|
11
|
+
date: 2020-05-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -30,14 +30,14 @@ dependencies:
|
|
|
30
30
|
requirements:
|
|
31
31
|
- - "~>"
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: '
|
|
33
|
+
version: '13.0'
|
|
34
34
|
type: :development
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
38
|
- - "~>"
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: '
|
|
40
|
+
version: '13.0'
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
42
|
name: rspec
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -94,6 +94,20 @@ dependencies:
|
|
|
94
94
|
- - "~>"
|
|
95
95
|
- !ruby/object:Gem::Version
|
|
96
96
|
version: '0.17'
|
|
97
|
+
- !ruby/object:Gem::Dependency
|
|
98
|
+
name: dotenv
|
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
|
100
|
+
requirements:
|
|
101
|
+
- - "~>"
|
|
102
|
+
- !ruby/object:Gem::Version
|
|
103
|
+
version: 2.7.5
|
|
104
|
+
type: :development
|
|
105
|
+
prerelease: false
|
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
107
|
+
requirements:
|
|
108
|
+
- - "~>"
|
|
109
|
+
- !ruby/object:Gem::Version
|
|
110
|
+
version: 2.7.5
|
|
97
111
|
- !ruby/object:Gem::Dependency
|
|
98
112
|
name: dry-struct
|
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -172,6 +186,7 @@ executables: []
|
|
|
172
186
|
extensions: []
|
|
173
187
|
extra_rdoc_files: []
|
|
174
188
|
files:
|
|
189
|
+
- ".env.sample"
|
|
175
190
|
- ".gitignore"
|
|
176
191
|
- ".rspec"
|
|
177
192
|
- ".travis.yml"
|