dumpcar 0.3 → 0.3.1

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: ee8d684348fb3890c5e4b440c594dc98f4a088d35f508bcad10b785b1c8a786c
4
- data.tar.gz: f4ac59ac50c529a8be9003d3f616b7e75043b87a2023a146e5fbf6730a3d3a38
3
+ metadata.gz: f4098f5a361deb33a01b2bf1551a41c532de946f1bae2f418ebcf5d4739bf68e
4
+ data.tar.gz: d82319e62b40f0cd3b619da6e07e083faff7ecf1c0cf03105b9ea8463f1932c5
5
5
  SHA512:
6
- metadata.gz: 463ad770e9cc2c136c471bda67fe4a526f00c6c0025c79746a4579fd72f1b72668d5dddf3e25055246b821881abfb2859d76cea7c241e7b2f53295d301f3c241
7
- data.tar.gz: ecc724aad06a3bffe85bd4a4ab9360fa0ee95a9f0cca55f1fddc65e31714743eb5be1396d48e7d7d6e70b506c52392006af156031185055543541fd5e2d03cd1
6
+ metadata.gz: 80e2878b12006e0950a199cca67593ebec456f416b8f0529fda1a9753ca530303632ff8169a46f042f82d780a88afb264f100823bb7ffc76f95390601735829b
7
+ data.tar.gz: 505156796ac225a538c8da5e5233515ef3580fefaf0b688f257da4840022ec8a536e7b140105fc0485bae82b759dda245cef8d3c5219f51084bd4f4f38c320a5
data/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  Rails commands for dumping and restoring the contents of the PostgreSQL database for your Rails application.
6
6
 
7
7
  - Dump (`rails dumpcar:dump`) and restore your last dump (`rails dumpcar:restore`) with a single command
8
- - Uses your Rails database credentials for your environment
8
+ - Uses your Rails database credentials for your environment OR any Rails supported Postgres connection string (via `DATABASE_URL`)
9
9
 
10
10
  ## Installation
11
11
 
@@ -21,6 +21,9 @@ rails g dumpcar # creates db/dumps folder, adds it to .gitignore and commits
21
21
  ```bash
22
22
  rails dumpcar:dump # creates a postgresql dump based on current time like db/dumps/20250601022124.dump
23
23
  rails dumpcar:restore # restores the last dump made chronologically from the db/dumps directory
24
+
25
+ # You can use any Postgres connection string that Rails supports
26
+ DATABASE_URL=postgres://myuser:mypassword@domain.hosting.pg.db:5432/mydatabase rails dumpcar:dump # creates a postgresql dump of the database at DATABASE_URL
24
27
  ```
25
28
 
26
29
  ## Compatibility
@@ -29,7 +32,7 @@ Outside of the `rails dumpcar:dump` and `rails dumpcar:restore` commands, don't
29
32
 
30
33
  ## Longer term feature goals
31
34
 
32
- - Support other Rails database (MySQL and SQLite)
35
+ - Support other Rails databases (MySQL and SQLite)
33
36
  - Support other Rails environments than the current one
34
37
  - Ability to clean your db/dumps directory of all dumps before a given time
35
38
  - Add support for naming a dump (you can manually do this now but not via the rake task)
@@ -42,7 +45,7 @@ Outside of the `rails dumpcar:dump` and `rails dumpcar:restore` commands, don't
42
45
  ## Development
43
46
 
44
47
  NOTE: Using the Devcontainer is one of the easiest ways to get setup. Unfortunately, it also requires a no-charge but proprietary
45
- extension VSCode to use.
48
+ extension to VSCode to use.
46
49
 
47
50
  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.
48
51
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dumpcar
4
- VERSION = "0.3"
4
+ VERSION = "0.3.1"
5
5
  end
@@ -3,14 +3,16 @@ class DumpcarCommand < Rails::Command::Base
3
3
 
4
4
  desc "dump", "Dump postgres backup file"
5
5
  def dump
6
- (Rails.version < "6.1") ? require_application_and_environment! : boot_application!
6
+ require "rails"
7
+ (Rails.version < "7.1") ? require_application_and_environment! : boot_application!
7
8
  require "dumpcar"
8
9
  Dumpcar::Instance.new(options).dump
9
10
  end
10
11
 
11
12
  desc "restore", "Restore postgres backup file"
12
13
  def restore
13
- (Rails.version < "6.1") ? require_application_and_environment! : boot_application!
14
+ require "rails"
15
+ (Rails.version < "7.1") ? require_application_and_environment! : boot_application!
14
16
  require "dumpcar"
15
17
  Dumpcar::Instance.new(options).restore
16
18
  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.3'
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Schultz