shopify_transporter 2.4.2 → 2.5.0

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
- SHA1:
3
- metadata.gz: 80de7ac44ca88bbd5594673844b78f83194c5bbf
4
- data.tar.gz: d79f3023a4f0bcdbba5a2171fc48f6cf7022c2dd
2
+ SHA256:
3
+ metadata.gz: 9332dbc1df8f90380027783d5e079153d4cb82e0268a46a0e79d2dbfdcc994ba
4
+ data.tar.gz: 11118012b99e576de3f579d2f04764f67d3b38d3f19e9de9747fd6a66a98813a
5
5
  SHA512:
6
- metadata.gz: d07717c588c29b89a2732a08db6f6510fad13ce53a0c97c66e0eb574db8a2f95fa66d437094f9d1fe6d3232f8413cc54bc74ae53aafb6a2098b50e1debf1c70f
7
- data.tar.gz: 725505e741bcff8f844240fee6885c29be1714d77fec5248312e8392e8ab4352c3ece52158e59ff8f62b50fee89161558d9e3ddc063e726a607b49c591aead57
6
+ metadata.gz: 449e03e75680cad6c9c37df3265c14fb96fa7147db69f923f7f9452ee556cf30086b540b5c3b984f59b2e836a7e6a9affa1c851a112cd4a1fa0e7450aa67e4c5
7
+ data.tar.gz: 67453eaca770aca247c342540772cfd1cdf96acd2a47470088e64b5546bd73825bb94ce6729332547e09660242a5f21071f994a522a4c8682baef0f231840f1d
@@ -74,12 +74,16 @@ module ShopifyTransporter
74
74
 
75
75
  def soap_client
76
76
  @soap_client ||= Savon.client(
77
- wsdl: "https://#{@hostname}/api/v2_soap?wsdl",
77
+ wsdl: "#{hostname_with_scheme}/api/v2_soap?wsdl",
78
78
  open_timeout: 500,
79
79
  read_timeout: 500,
80
80
  )
81
81
  end
82
82
 
83
+ def hostname_with_scheme
84
+ URI.parse(@hostname).scheme.present? ? @hostname : 'https://' + @hostname
85
+ end
86
+
83
87
  def soap_session_id
84
88
  return @soap_session_id if @soap_session_id.present?
85
89
 
@@ -82,9 +82,11 @@ module ShopifyTransporter
82
82
  def qualifies_for_percentage_discount?(hash)
83
83
  return false unless line_items?(hash)
84
84
 
85
- return true if line_items(hash).is_a?(Hash) && value_as_float(line_items(hash), 'discount_percent') > 0
86
-
87
- all_discount_percentages(hash).length == 1 && all_discount_percentages(hash).first > 0
85
+ if line_items(hash).is_a?(Hash)
86
+ value_as_float(line_items(hash), 'discount_percent') > 0
87
+ else
88
+ all_discount_percentages(hash).length == 1 && all_discount_percentages(hash).first > 0
89
+ end
88
90
  end
89
91
 
90
92
  def line_items?(hash)
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ShopifyTransporter
3
- VERSION = '2.4.2'
3
+ VERSION = '2.5.0'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopify_transporter
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.2
4
+ version: 2.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-11-05 00:00:00.000000000 Z
11
+ date: 2018-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -206,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
206
206
  version: '0'
207
207
  requirements: []
208
208
  rubyforge_project:
209
- rubygems_version: 2.6.14
209
+ rubygems_version: 2.7.6
210
210
  signing_key:
211
211
  specification_version: 4
212
212
  summary: Tools for migrating to Shopify