zuora_api 1.6.31 → 1.6.32

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
  SHA256:
3
- metadata.gz: acfa3e7e0f3a11749e634decc914b3c68a4181ff95fb4857c5d0181e9034d4ed
4
- data.tar.gz: 16c584970adc6d1715533d9cc2cec7af2db6c1fc03c0ad795507194c1e37211b
3
+ metadata.gz: 9fd3df0e6eb30121ce6d8ff8e53ad31fb997a79b41a06830683408f47c2ec4eb
4
+ data.tar.gz: 9cc7684caf0a1406d71d752c50cae162440a1ac27e2c1585c3fe8c252e6b9ea5
5
5
  SHA512:
6
- metadata.gz: d75de3d0585c02eb4a7bae1a4a597c4d64eba90adf11c1374e2b5f392f965cc12f417def1a2b2fc17b7c68967d24cbfe6b2bc577b43205b4b8431961df55cb51
7
- data.tar.gz: 589505bc63eecc6929e62261e7f32b26b1d0b768a9953c344d08b0b56d548646897371ece804dae19735b6e00c0dd818d978ebac32009399d814fc0ce0216ecc
6
+ metadata.gz: 7ea0e1f9f88569d546520cf170f8685ec8c0b73df8f63dc9051324e556541ecb650aa166ca0c704da4f83e7766d96fbebbc29b19ca7f786195e28b8a612cb321
7
+ data.tar.gz: 97d137fb6ccf8c65d12f2dd994736a25156b3e4f6cb0237a827bdbde1a32ad1a82b17e9309fd28a34e44f981d0e968cf29266623678202391f9095d37eb667b9
data/CHANGELOG.md CHANGED
@@ -1,6 +1,18 @@
1
1
  # Changelog
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+ ## [1.6.32] - 2018-5-14
5
+ ### Changed
6
+ - Don't log fatal errors, allow application to decide for file download
7
+ - Don't change api url if the user set a high api url
8
+
9
+ ###Removed
10
+ - Force encoding
11
+
12
+ ## [1.6.28] - 2018-3-12
13
+ ### Added
14
+ - Way to avoid force encoding for filedownload
15
+
4
16
  ## [1.6.28] - 2018-3-12
5
17
  ### Added
6
18
  - Way to avoid force encoding for filedownload
@@ -6,7 +6,7 @@ module ZuoraAPI
6
6
  class Login
7
7
  ENVIRONMENTS = [SANDBOX = 'Sandbox', PRODUCTION = 'Production', PREFORMANCE = 'Preformance', SERVICES = 'Services', UNKNOWN = 'Unknown', STAGING = 'Staging' ]
8
8
  REGIONS = [EU = 'EU', US = 'US', NA = 'NA' ]
9
- MIN_Endpoint = '91.0'
9
+ MIN_Endpoint = '96.0'
10
10
  XML_SAVE_OPTIONS = Nokogiri::XML::Node::SaveOptions::AS_XML | Nokogiri::XML::Node::SaveOptions::NO_DECLARATION
11
11
  CONNECTION_EXCEPTIONS = [Net::OpenTimeout, OpenSSL::SSL::SSLError, Errno::ECONNREFUSED, SocketError]
12
12
  CONNECTION_READ_EXCEPTIONS = [Net::ReadTimeout, Errno::ECONNRESET, Errno::EPIPE]
@@ -16,7 +16,7 @@ module ZuoraAPI
16
16
  def initialize(url: nil, entity_id: nil, session: nil, status: nil, **keyword_args)
17
17
  raise "URL is nil or empty, but URL is required" if url.nil? || url.empty?
18
18
  # raise "URL is improper. URL must contain zuora.com, zuora.eu, or zuora.na" if /zuora.com|zuora.eu|zuora.na/ === url
19
- @url = url.gsub(/(\d{2}\.\d)$/, MIN_Endpoint)
19
+ @url = url.gsub(/(\d{2}\.\d)$/, MIN_Endpoint) if MIN_Endpoint.to_f > url.scan(/(\d{2}\.\d)$/).dig(0,0).to_f
20
20
  @hostname = /(?<=https:\/\/|http:\/\/)(.*?)(?=\/|$)/.match(url)[0] if !/(?<=https:\/\/|http:\/\/)(.*?)(?=\/|$)/.match(url).nil?
21
21
  @entity_id = get_entity_id(entity_id: entity_id)
22
22
  @errors = Hash.new
@@ -844,7 +844,7 @@ module ZuoraAPI
844
844
  return products, catalog_map
845
845
  end
846
846
 
847
- def get_file(url: nil, headers: {}, count: 3, z_session: true, tempfile: true, output_file_name: nil, add_timestamp: true, file_path: defined?(Rails.root.join('tmp')) ? Rails.root.join('tmp') : Pathname.new(Dir.pwd), timeout_retries: 2, timeout: 120, session_type: :basic, force_encoding: true, **execute_params)
847
+ def get_file(url: nil, headers: {}, count: 3, z_session: true, tempfile: true, output_file_name: nil, add_timestamp: true, file_path: defined?(Rails.root.join('tmp')) ? Rails.root.join('tmp') : Pathname.new(Dir.pwd), timeout_retries: 2, timeout: 120, session_type: :basic, **execute_params)
848
848
  raise "file_path must be of class Pathname" if file_path.class != Pathname
849
849
 
850
850
  #Make sure directory exists
@@ -870,7 +870,6 @@ module ZuoraAPI
870
870
 
871
871
  case response
872
872
  when Net::HTTPNotFound
873
- Rails.logger.fatal("404 - Not Found")
874
873
  raise
875
874
 
876
875
  when Net::HTTPUnauthorized
@@ -881,9 +880,8 @@ module ZuoraAPI
881
880
  raise
882
881
  end
883
882
  end
884
- Rails.logger.fatal("Unauthorized: Retry")
885
883
  self.new_session if z_session
886
- return get_file(:url => url, :headers => headers, :count => count - 1, :z_session => z_session, :tempfile => tempfile, :file_path => file_path, :timeout_retries => timeout_retries, :timeout => timeout, :force_encoding => force_encoding)
884
+ return get_file(:url => url, :headers => headers, :count => count - 1, :z_session => z_session, :tempfile => tempfile, :file_path => file_path, :timeout_retries => timeout_retries, :timeout => timeout)
887
885
 
888
886
  when Net::HTTPClientError
889
887
  raise
@@ -948,11 +946,7 @@ module ZuoraAPI
948
946
  file_handle.binmode
949
947
 
950
948
  response.read_body do |chunk|
951
- if force_encoding
952
- file_handle << chunk.force_encoding(encoding)
953
- else
954
- file_handle << chunk
955
- end
949
+ file_handle << chunk
956
950
 
957
951
  if defined?(export_size) && export_size != 0 && export_size.class == Integer
958
952
  size += chunk.size
@@ -979,9 +973,8 @@ module ZuoraAPI
979
973
  raise
980
974
  end
981
975
  end
982
- rescue Exception => e
983
- Rails.logger.fatal("Download Failed: #{response_save} - #{e.class} : #{e.message}")
984
- Rails.logger.fatal("Download Failed: #{e.backtrace.join("\n")}")
976
+ rescue => ex
977
+ Rails.logger.fatal(ex)
985
978
  raise
986
979
  end
987
980
  end
@@ -1,3 +1,3 @@
1
1
  module ZuoraAPI
2
- VERSION = "1.6.31"
2
+ VERSION = "1.6.32"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zuora_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.31
4
+ version: 1.6.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zuora Strategic Solutions Group
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-05-04 00:00:00.000000000 Z
11
+ date: 2019-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler