dumpcar 0.1.2.1 → 0.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: 1396e074eed574e995b27cd85826da3f17e6aab55d39791a2dd3b9a1bb764c58
4
- data.tar.gz: 1c9e4115887c5fe9b8372c1d5890e5c3cb710a740c63ee633c50244af0567be9
3
+ metadata.gz: 36f1dd091285da9e5736495a0ffc53e2b73176cc327a6d138f2ea8663e0b4d6a
4
+ data.tar.gz: 38d4fe0b357fc007491a154b6203a31514d22f17a21f38c40cfb0fe64eb7d8c9
5
5
  SHA512:
6
- metadata.gz: 982e4e4c0417eabccdba95b61a41862755caa7c45f5c77706e248ec92cfb4916755dbf479cb2b31597663991c2afb0db2f98878f0b1a3cd1d2c620ecbd118a58
7
- data.tar.gz: 5a92d2ad81a9340c03f93eb5d6350fedbff646ad574500821ba56ea050e1e76ad4e2ee1576c6e25dcee87db924dad97026893d05b3a124ee84b8b6031e628b26
6
+ metadata.gz: 0bbe63e7e62033e29df0e1ae907adfbe03edede801be02af50dd551bdc7d98bf41874ff2c46ca790813f18ec34068846f0905fbec696cd78fb61df31978675ec
7
+ data.tar.gz: a9f5a753441535c546e4c2b20af60f8b8b9ea3c4cb42ef9db7aa74bc68780ab84ede78d24d8fd8eea2f11d39a97341a1231d660e164eca8660fa1c07151c6fab
data/lib/dumpcar/pg.rb CHANGED
@@ -12,9 +12,8 @@ module Dumpcar
12
12
  config => {password:, host:, port:, username:, database:}
13
13
  line = Terrapin::CommandLine.new("pg_restore",
14
14
  "--verbose --clean --no-acl --no-owner -h :host -U :username -d :database -p :port :filename",
15
- environment: {"PGPASSWORD" => password})
16
-
17
- puts line.command(password:, host:, port:, username:, database:, filename:)
15
+ environment: {"PGPASSWORD" => password},
16
+ logger:)
18
17
  line.run(password:, host:, port:, username:, database:, filename:)
19
18
  end
20
19
  end
@@ -24,8 +23,8 @@ module Dumpcar
24
23
  config => {password:, host:, port:, username:, database:}
25
24
  line = Terrapin::CommandLine.new("pg_dump",
26
25
  "--host :host --port :port --username :username --clean --format=c --create --if-exists --no-owner --no-acl :database --file=:filename",
27
- environment: {"PGPASSWORD" => password})
28
- puts line.command(password:, host:, port:, username:, database:, filename:)
26
+ environment: {"PGPASSWORD" => password},
27
+ logger:)
29
28
  line.run(password:, host:, port:, username:, database:, filename:)
30
29
  end
31
30
  end
@@ -34,6 +33,10 @@ module Dumpcar
34
33
  yield self.class.defaults.merge(connection)
35
34
  end
36
35
 
36
+ def logger
37
+ Dumpcar::Util.logger
38
+ end
39
+
37
40
  def self.defaults
38
41
  {
39
42
  host: "localhost",
data/lib/dumpcar/util.rb CHANGED
@@ -2,4 +2,8 @@ module Dumpcar::Util
2
2
  def self.get_connection_db_config
3
3
  (Rails.version < "6.1") ? ActiveRecord::Base.connection_config : ActiveRecord::Base.connection_db_config.configuration_hash
4
4
  end
5
+
6
+ def self.logger
7
+ Rails.logger
8
+ end
5
9
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dumpcar
4
- VERSION = "0.1.2.1"
4
+ VERSION = "0.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dumpcar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2.1
4
+ version: '0.2'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Schultz