dumpcar 0.1.0.2 → 0.1.0.4

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: 10d345ae8e6b891eb9706770254feecac90a4440ddb94a38afe43863a381e6db
4
- data.tar.gz: 1785b183972b7b3441647b3fc272a09168ee023f49de87b8befdd2c671807def
3
+ metadata.gz: ed119cf17a409f818d9dd8f069a5e7220311915609c84a89e1e4cee24708ec1b
4
+ data.tar.gz: f3537224213f96e745edfcdccbc56e3906f0b32fdb349ce725425a41f9d78887
5
5
  SHA512:
6
- metadata.gz: e377f5ca42759745881c2942961bd0d2963f5c1ab0fa34b137598416143f989f286b1e3a8abd221a79bd3340e197ae969cd52fec85b07db4a36cf6794ddd42fd
7
- data.tar.gz: '08a48d141f71ab6a4b01b964a6456a6a58d34a3c16966beb32aaf48dd50ad1cafb8caed661e2393b6ddd2608f62dbe40dee02c037dddc7eddb5695a9aaa4ed40'
6
+ metadata.gz: 14c5f0ba07c1618d401a9b3f8d5b7345b7c70b1c484bdbe0179f75e7c8f7995e5316470a4e6b0986f7b4ff02701f012df80d9c60b8b9a31f1519144efb309908
7
+ data.tar.gz: 5bfad0956996b9fd3f9937728b179f9144af7ba65cbe8f33ee60156dfdb7820852675ef12d8286a3faad5f0d01eaa22d4314886c8dc4774e66d85f6c99ef39c8
data/README.md CHANGED
@@ -1,30 +1,45 @@
1
- # Rails::Db::Dump
1
+ # Dumpcar
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/dumpcar`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ Rake tasks for dumping and restoring the contents of the PostgreSQL database for your Rails application.
4
4
 
5
- ## Installation
5
+ * Dump (`rails dumpcar:dump`) and restore your last dump (`rails dumpcar:restore`) with a single command
6
+ * Uses your Rails database credentials for your environment
6
7
 
7
- TODO: Replace `Dumpcar` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
8
+ ## Installation
8
9
 
9
- Install the gem and add to the application's Gemfile by executing:
10
+ Install the gem executing:
10
11
 
11
12
  ```bash
12
13
  bundle add Dumpcar
14
+ rails g dumpcar # creates db/dumps folder, adds it to .gitignore and commits
13
15
  ```
14
16
 
15
- If bundler is not being used to manage dependencies, install the gem by executing:
17
+ ## Usage
16
18
 
17
19
  ```bash
18
- gem install Dumpcar
20
+ rails dumpcar:dump # creates a postgresql dump based on current time like db/dumps/20250601022124.dump
21
+ rails dumpcar:restore # restores the last dump made chronologically from the db/dumps directory
19
22
  ```
20
23
 
21
- ## Usage
24
+ ## Compatibility
22
25
 
23
- TODO: Write usage instructions here
26
+ Outside of the `rails dumpcar:dump` and `rails dumpcar:restore` commands, don't expect any compatibility guarantees for now.
27
+
28
+ ## Longer term feature goals
29
+
30
+ * Support other Rails database (MySQL and SQLite)
31
+ * Support other Rails environments than the current one
32
+ * Ability to clean your db/dumps directory of all dumps before a given time
33
+ * Add support for naming a dump (you can manually do this now but not via the rake task)
34
+ * Restoring a specific dump via filepath
35
+ * Restoring a specific dump by timestamp
36
+ * Restoring a specific dump by name
37
+ * Restoring a specific dump made before or after a given time
38
+ * Extension points for other ways to get a database (Easily get a dump from Heroku's Postgres backups, for example)
24
39
 
25
40
  ## Development
26
41
 
27
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
42
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You should run `bin/appraisal rspec` to run all of the tests on all of the supported Rails versions. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
28
43
 
29
44
  ## Contributing
30
45
 
@@ -36,4 +51,9 @@ The gem is available as open source under the terms of the [LGPL-3.0-or-later li
36
51
 
37
52
  ## Code of Conduct
38
53
 
39
- Everyone interacting in the Rails::Db::Dump project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/wwahammy/dumpcar/blob/main/CODE_OF_CONDUCT.md).
54
+ Everyone interacting in the Dumpcar project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/wwahammy/dumpcar/blob/main/CODE_OF_CONDUCT.md).
55
+
56
+ ## Releasing
57
+
58
+ 1. Update the version in the `lib/dumpcar/version.rb`
59
+ 2. Run the Push Gem workflow
@@ -5,6 +5,7 @@ source "https://rubygems.org"
5
5
  gem "irb"
6
6
  gem "rake", "~> 13.0"
7
7
  gem "rspec", "~> 3.0"
8
+ gem "rspec-github", require: false
8
9
  gem "shoulda-matchers"
9
10
  gem "standard", "~> 1.3"
10
11
  gem "combustion"
@@ -5,6 +5,7 @@ source "https://rubygems.org"
5
5
  gem "irb"
6
6
  gem "rake", "~> 13.0"
7
7
  gem "rspec", "~> 3.0"
8
+ gem "rspec-github", require: false
8
9
  gem "shoulda-matchers"
9
10
  gem "standard", "~> 1.3"
10
11
  gem "combustion"
@@ -5,6 +5,7 @@ source "https://rubygems.org"
5
5
  gem "irb"
6
6
  gem "rake", "~> 13.0"
7
7
  gem "rspec", "~> 3.0"
8
+ gem "rspec-github", require: false
8
9
  gem "shoulda-matchers"
9
10
  gem "standard", "~> 1.3"
10
11
  gem "combustion"
@@ -5,6 +5,7 @@ source "https://rubygems.org"
5
5
  gem "irb"
6
6
  gem "rake", "~> 13.0"
7
7
  gem "rspec", "~> 3.0"
8
+ gem "rspec-github", require: false
8
9
  gem "shoulda-matchers"
9
10
  gem "standard", "~> 1.3"
10
11
  gem "combustion"
@@ -5,6 +5,7 @@ source "https://rubygems.org"
5
5
  gem "irb"
6
6
  gem "rake", "~> 13.0"
7
7
  gem "rspec", "~> 3.0"
8
+ gem "rspec-github", require: false
8
9
  gem "shoulda-matchers"
9
10
  gem "standard", "~> 1.3"
10
11
  gem "combustion"
@@ -5,6 +5,7 @@ source "https://rubygems.org"
5
5
  gem "irb"
6
6
  gem "rake", "~> 13.0"
7
7
  gem "rspec", "~> 3.0"
8
+ gem "rspec-github", require: false
8
9
  gem "shoulda-matchers"
9
10
  gem "standard", "~> 1.3"
10
11
  gem "combustion"
@@ -5,6 +5,7 @@ source "https://rubygems.org"
5
5
  gem "irb"
6
6
  gem "rake", "~> 13.0"
7
7
  gem "rspec", "~> 3.0"
8
+ gem "rspec-github", require: false
8
9
  gem "shoulda-matchers"
9
10
  gem "standard", "~> 1.3"
10
11
  gem "combustion"
@@ -11,7 +11,7 @@ module Dumpcar
11
11
 
12
12
  def dumps
13
13
  prepare_base!
14
- Dir.glob(base.join(TIMESTAMP_FILE_GLOB))
14
+ base.glob(TIMESTAMP_FILE_GLOB)
15
15
  end
16
16
 
17
17
  def first
@@ -19,6 +19,10 @@ module Dumpcar
19
19
  dumps.first
20
20
  end
21
21
 
22
+ def search(query)
23
+ dumps.first { |file| file.basename.starts_with(query) }
24
+ end
25
+
22
26
  def last
23
27
  prepare_base!
24
28
  dumps.last
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dumpcar
4
- VERSION = "0.1.0.2"
4
+ VERSION = "0.1.0.4"
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.0.2
4
+ version: 0.1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Schultz
@@ -84,5 +84,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
84
84
  requirements: []
85
85
  rubygems_version: 3.6.7
86
86
  specification_version: 4
87
- summary: We're getting there
87
+ summary: Rake tasks for dumping and restoring Rails PostgreSQL database contents
88
88
  test_files: []