postgresql-backup 0.0.4 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -1
  3. data/README.md +26 -0
  4. data/lib/tools/database.rb +5 -6
  5. metadata +23 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fe41e3a730be1fc998d44c3f6211692c4f75ca9d4f151c980c6fbb0a61d71c55
4
- data.tar.gz: 4648062b2dc12e6ab6ec76e3bbc055d6ca1fa136cd9f0c3961829d7771ac3e04
3
+ metadata.gz: 0a2a632cc3b5edbcfe9efbcccda2d26dad60d9c71442fafa13f6956bb4070799
4
+ data.tar.gz: 9c00fd45add770d9cf55d163cdf5067341943fc4e69ad62cea4b5feac2981f5d
5
5
  SHA512:
6
- metadata.gz: e3f3bbba53a4613e3648f05d0077d3faedb680776eb277fa84687a99cc56ed52083481ab7c959a91ec6d3e7106b943cb9594448b6ad11cce3db4c8aae2321c65
7
- data.tar.gz: 7665f162692326f36fa8ea79e4630e79b6847f689f9b59c0aa36525391a4b74d787a12912eaa9890610292bb93936661514142c97a54619a72fd49c8d61ac4c6
6
+ metadata.gz: 2093299a3a8736fb8ed84af7011d0e8aac5731f86e4adc7fd61102fdb19e514dea2e9b150c207122e52a707ca284c71c4f8c98430926d46ea2e6d53e07af7aa3
7
+ data.tar.gz: 2ee8cf68d198f4947f599e4d9dda49a4ffbb3397133bb46f91fc1a83f9ebc25bb2ef1f7076a91b9a92d48bf2720ce7425dc6f9658e9d2407bb931db9696b8c48
data/CHANGELOG.md CHANGED
@@ -1,4 +1,8 @@
1
- ### Next
1
+ ### v0.0.7 - 2022-04-19
2
+
3
+ - Add support for ruby 3 and fog-aws 3.13.0
4
+
5
+ ### v0.0.6 - 2021-04-25
2
6
 
3
7
  - Add github as the homepage of the gem
4
8
  - Add changelog to the project
data/README.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  This gem automates PostgreSQL's backup and restore in your Rails project. It will inject two rake tasks that you can use to manage your data, either by using the local system or AWS S3 storage.
4
4
 
5
+ The current version supports ruby 3. If you need backward compatibiliy, use [v0.0.6](https://rubygems.org/gems/postgresql-backup/versions/0.0.6) instead.
6
+
7
+ ## How it looks like?
8
+
9
+ Dump:
10
+ ![](https://res.cloudinary.com/ongmungazi/image/upload/v1650388791/ruby-gem/dump.gif)
11
+
12
+ Restore:
13
+ ![](https://res.cloudinary.com/ongmungazi/image/upload/v1650388791/ruby-gem/restore.gif)
14
+
5
15
  ## Getting started
6
16
 
7
17
  Add the gem to your Rails project:
@@ -139,3 +149,19 @@ Important note: if you are trying to locally restore a backup that was created i
139
149
  Everything will work just fine, but you may come across some strange warnings, like when you try to drop the database: it will say you are droping a production database to double check if this is your intended purpose.
140
150
 
141
151
  To prevent this, every time the rake restores a backup file it tries to replace the environment being copied into the ar_internal_metadata table with the current Rails environment. Thus, `environment production` will become `environment development`.
152
+
153
+ ## I want to contribute
154
+
155
+ Feel free to open a pull request with the changes you want to make. Remember to update `CHANGELOG.md` with the change you are proposing, because once the PR is merged, it is important to show which changes are being made to the gem.
156
+
157
+ The first thing to do is to update the dependencies. If you do not have bundle installed, run `gem install bundler`. Then:
158
+
159
+ ```
160
+ bundle install
161
+ ```
162
+
163
+ To run the tests, we use rspec:
164
+
165
+ ```
166
+ rspec
167
+ ```
@@ -1,4 +1,3 @@
1
- require 'byebug'
2
1
 
3
2
  module Tools
4
3
  class Database
@@ -58,23 +57,23 @@ module Tools
58
57
  attr_reader :configuration
59
58
 
60
59
  def host
61
- @host ||= ::ActiveRecord::Base.connection_config[:host]
60
+ @host ||= ::ActiveRecord::Base.connection_db_config.configuration_hash[:host]
62
61
  end
63
62
 
64
63
  def port
65
- @port ||= ::ActiveRecord::Base.connection_config[:port]
64
+ @port ||= ::ActiveRecord::Base.connection_db_config.configuration_hash[:port]
66
65
  end
67
66
 
68
67
  def database
69
- @database ||= ::ActiveRecord::Base.connection_config[:database]
68
+ @database ||= ::ActiveRecord::Base.connection_db_config.configuration_hash[:database]
70
69
  end
71
70
 
72
71
  def user
73
- ::ActiveRecord::Base.connection_config[:username]
72
+ ::ActiveRecord::Base.connection_db_config.configuration_hash[:username]
74
73
  end
75
74
 
76
75
  def password
77
- @password ||= ::ActiveRecord::Base.connection_config[:password]
76
+ @password ||= ::ActiveRecord::Base.connection_db_config.configuration_hash[:password]
78
77
  end
79
78
 
80
79
  def file_name
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: postgresql-backup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Artur Caliendo Prado
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-07 00:00:00.000000000 Z
11
+ date: 2022-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bump
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.8.0
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.8.0
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: rspec
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -25,33 +39,33 @@ dependencies:
25
39
  - !ruby/object:Gem::Version
26
40
  version: 3.10.0
27
41
  - !ruby/object:Gem::Dependency
28
- name: bump
42
+ name: simplecov
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
45
  - - "~>"
32
46
  - !ruby/object:Gem::Version
33
- version: 0.8.0
47
+ version: 0.21.2
34
48
  type: :development
35
49
  prerelease: false
36
50
  version_requirements: !ruby/object:Gem::Requirement
37
51
  requirements:
38
52
  - - "~>"
39
53
  - !ruby/object:Gem::Version
40
- version: 0.8.0
54
+ version: 0.21.2
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: fog-aws
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
59
  - - "~>"
46
60
  - !ruby/object:Gem::Version
47
- version: 3.10.0
61
+ version: 3.13.0
48
62
  type: :runtime
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
66
  - - "~>"
53
67
  - !ruby/object:Gem::Version
54
- version: 3.10.0
68
+ version: 3.13.0
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: pastel
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -113,7 +127,7 @@ files:
113
127
  - lib/tools/disclaimer.rb
114
128
  - lib/tools/s3_storage.rb
115
129
  - lib/tools/terminal.rb
116
- homepage: https://rubygems.org/gems/postgresql-backup
130
+ homepage: https://github.com/arturcp/postgresql-backup
117
131
  licenses:
118
132
  - MIT
119
133
  metadata: {}
@@ -132,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
132
146
  - !ruby/object:Gem::Version
133
147
  version: '0'
134
148
  requirements: []
135
- rubygems_version: 3.1.2
149
+ rubygems_version: 3.0.3
136
150
  signing_key:
137
151
  specification_version: 4
138
152
  summary: Automate PostgreSQL's backup and restore