pgchief 0.5.1 → 0.5.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
  SHA256:
3
- metadata.gz: 22c8374fdee4a24fde56bb1edd737694551b73288643b93078efa5f73c149a1b
4
- data.tar.gz: bbebe5882166def3e96dc08804d695c4c2f9d629735173fbde82dcfcd70aaa1e
3
+ metadata.gz: 613ce14b91c64d69a6fa16449f8ea8aa2a3dfcab054684efaefe978eaae0f564
4
+ data.tar.gz: 7116499bc9a4ea6e30b850bbe07e953e7068b7c2b8c03b32daef87dde6fe0061
5
5
  SHA512:
6
- metadata.gz: 0fd0d65a33b1370a2dda33e4ecd06710b7140eefe911c4f3f9eadbe2bea81bd272a43b8bf013c472afa0cee035f785bd9336d8521b86210536cef43dffc944a8
7
- data.tar.gz: 3314266704ccb6db85feffdd93a104441565bf89f034295f0ce29d4d3f6783e5ccc134964a409c5885066852f27975c062773b77c6a126cc159dbaace3d8bde3
6
+ metadata.gz: 3725ab140a34f5e8c41fb13e9c737835a96ca440d2519ee377991921af672109321984e8d089813be6042af732642a4c94127da2d8873d1214f32c0073583299
7
+ data.tar.gz: f560244827039f3258151f2e8e573b5d4584847cd5ddccf84e085b00104f21b45fa77af1c6a85df54d8ee2ace45a5915d4240ef06ee24ae5714625072eb5ec46
data/CHANGELOG.md CHANGED
@@ -13,11 +13,22 @@ and this project will try its best to adhere to [Semantic Versioning](https://se
13
13
 
14
14
  ### Fixes
15
15
 
16
+ ## [0.5.2]
17
+
18
+ ### Changes
19
+
20
+ * Change S3 config option `s3_path_prefix` to `s3_objects_path`.
21
+ * Above change retains backwards compatibility with the old `s3_path_prefix` option.
22
+
23
+ ### Fixes
24
+
25
+ * Fix S3 regex to allow `-` in the path.
26
+
16
27
  ## [0.5.1]
17
28
 
18
29
  ### Changes
19
30
 
20
- * Update README to note that libpq-dev is a required dependency in order to build
31
+ * Update README to note that libpq-dev is a required dependency in order to build.
21
32
 
22
33
  ### Fixes
23
34
 
@@ -27,14 +38,14 @@ and this project will try its best to adhere to [Semantic Versioning](https://se
27
38
 
28
39
  ### Additions
29
40
 
30
- * Restore database from local file(s)
31
- * Restore database from s3
41
+ * Restore database from local file(s).
42
+ * Restore database from s3.
32
43
 
33
44
  ## [0.4.0]
34
45
 
35
46
  ### Changes
36
47
 
37
- * Clean up the config object
48
+ * Clean up the config object.
38
49
 
39
50
  ### Additions
40
51
 
@@ -43,7 +54,7 @@ and this project will try its best to adhere to [Semantic Versioning](https://se
43
54
  ### Fixes
44
55
 
45
56
  * Capture error where the config file does not exist and provide some guidance.
46
- * Make a `PG::ConnectionBad` error a little less scary(?)
57
+ * Make a `PG::ConnectionBad` error a little less scary(?).
47
58
  * Do not inherit the base `Command` class in `ConfigCreate`. It doesn't need to connect to the DB.
48
59
 
49
60
  ## [0.3.1]
@@ -63,24 +74,24 @@ and this project will try its best to adhere to [Semantic Versioning](https://se
63
74
 
64
75
  ### Additions
65
76
 
66
- - Refactor `exe/pgchief` to utilize `TTY::Option` for kicking off config initialization
67
- - `pgchief --init` now creates a toml config file in your `$HOME`
77
+ - Refactor `exe/pgchief` to utilize `TTY::Option` for kicking off config initialization.
78
+ - `pgchief --init` now creates a toml config file in your `$HOME`.
68
79
  - Added ability to store credentials if your config sets `credentials_file`
69
- when db's and users are created
80
+ when db's and users are created.
70
81
  - Added `ConnectionString` class that abstracts the base db connection,
71
- allowing for additions of users and db's
72
- - Load everything in the config file to the Config attributes
82
+ allowing for additions of users and db's.
83
+ - Load everything in the config file to the Config attributes.
73
84
 
74
85
  ### Changes
75
86
 
76
- - Default location of config changed from `~/.pgchief.toml` to `~/.config/pgchief/config.toml`
77
- - Automatically require 'pry' in the test suite
87
+ - Default location of config changed from `~/.pgchief.toml` to `~/.config/pgchief/config.toml`.
88
+ - Automatically require 'pry' in the test suite.
78
89
 
79
90
  ### Fixes
80
91
 
81
92
  - When dropping user, ignore whenever a database has no privileges for the
82
- selected user
83
- - Retroactive addition of tests to cover any regressions
93
+ selected user.
94
+ - Retroactive addition of tests to cover any regressions.
84
95
 
85
96
  ## [0.2.0] - 2024-08-30
86
97
 
@@ -108,7 +119,8 @@ and this project will try its best to adhere to [Semantic Versioning](https://se
108
119
  - Drop user ✅
109
120
  - List databases ✅
110
121
 
111
- [Unreleased]: https://github.com/jayroh/pgchief/compare/v0.5.1...HEAD
122
+ [Unreleased]: https://github.com/jayroh/pgchief/compare/v0.5.2...HEAD
123
+ [0.5.2]: https://github.com/jayroh/pgchief/releases/tag/v0.5.2
112
124
  [0.5.1]: https://github.com/jayroh/pgchief/releases/tag/v0.5.1
113
125
  [0.5.0]: https://github.com/jayroh/pgchief/releases/tag/v0.5.0
114
126
  [0.4.0]: https://github.com/jayroh/pgchief/releases/tag/v0.4.0
data/README.md CHANGED
@@ -137,3 +137,5 @@ Give "rando-username" access to database(s):
137
137
  * [x] Restore remote database @ S3
138
138
  * [ ] Quickly back up via command line option
139
139
  * [ ] Quickly restore via command line option
140
+ * [ ] Task for inclusion in a Rakefile
141
+ * [ ] Support environment variables in config
data/config/pgchief.toml CHANGED
@@ -13,4 +13,4 @@ backup_dir = "~/.config/pgchief/backups"
13
13
  # s3_key = ""
14
14
  # s3_secret = ""
15
15
  # s3_region = "us-east-1"
16
- # s3_path_prefix = "s3://bucket-name/database-backups/"
16
+ # s3_objects_path = "s3://bucket-name/database-backups/"
@@ -13,9 +13,9 @@ module Pgchief
13
13
  :s3_key,
14
14
  :s3_secret,
15
15
  :s3_region,
16
- :s3_path_prefix
16
+ :s3_objects_path
17
17
 
18
- PREFIX_REGEX = %r{\As3://(?<bucket>(\w|-)*)/(?<path>(\w|/)*/)\z}
18
+ PREFIX_REGEX = %r{\As3://(?<bucket>(\w|-)*)/(?<path>(\w|/|-)*/)\z}
19
19
 
20
20
  attr_reader :config
21
21
 
@@ -44,14 +44,14 @@ module Pgchief
44
44
  s3_key,
45
45
  s3_secret,
46
46
  s3_region,
47
- s3_path_prefix
47
+ s3_objects_path
48
48
  ].none?(&:nil?)
49
49
  end
50
50
 
51
51
  private
52
52
 
53
53
  def s3_match
54
- @s3_match ||= s3_path_prefix.match(PREFIX_REGEX)
54
+ @s3_match ||= s3_objects_path.match(PREFIX_REGEX)
55
55
  end
56
56
  end
57
57
  end
@@ -14,7 +14,7 @@ module Pgchief
14
14
  attr_writer :pgurl
15
15
 
16
16
  attr_reader \
17
- :s3_path_prefix,
17
+ :s3_objects_path,
18
18
  :backup_dir,
19
19
  :credentials_file
20
20
 
@@ -26,7 +26,7 @@ module Pgchief
26
26
  self.s3_key = config[:s3_key]
27
27
  self.s3_secret = config[:s3_secret]
28
28
  self.s3_region = config[:s3_region]
29
- self.s3_path_prefix = config[:s3_path_prefix]
29
+ self.s3_objects_path = config[:s3_objects_path] || config[:s3_path_prefix]
30
30
  rescue Errno::ENOENT
31
31
  puts config_missing_error(toml_file)
32
32
  end
@@ -43,8 +43,8 @@ module Pgchief
43
43
  @backup_dir = value ? "#{value.chomp("/")}/".gsub("~", Dir.home) : "/tmp/"
44
44
  end
45
45
 
46
- def s3_path_prefix=(value)
47
- @s3_path_prefix = value ? "#{value.chomp("/")}/" : nil
46
+ def s3_objects_path=(value)
47
+ @s3_objects_path = value ? "#{value.chomp("/")}/" : nil
48
48
  end
49
49
 
50
50
  def credentials_file=(value)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pgchief
4
- VERSION = "0.5.1"
4
+ VERSION = "0.5.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pgchief
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Oliveira
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-11-28 00:00:00.000000000 Z
11
+ date: 2024-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-s3
@@ -160,7 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
160
160
  - !ruby/object:Gem::Version
161
161
  version: '0'
162
162
  requirements: []
163
- rubygems_version: 3.5.21
163
+ rubygems_version: 3.5.23
164
164
  signing_key:
165
165
  specification_version: 4
166
166
  summary: A simple ruby script to manage postgresql databases and users