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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 72b2fec5101ae1255ade32d6f1c255d312571bf737b3c4380d868a66287fb1e7
4
- data.tar.gz: 40373357e82222f4b8a69d553db832683a6cf66fed626938032be2cbe2dd9aa2
3
+ metadata.gz: 05407ffbeaaecf32054b8058325079e85e466a27c0caf79607a13844b2cb4353
4
+ data.tar.gz: '079c652b019f5e61536c26fd1b05cc0fa81ec69847fa0305194a864bd9203a07'
5
5
  SHA512:
6
- metadata.gz: f5822433af51aa0b2d3b22e746b238a4c39cc998729c11a76e889cc5746363998b6462d33eeb3d65392869d96f4c3282053a71e813b3e8c0b669335ddd23ed70
7
- data.tar.gz: 9f0b3d6ebbbbea4e26d1a6727b4243b7f45d5501afd44091599560541e6fe9ab86fcf94b18ec550361190d74ee5929f95d9cbc99ddee4c57a105d476527faf61
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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class PGSpecHelper
4
- VERSION = "1.9.11"
4
+ VERSION = "1.9.12"
5
5
  end
@@ -53,17 +53,23 @@ class PGSpecHelper
53
53
 
54
54
  attr_reader :database, :username, :password, :host, :port
55
55
 
56
- def initialize database:, username:, host:, port:, password: nil
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 database.nil?
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 username.nil?
66
+ raise MissingRequiredOptionError, "username is required" if provided_username.nil?
61
67
 
62
68
  # record the configuration
63
- @database = database
69
+ @database = provided_database
64
70
  @host = host
65
71
  @port = port || 5432
66
- @username = 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.11
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-01 00:00:00.000000000 Z
11
+ date: 2023-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg