zuora_connect 1.3.1.2 → 1.3.2

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: 0918a9b3d25186029672aaf6f406c115590462ef
4
- data.tar.gz: 4bf73724a0e1c9897a09ff24b0b6d0ca515a29a7
3
+ metadata.gz: 23c46b24f33368a80465464a3502caae7dfa3aed
4
+ data.tar.gz: 35fde6ce89acdd31c8dd828c3a72f277dd1e1635
5
5
  SHA512:
6
- metadata.gz: b3d4aa009506bf54d089fc796487716eccd5cc732156c0f7c227662cb33707231e63f20e35a2ceb2e469176e745f370419f7d42bca2d34667430c34715e10c3b
7
- data.tar.gz: 486f69a9431f1bcaee96eb1362aa4f0ca80028d85838ae4bc815a668d4920d56ca8fd7a87df0f6f2c88c237196363267067db03c12e1b1f9f714d1c634c9f77e
6
+ metadata.gz: 5ea1686e5ec6aeeb3e2d999c9c26f2d481299fbf889330ad313de00236be2d1683221119578983e1f14e87845c38670e3207a247b2a910815452d53c444d4706
7
+ data.tar.gz: 2d95e2d5447fb38a8b3505c07014e3ca673cde8379534aed7472c4a4c1b178772de0229c7b065e7c61e460ce84ffb4dbc08d10b2e74e5de9c57afcf740c525c5
@@ -7,13 +7,6 @@ module ZuoraConnect
7
7
  def init
8
8
  @options = Hash.new
9
9
  @logins = Hash.new
10
- if ZuoraConnect.configuration.use_s3
11
- if ZuoraConnect.configuration.mode == "Development"
12
- @s3_client = Aws::S3::Resource.new(region: ZuoraConnect.configuration.aws_region,access_key_id: ZuoraConnect.configuration.dev_mode_access_key_id,secret_access_key: ZuoraConnect.configuration.dev_mode_secret_access_key)
13
- else
14
- @s3_client = Aws::S3::Resource.new(region: ZuoraConnect.configuration.aws_region)
15
- end
16
- end
17
10
  @valid = false
18
11
  self.attr_builder("timezone", ZuoraConnect.configuration.default_time_zone)
19
12
  self.attr_builder("locale", ZuoraConnect.configuration.default_locale)
@@ -145,13 +138,21 @@ module ZuoraConnect
145
138
 
146
139
  def upload_to_s3(local_file,s3_path = nil)
147
140
  s3_path = local_file.split("/").last if s3_path.nil?
148
- obj = @s3_client.bucket(ZuoraConnect.configuration.s3_bucket_name).object("#{ZuoraConnect.configuration.s3_folder_name}/#{self.id.to_s}/#{s3_path}}")
141
+ obj = self.s3_client.bucket(ZuoraConnect.configuration.s3_bucket_name).object("#{ZuoraConnect.configuration.s3_folder_name}/#{self.id.to_s}/#{s3_path}}")
149
142
  obj.upload_file(local_file)
150
143
  end
151
144
 
152
145
  def get_s3_file_url(key)
153
- signer = Aws::S3::Presigner.new(client: @s3_client)
154
- url = signer.presigned_url(:get_object, bucket: ZuoraConnect.configuration.s3_bucket_name, key: "#{ZuoraConnect.configuration.s3_folder_name}/#{key}")
146
+ signer = Aws::S3::Presigner.new(client: self.s3_client)
147
+ url = signer.presigned_url(:get_object, bucket: ZuoraConnect.configuration.s3_bucket_name, key: "#{ZuoraConnect.configuration.s3_folder_name}/#{self.id.to_s}/#{key}")
148
+ end
149
+
150
+ def s3_client
151
+ if ZuoraConnect.configuration.mode == "Development"
152
+ @s3_client ||= Aws::S3::Resource.new(region: ZuoraConnect.configuration.aws_region,access_key_id: ZuoraConnect.configuration.dev_mode_access_key_id,secret_access_key: ZuoraConnect.configuration.dev_mode_secret_access_key)
153
+ else
154
+ @s3_client ||= Aws::S3::Resource.new(region: ZuoraConnect.configuration.aws_region)
155
+ end
155
156
  end
156
157
 
157
158
  def self.decrypt_response(resp)
@@ -1,3 +1,3 @@
1
1
  module ZuoraConnect
2
- VERSION = "1.3.1.2"
2
+ VERSION = "1.3.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zuora_connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1.2
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Connect Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-19 00:00:00.000000000 Z
11
+ date: 2017-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord-session_store