active_fulfillment 3.0.3 → 3.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/active_fulfillment/services/shopify_api.rb +10 -8
- data/lib/active_fulfillment/version.rb +1 -1
- data/test/test_helper.rb +1 -0
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0d0b3d3561c71bebf34017db4db327fdfbec098
|
4
|
+
data.tar.gz: 0bb2385aa1976f87e88c32ec50c7fcaaf44fa3f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 919bf80d6f8ce53cd56d6b51b2b5bf608394b1df0fc43071b66a2c0925309c1a201f148f0f8e378bf9cf38075950e27b19412ddd02722779a51472ea319dcd24
|
7
|
+
data.tar.gz: 12d457a214c0be1c8db06bf90810fe497ba849ac76260fcdb001a78ca09f803b15027a716ccd6895002bec7475d4e535a0e8b0a676fef07b10e48353e655704a
|
@@ -71,7 +71,8 @@ module ActiveFulfillment
|
|
71
71
|
def send_app_request(action, headers, data)
|
72
72
|
uri = request_uri(action, data)
|
73
73
|
|
74
|
-
|
74
|
+
log :info, "GET action=#{action}"
|
75
|
+
log :debug, "GET url=#{uri}"
|
75
76
|
|
76
77
|
response = nil
|
77
78
|
realtime = Benchmark.realtime do
|
@@ -80,13 +81,11 @@ module ActiveFulfillment
|
|
80
81
|
response = ssl_get(uri, headers)
|
81
82
|
end
|
82
83
|
rescue *(RESCUABLE_CONNECTION_ERRORS) => e
|
83
|
-
|
84
|
+
log :warn, "Error contacting fulfillment service exception=\"#{e.class}\" message=\"#{e.message}\""
|
84
85
|
end
|
85
86
|
end
|
86
87
|
|
87
|
-
|
88
|
-
line << "#{response} #{"%.4fs" % realtime}"
|
89
|
-
logger.info line
|
88
|
+
log :info, "GET response action=#{action} in #{"%.4fs" % realtime} #{response}"
|
90
89
|
|
91
90
|
response
|
92
91
|
end
|
@@ -95,11 +94,10 @@ module ActiveFulfillment
|
|
95
94
|
response_data = ActiveSupport::JSON.decode(json_data)
|
96
95
|
return {} unless response_data.is_a?(Hash)
|
97
96
|
response_data[root.underscore] || response_data
|
98
|
-
|
99
|
-
|
97
|
+
rescue ActiveSupport::JSON.parse_error
|
98
|
+
{}
|
100
99
|
end
|
101
100
|
|
102
|
-
|
103
101
|
def parse_xml(xml_data, type, key, value)
|
104
102
|
Parsing.with_xml_document(xml_data) do |document, response|
|
105
103
|
# Extract All elements of type and map them!
|
@@ -127,5 +125,9 @@ module ActiveFulfillment
|
|
127
125
|
payload.to_xml(:root => root)
|
128
126
|
end
|
129
127
|
end
|
128
|
+
|
129
|
+
def log(level, message)
|
130
|
+
logger.public_send(level, "[ActiveFulfillment::ShopifyAPIService][#{@name.upcase} app] #{message}")
|
131
|
+
end
|
130
132
|
end
|
131
133
|
end
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_fulfillment
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cody Fauser
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-12-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -129,6 +129,20 @@ dependencies:
|
|
129
129
|
- - ">="
|
130
130
|
- !ruby/object:Gem::Version
|
131
131
|
version: '0'
|
132
|
+
- !ruby/object:Gem::Dependency
|
133
|
+
name: pry
|
134
|
+
requirement: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
type: :development
|
140
|
+
prerelease: false
|
141
|
+
version_requirements: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
132
146
|
description:
|
133
147
|
email: cody@shopify.com
|
134
148
|
executables: []
|
@@ -179,7 +193,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
179
193
|
version: '0'
|
180
194
|
requirements: []
|
181
195
|
rubyforge_project:
|
182
|
-
rubygems_version: 2.
|
196
|
+
rubygems_version: 2.5.1
|
183
197
|
signing_key:
|
184
198
|
specification_version: 4
|
185
199
|
summary: Framework and tools for dealing with shipping, tracking and order fulfillment
|