dump_hook 0.0.3 → 0.0.5

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: cda4bb66293e266cdd96f7daf940f922ca709d917dc5ca56fc1968f5df807436
4
- data.tar.gz: 6f84da0ff1bbd961e8f93b936b4d71a47616b8aaca3bbf2dceb98829591698b1
3
+ metadata.gz: '078fe1531c13f72d0e4433e5a50941cdd65bb0b26229d1c110ced8d61d727d39'
4
+ data.tar.gz: 215d3b1c335cb419dce2ab7f11b761ee3a08523fed3267f9f1d6ce14aab87f2c
5
5
  SHA512:
6
- metadata.gz: 33ad6577dae5c891182c5baa976aaaeaf6ca8583616ac36cb896330559494ac0a90053c95e310f46ad690bfe834a3ae788df84dba43c2c8446dd199d7131e4fa
7
- data.tar.gz: c2fc9dc581736b336cd570b5a0064c5df4d9178abc243e0aff07e0b30a3657cc09e13b18448cca532b0a207061639caa2b52ad979bd0173a7ced5cc3e7e22857
6
+ metadata.gz: cb86e1692a482a9f43d1bf7d0327ea520ba9e48f08c0bc438bcee175e64dcf84aa809c5a1569b572e48e5dd6944772fb7a55213efd044ece15340d0c839f2a27
7
+ data.tar.gz: 99c66c10ae82d9d4ade593e3286686c82807777e9f271ed0216500c48da4e03ccb1d859631f1e186ae46a46ecb5c9f6ea292a0931a622e89500a01013bc814cd
data/README.md CHANGED
@@ -33,7 +33,7 @@ There are several parameters to run and manage it.
33
33
  ```ruby
34
34
  DumpHook.setup do |config|
35
35
  config.database = ActiveRecord::Base.configurations[Rails.env]["database"]
36
- config.actual = Date.today.monday.to_s(:number)
36
+ config.actual = Date.today.monday.strftime('%Y%m%d')
37
37
  end
38
38
  ```
39
39
 
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.3"
2
+ VERSION = "0.0.5"
3
3
  end
data/lib/dump_hook.rb CHANGED
@@ -74,7 +74,8 @@ module DumpHook
74
74
  def restore_dump(filename)
75
75
  case settings.database_type
76
76
  when 'postgres'
77
- args = pg_connection_args
77
+ args = ['--single-transaction']
78
+ args.concat(pg_connection_args)
78
79
  args << filename
79
80
  Kernel.system("pg_restore", *args)
80
81
  when 'mysql'
@@ -87,7 +88,7 @@ module DumpHook
87
88
  def full_filename(name, created_on, actual)
88
89
  name_with_created_on = name
89
90
  if created_on
90
- name_with_created_on = "#{name_with_created_on}_#{created_on.to_s(:number)}"
91
+ name_with_created_on = "#{name_with_created_on}_#{created_on.strftime('%Y%m%d')}"
91
92
  elsif actual
92
93
  name_with_created_on = "#{name_with_created_on}_actual#{actual}"
93
94
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dump_hook
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Ryazantsev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-07 00:00:00.000000000 Z
11
+ date: 2026-05-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: timecop
@@ -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: []