pg_spec_helper 1.9.11 → 1.9.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/pg_spec_helper/version.rb +1 -1
- data/lib/pg_spec_helper.rb +11 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05407ffbeaaecf32054b8058325079e85e466a27c0caf79607a13844b2cb4353
|
4
|
+
data.tar.gz: '079c652b019f5e61536c26fd1b05cc0fa81ec69847fa0305194a864bd9203a07'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec42ef083b0c843178a8cde8c8be08bf47efe4503a36d780a3979e1c9421b142e4517523aba35a5eae1b4df4c886abb1d46ccbeb9e0e6b6ad5eb372d5664fe6c
|
7
|
+
data.tar.gz: b992a3bf513f94ca851c7131398b529301c061e0a58336129bf9061f184deeeccf71070e8aa642a5056d81dab6d6cf404728df00b4a3144d4f8ef9584a959230
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [1.9.12](https://github.com/craigulliott/pg_spec_helper/compare/v1.9.11...v1.9.12) (2023-10-09)
|
4
|
+
|
5
|
+
|
6
|
+
### Bug Fixes
|
7
|
+
|
8
|
+
* accepting both `database` and `dbname` as the name of the database and both `user` and `username` as the name of the user. This covers the naming conventions from both the PG gem and ActiveRecord. ([2f43555](https://github.com/craigulliott/pg_spec_helper/commit/2f435555e1789ecd002f4c22b4feb6f4d2b8cb56))
|
9
|
+
|
3
10
|
## [1.9.11](https://github.com/craigulliott/pg_spec_helper/compare/v1.9.10...v1.9.11) (2023-09-01)
|
4
11
|
|
5
12
|
|
data/lib/pg_spec_helper.rb
CHANGED
@@ -53,17 +53,23 @@ class PGSpecHelper
|
|
53
53
|
|
54
54
|
attr_reader :database, :username, :password, :host, :port
|
55
55
|
|
56
|
-
def initialize
|
56
|
+
def initialize host:, port:, database: nil, dbname: nil, user: nil, username: nil, password: nil
|
57
|
+
# for simplicity, we accept both `database` and `dbname` as the name of the database
|
58
|
+
# and both `user` and `username` as the name of the user
|
59
|
+
# this covers the naming conventions from both the PG gem and ActiveRecord
|
60
|
+
provided_database = dbname || database
|
61
|
+
provided_username = user || username
|
62
|
+
|
57
63
|
# assert that all required options are present
|
58
|
-
raise MissingRequiredOptionError, "database is required" if
|
64
|
+
raise MissingRequiredOptionError, "database is required" if provided_database.nil?
|
59
65
|
raise MissingRequiredOptionError, "host is required" if host.nil?
|
60
|
-
raise MissingRequiredOptionError, "username is required" if
|
66
|
+
raise MissingRequiredOptionError, "username is required" if provided_username.nil?
|
61
67
|
|
62
68
|
# record the configuration
|
63
|
-
@database =
|
69
|
+
@database = provided_database
|
64
70
|
@host = host
|
65
71
|
@port = port || 5432
|
66
|
-
@username =
|
72
|
+
@username = provided_username
|
67
73
|
# password is optional
|
68
74
|
@password = password
|
69
75
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pg_spec_helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.9.
|
4
|
+
version: 1.9.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Craig Ulliott
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-09
|
11
|
+
date: 2023-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|