dump_hook 0.0.5 → 0.0.6

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: '078fe1531c13f72d0e4433e5a50941cdd65bb0b26229d1c110ced8d61d727d39'
4
- data.tar.gz: 215d3b1c335cb419dce2ab7f11b761ee3a08523fed3267f9f1d6ce14aab87f2c
3
+ metadata.gz: 95cef8d6a506cf536c1ae3059ec9bbc9de927f04b37c3af523feffa7276ab4c2
4
+ data.tar.gz: 25cb1e3938647e8b56b8be8e0338fa00331a9ec614ca27ee3af8381e5fb80e77
5
5
  SHA512:
6
- metadata.gz: cb86e1692a482a9f43d1bf7d0327ea520ba9e48f08c0bc438bcee175e64dcf84aa809c5a1569b572e48e5dd6944772fb7a55213efd044ece15340d0c839f2a27
7
- data.tar.gz: 99c66c10ae82d9d4ade593e3286686c82807777e9f271ed0216500c48da4e03ccb1d859631f1e186ae46a46ecb5c9f6ea292a0931a622e89500a01013bc814cd
6
+ metadata.gz: c4dfb91ed9959ccce4c09bf903c729ed0cc86c57fd8c81bb217944f3756989d24982d04236b82766f0e7643c87b92325015624d195fdfcfa0b96a04452b190a6
7
+ data.tar.gz: b922d2df7f844690d8477c2196d9b83424184d0ad2e007da5563832cbd5adcc1b97e8c0173fe79cc69dc756bbaaad1540b00a0d4a8d5c2666f1c162df10d3513
@@ -1,3 +1,3 @@
1
1
  module DumpHook
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
data/lib/dump_hook.rb CHANGED
@@ -60,7 +60,7 @@ module DumpHook
60
60
  when 'postgres'
61
61
  args = ['-a', '-x', '-O', '-f', filename, '-Fc', '-T', 'schema_migrations', '-T', 'ar_internal_metadata']
62
62
  args.concat(pg_connection_args)
63
- Kernel.system("pg_dump", *args)
63
+ Kernel.system(pg_env, "pg_dump", *args)
64
64
  when 'mysql'
65
65
  args = mysql_connection_args
66
66
  args << "--compress"
@@ -77,7 +77,7 @@ module DumpHook
77
77
  args = ['--single-transaction']
78
78
  args.concat(pg_connection_args)
79
79
  args << filename
80
- Kernel.system("pg_restore", *args)
80
+ Kernel.system(pg_env, "pg_restore", *args)
81
81
  when 'mysql'
82
82
  args = mysql_connection_args
83
83
  args.concat ["-e", "source #{filename}"]
@@ -116,6 +116,10 @@ module DumpHook
116
116
  args
117
117
  end
118
118
 
119
+ def pg_env
120
+ settings.password ? { 'PGPASSWORD' => settings.password } : {}
121
+ end
122
+
119
123
  def recreate?(filename)
120
124
  DumpHook.recreate ||= []
121
125
  result = (settings.recreate || ENV["DUMP_HOOK"] == "recreate") && !DumpHook.recreate.include?(filename)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dump_hook
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Ryazantsev