nxt_heroku_database_backup 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 595af96eb6b889cece6066f8d336db654bfd3979ac9e362df00d8de5f6e827e7
4
- data.tar.gz: 26b4d8a215d9bc6a001d26e5e447e6b73b4d29e55615b7a8a91f57ffdf761ef0
3
+ metadata.gz: ce3a0d811ceccd906a6cdf5b35ef0445dce65fefa4a9df9bcb38c7e2599205d8
4
+ data.tar.gz: 347647730fba6237575f5e8c50e1aa309436a7e21f93320356eb6eb9b1d2d776
5
5
  SHA512:
6
- metadata.gz: c60d83688c3d8c180e7413b023ca5fb56817923909e97cae80ca2ba2e9c920c598f41322f3d65e6c261915442efae061c4b3e0b247217164550ebd8f07473baa
7
- data.tar.gz: 174aabb498e7d50cccf8720bd85cfd90165f0beaa313b2c9540f0b15c598632a738ee0c7c0925a9081ed547fa75d8f79fdcaa0ce0da1d70e1de498a67def7cd2
6
+ metadata.gz: b3a3ecf8106dd0e0599dbdd0669d5158f47f9baf1ff692b29cb1c38a7d35b2afa2da56ac1a6bd7d2eee3aafede7b4e463e491b241b4f11e92e84b7cb6164dc4f
7
+ data.tar.gz: 84a4c20c9a660b39998cadae86acbe1f2157a45246ce368044a1db23664334558e3a16c244143e880d34acfdf47e2ade03fe7184ff4eb04a15ad0d563293121c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nxt_heroku_database_backup (0.1.4)
4
+ nxt_heroku_database_backup (0.1.6)
5
5
  aws-sdk-s3
6
6
  nxt_init
7
7
 
@@ -3,23 +3,29 @@ module NxtHerokuDatabaseBackup
3
3
  class S3
4
4
  include NxtInit
5
5
 
6
- attr_init :bucket_name, :file_path, :credentials
7
-
8
- def self.build(bucket_name:, file_path:, backup_name:, credentials: nil)
9
- credentials ||= {
10
- access_key_id: ENV.fetch('DATABASE_BACKUP_AWS_ACCESS_KEY_ID'),
11
- secret_access_key: ENV.fetch('DATABASE_BACKUP_AWS_SECRET_ACCESS_KEY'),
12
- region: ENV.fetch('DATABASE_BACKUP_AWS_REGION')
13
- }
14
-
15
- new(
16
- bucket_name: bucket_name,
17
- file_path: file_path,
18
- backup_name: backup_name,
19
- credentials: credentials
20
- )
6
+ class << self
7
+ def build(bucket_name:, file_path:, backup_name:, credentials: default_credentials)
8
+ new(
9
+ bucket_name: bucket_name,
10
+ file_path: file_path,
11
+ backup_name: backup_name,
12
+ credentials: credentials
13
+ )
14
+ end
15
+
16
+ private
17
+
18
+ def default_credentials
19
+ {
20
+ access_key_id: ENV.fetch('DATABASE_BACKUP_AWS_ACCESS_KEY_ID'),
21
+ secret_access_key: ENV.fetch('DATABASE_BACKUP_AWS_SECRET_ACCESS_KEY'),
22
+ region: ENV.fetch('DATABASE_BACKUP_AWS_REGION')
23
+ }
24
+ end
21
25
  end
22
26
 
27
+ attr_init :bucket_name, :file_path, :credentials, :backup_name
28
+
23
29
  def call
24
30
  aws_object.upload_file(file_path)
25
31
  end
@@ -1,3 +1,3 @@
1
1
  module NxtHerokuDatabaseBackup
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nxt_heroku_database_backup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andreas Robecke