pgbackups-archive 1.0.3 → 1.1.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
2
  SHA1:
3
- metadata.gz: 4abd195d4ad721f69aaedaa2d509f6cf9a800e29
4
- data.tar.gz: 57241767530afe0d21264e78b03ede679a3c1122
3
+ metadata.gz: 17f8e909b82f674ad68531d9b6b1c9836567fb3a
4
+ data.tar.gz: 29befbf32307acb76631d57e2d85d5ecd0b2b5e0
5
5
  SHA512:
6
- metadata.gz: 5e614e2e645539356e0f3562e1f4f8315462bdb19d82230f862f65838eefcec80c64ab74f029e57e8bd66c2c392a5b013abf74fc844dfc6b7f7bd60e542244fe
7
- data.tar.gz: 88607dcec32782210b34be32a2ea6ff5a9bbc189222934cf819c5eac7f6107cf028313a9a7c055877ced64337e219a5bcb7eb7d02db0cee302b8e1bcbe6eec83
6
+ metadata.gz: ac7b7d112bed636bc0e702a31e4eafeba75487bba81322bf16d3a55e72e27c389a263b7e24554a3ec47b9fb8200e70565f8c7ae3bcfb51530999f1c89e51d42a
7
+ data.tar.gz: 43d0e6be014a117f10cd9d7823e44ab91a342f865667a7adafaef735e17ea4c41db9dabab58c4417c741e2e5f786f8ffdb97e1df085a53a59eacaa8bbd85a71b
data/README.md CHANGED
@@ -13,8 +13,7 @@ If you're still using an older version of `pgbackups-archive`, it's time to upgr
13
13
 
14
14
  Read more about this transition in Heroku's offerings on the Heroku Blog: [PG Backups Levels Up](https://blog.heroku.com/archives/2015/3/11/pgbackups-levels-up)
15
15
 
16
- Please note that the environment variables that need to be defined have changed with
17
- v1.0.0.
16
+ Please note that the environment variables that need to be defined have changed with v1.0.0.
18
17
 
19
18
  ## Overview
20
19
 
@@ -37,7 +36,7 @@ Add the gem to your Gemfile and bundle:
37
36
 
38
37
  ### Install Heroku Scheduler add-on
39
38
 
40
- heroku addons:add scheduler:standard
39
+ heroku addons:create scheduler
41
40
 
42
41
  ### Setup an AWS IAM user, S3 bucket and policy
43
42
 
@@ -64,9 +63,13 @@ A good security measure would be to use a dedicated set of AWS credentials with
64
63
 
65
64
  Then specify `rake pgbackups:archive` as a task you would like to run at any of the available intervals.
66
65
 
66
+ In case you would like to make backups at different intervals simply "protect" a daily task using a bash if-statement, for example to run a task every 1st day in a month:
67
+
68
+ if [ "$(date +%d)" = 01 ]; then rake pgbackups:archive; fi
69
+
67
70
  ### Loading the Rake task
68
71
 
69
- If you're using this gem in a Rails 3 app the rake task will be automatically loaded via a Railtie.
72
+ If you're using this gem in a Rails 3+ app the rake task will be automatically loaded via a Railtie.
70
73
 
71
74
  If you're using this gem with a Rails 2 app, or non-Rails app, add the following to your Rakefile:
72
75
 
@@ -96,22 +99,25 @@ I shouldn't have to say this, but I will. Your backups are your responsibility.
96
99
 
97
100
  Many thanks go to the following who have contributed to making this gem even better:
98
101
 
99
- * [Robert Bousquet (@bousquet)](https://github.com/bousquet)
100
- * Autoload rake task into Rails 2.x once the gem has been loaded.
101
- * [Daniel Morrison (@danielmorrison)](https://github.com/danielmorrison)
102
- * Ruby 1.8-compatible hash syntax.
103
- * [Karl Baum (@kbaum)](https://github.com/kbaum)
104
- * Custom setting for database to backup.
105
- * Streaming support to handle large backup files.
106
- * [Conroy Whitney (@conroywhitney)](https://github.com/conroywhitney)
102
+ * Robert Bousquet ([@bousquet](https://github.com/bousquet))
103
+ * Autoload rake task into Rails 2.x once the gem has been loaded
104
+ * Daniel Morrison ([@danielmorrison](https://github.com/danielmorrison))
105
+ * Ruby 1.8-compatible hash syntax
106
+ * Karl Baum ([@kbaum](https://github.com/kbaum))
107
+ * Custom setting for database to backup
108
+ * Streaming support to handle large backup files
109
+ * Conroy Whitney ([@conroywhitney](https://github.com/conroywhitney))
107
110
  * Use S3 server-side encryption by default
108
- * [Chris Gaffney (@gaffneyc)](https://github.com/gaffneyc)
109
- * Switch from fog to fog-aws.
110
- * Gem config improvements.
111
- * [Juraj Masar @jurajmasar](https://github.com/jurajmasar)
112
- * Fix for reading env var.
111
+ * Chris Gaffney ([@gaffneyc](https://github.com/gaffneyc))
112
+ * Switch from fog to fog-aws
113
+ * Gem config improvements
114
+ * Juraj Masar ([@jurajmasar](https://github.com/jurajmasar))
115
+ * Fix for reading env var
116
+ * Cutom multipart chunk size
117
+ * Jan Stastny ([@jstastny](https://github.com/jstastny))
118
+ * Custom multipart chunk size
113
119
 
114
120
  ## License
115
121
 
116
122
  * Freely distributable and licensed under the [MIT license](http://kjohnston.mit-license.org/license.html).
117
- * Copyright (c) 2012-2015 Kenny Johnston [![endorse](http://api.coderwall.com/kjohnston/endorsecount.png)](http://coderwall.com/kjohnston)
123
+ * Copyright (c) 2012-2016 [Kenny Johnston](https://github.com/kjohnston)
@@ -99,7 +99,7 @@ class PgbackupsArchive::Job
99
99
  end
100
100
 
101
101
  def pgbackups_to_keep
102
- var = ENV["PGBACKUPS_KEEP"] ? ENV["PGBACKUPS_KEEP"].to_i : 30
102
+ ENV["PGBACKUPS_KEEP"] ? ENV["PGBACKUPS_KEEP"].to_i : 30
103
103
  end
104
104
 
105
105
  def temp_file
@@ -23,7 +23,13 @@ class PgbackupsArchive::Storage
23
23
  end
24
24
 
25
25
  def store
26
- bucket.files.create :key => @key, :body => @file, :public => false, :encryption => "AES256"
26
+ options = {:key => @key, :body => @file, :public => false, :encryption => "AES256"}
27
+
28
+ if ENV["PGBACKUPS_MULTIPART_CHUNK_SIZE"]
29
+ options.merge!(:multipart_chunk_size => ENV["PGBACKUPS_MULTIPART_CHUNK_SIZE"].to_i)
30
+ end
31
+
32
+ bucket.files.create(options)
27
33
  end
28
34
 
29
35
  end
@@ -1,3 +1,3 @@
1
1
  module PgbackupsArchive
2
- VERSION = "1.0.3"
2
+ VERSION = "1.1.0"
3
3
  end
@@ -89,7 +89,7 @@ describe PgbackupsArchive::Job do
89
89
 
90
90
  it do
91
91
  @job.download
92
- @job.send(:file).read.must_match /Gem::Specification/
92
+ @job.send(:file).read.must_match(/Gem::Specification/)
93
93
  end
94
94
  end
95
95
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pgbackups-archive
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kenny Johnston
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-06 00:00:00.000000000 Z
11
+ date: 2016-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: heroku
@@ -30,6 +30,20 @@ dependencies:
30
30
  - - "<="
31
31
  - !ruby/object:Gem::Version
32
32
  version: '3.32'
33
+ - !ruby/object:Gem::Dependency
34
+ name: heroku-api
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: 0.3.23
40
+ type: :runtime
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: 0.3.23
33
47
  - !ruby/object:Gem::Dependency
34
48
  name: fog-aws
35
49
  requirement: !ruby/object:Gem::Requirement
@@ -215,7 +229,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
215
229
  version: '0'
216
230
  requirements: []
217
231
  rubyforge_project:
218
- rubygems_version: 2.4.6
232
+ rubygems_version: 2.5.1
219
233
  signing_key:
220
234
  specification_version: 4
221
235
  summary: Automates archival of Heroku PGBackups to S3