active_fulfillment 3.0.3 → 3.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bda8d728697d83cf15dff17825ae52a3754eeda5
4
- data.tar.gz: 82e16d1630948fabdd08859705db6c601731ef9d
3
+ metadata.gz: a0d0b3d3561c71bebf34017db4db327fdfbec098
4
+ data.tar.gz: 0bb2385aa1976f87e88c32ec50c7fcaaf44fa3f9
5
5
  SHA512:
6
- metadata.gz: 44aec13c8d6aa16caea7e1e4e8d112ecb84d1388adf6639e1c619a4d02f1c422174f2a388c7e1877c45c955aa4e1e61da9df16b164968a3f75cc12e6b0a39c94
7
- data.tar.gz: 41c1be9bfebe0986ae4a42e8f246dfe20a6a3ff8e4f58d535b38e643b67aacb5278ea4d89288cfcc4695dfd1ef3284f52799cf0199ed98e80bf64720b264c589
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
- logger.info "[#{@name.upcase} APP] Post #{uri}"
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
- logger.warn "[#{self}] Error while contacting fulfillment service error =\"#{e.message}\""
84
+ log :warn, "Error contacting fulfillment service exception=\"#{e.class}\" message=\"#{e.message}\""
84
85
  end
85
86
  end
86
87
 
87
- line = "[#{@name.upcase} APP] Response from #{uri} --> "
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
- rescue ActiveSupport::JSON.parse_error
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
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module ActiveFulfillment
3
- VERSION = "3.0.3"
3
+ VERSION = "3.0.4"
4
4
  end
data/test/test_helper.rb CHANGED
@@ -5,6 +5,7 @@ require 'active_fulfillment'
5
5
  require 'minitest/autorun'
6
6
  require 'mocha/setup'
7
7
  require 'timecop'
8
+ require 'pry'
8
9
 
9
10
  require 'logger'
10
11
  ActiveFulfillment::Service.logger = Logger.new(nil)
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.3
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-07-07 00:00:00.000000000 Z
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.2.3
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