dump_hook 0.0.4 → 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: 8d29f2bfed5e365d91f2a090dcf8d0385cffb0dab73d5978f8632e1438148e62
4
- data.tar.gz: 30231c00145a5ef5fbdc45503c6522e38edef79a57dd4a85f0229a70f060a374
3
+ metadata.gz: 95cef8d6a506cf536c1ae3059ec9bbc9de927f04b37c3af523feffa7276ab4c2
4
+ data.tar.gz: 25cb1e3938647e8b56b8be8e0338fa00331a9ec614ca27ee3af8381e5fb80e77
5
5
  SHA512:
6
- metadata.gz: 8ef067168e702f8761127af0cc6cc51ba724aca2ace1c42a009fe2f2259aa83bd1e61b90b819f743d4a2a92edf00dfea0cae003830b40f9ee51704c64fac113d
7
- data.tar.gz: 4fc68d8c8312fd901ae28aaf9b66abc2ebec3fd2c387cdbec130bdd677ab5f29a8c198d6e0d932f3f5400408ffbec690aba3e0f89530ec05f919fd65ca8c17f1
6
+ metadata.gz: c4dfb91ed9959ccce4c09bf903c729ed0cc86c57fd8c81bb217944f3756989d24982d04236b82766f0e7643c87b92325015624d195fdfcfa0b96a04452b190a6
7
+ data.tar.gz: b922d2df7f844690d8477c2196d9b83424184d0ad2e007da5563832cbd5adcc1b97e8c0173fe79cc69dc756bbaaad1540b00a0d4a8d5c2666f1c162df10d3513
data/dump_hook.gemspec CHANGED
@@ -9,9 +9,11 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["Alexander Ryazantsev"]
10
10
  spec.email = ["shurik.v.r@gmail.com"]
11
11
 
12
- spec.summary = %q{Dumps to cache you backgrounds}
13
- spec.description = %q{We use it for our capybara/Cucumber features.}
14
- spec.homepage = "https://github.com/Anadea/dump_hook"
12
+ spec.summary = "Speed up acceptance and system tests by caching and restoring database state"
13
+ spec.description = "DumpHook speeds up your Rails system and acceptance tests by dumping and restoring " \
14
+ "database state instead of recreating it from scratch on every run. " \
15
+ "Supports PostgreSQL and MySQL. Works with Capybara, RSpec, Cucumber, and Minitest."
16
+ spec.homepage = "https://github.com/alvir/dump_hook"
15
17
  spec.license = "MIT"
16
18
 
17
19
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
@@ -1,3 +1,3 @@
1
1
  module DumpHook
2
- VERSION = "0.0.4"
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.4
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Ryazantsev
@@ -108,7 +108,9 @@ dependencies:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
- description: We use it for our capybara/Cucumber features.
111
+ description: DumpHook speeds up your Rails system and acceptance tests by dumping
112
+ and restoring database state instead of recreating it from scratch on every run.
113
+ Supports PostgreSQL and MySQL. Works with Capybara, RSpec, Cucumber, and Minitest.
112
114
  email:
113
115
  - shurik.v.r@gmail.com
114
116
  executables:
@@ -130,7 +132,7 @@ files:
130
132
  - dump_hook.gemspec
131
133
  - lib/dump_hook.rb
132
134
  - lib/dump_hook/version.rb
133
- homepage: https://github.com/Anadea/dump_hook
135
+ homepage: https://github.com/alvir/dump_hook
134
136
  licenses:
135
137
  - MIT
136
138
  metadata: {}
@@ -152,5 +154,5 @@ requirements: []
152
154
  rubygems_version: 3.1.6
153
155
  signing_key:
154
156
  specification_version: 4
155
- summary: Dumps to cache you backgrounds
157
+ summary: Speed up acceptance and system tests by caching and restoring database state
156
158
  test_files: []