postgressor 0.2.3 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5a2d8a1e70bf75a1d8f52df2cb569f8ef2f7680ae8adc242c4f424cb926390dc
4
- data.tar.gz: 354890004f23aaf192ca65c158acdf96b872cad6234d7d314a43113aaf7889b5
3
+ metadata.gz: 263f317f37f9a03b530c367d7338a6a729c73a079405dde88c8a0dcf6d7ef598
4
+ data.tar.gz: e638c31d20825afb58073e39f4cb5c1c4532f80e90719ebb87600ac2bd787808
5
5
  SHA512:
6
- metadata.gz: 2abea7a328183e62722c6711e4a3451cea559a3e4b578c18f9632fc83cb41731f9241c65a9a28e15913318dc38668710e4257900bff3c32722285ee8cec13d9a
7
- data.tar.gz: 2a06ce9f7148491dc6e714a98d36384049f4d3f07ca5274b67aee035a14d61a6c4939d10a1cd0ffa975c9f6c20a6f5036ab3b2963c6261daf5b2abf42762cd15
6
+ metadata.gz: 05df1a9d89da3d1287b58f890f37c94fc5e9fd3e5f32201c05fdd57553599abad7dcb083609944804b8b59b445edecc4c9f13a5dc184f2a5606726c1ac70de24
7
+ data.tar.gz: dae905bd24365a3da682036037ce20c9865a944be4d48ba004db3abbab762f700cbf7beee47d2aab1b79139c3b9eca39cc7fb55dc9b569ee86ade393b15d8127
data/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
1
+ # CHANGELOG
2
+ ## 0.3.0
3
+ * Added optional `dump_file_path` parameter to `dumpdb` command
data/README.md CHANGED
@@ -86,7 +86,7 @@ Dropped database app_db
86
86
  To perform database backup to the current directory:
87
87
 
88
88
  ```
89
- $ DATABASE_URL="postgres://app_user:123456@localhost/app_db" VERBOSE=true postgressor dumpdb
89
+ $ DATABASE_URL="postgres://app_user:123456@localhost/app_db" VERBOSE=true postgressor dumpdb app_db.dump
90
90
 
91
91
  Executing: PGPASSWORD=123456 pg_dump app_db -Fc --no-acl --no-owner -f app_db.dump -h localhost -U app_user
92
92
  Dumped database app_db to app_db.dump file
@@ -61,14 +61,17 @@ module Postgressor
61
61
 
62
62
  # https://www.postgresql.org/docs/current/app-pgdump.html
63
63
  desc "dumpdb", "Dump (backup) app database"
64
- def dumpdb
64
+ def dumpdb(dump_file_path = nil)
65
65
  preload!
66
66
 
67
- dump_file_name = "#{@conf[:db]}.dump"
68
- command = %W(pg_dump #{@conf[:db]} -Fc --no-acl --no-owner -f #{dump_file_name}) + @pg_cli_args
67
+ unless dump_file_path
68
+ dump_file_path = "#{@conf[:db]}.dump"
69
+ end
70
+
71
+ command = %W(pg_dump #{@conf[:db]} -Fc --no-acl --no-owner -f #{dump_file_path}) + @pg_cli_args
69
72
 
70
73
  if execute command, with_env: true
71
- say "Dumped database #{@conf[:db]} to #{dump_file_name} file", :green
74
+ say "Dumped database #{@conf[:db]} to #{dump_file_path} file", :green
72
75
  end
73
76
  end
74
77
 
@@ -1,3 +1,3 @@
1
1
  module Postgressor
2
- VERSION = "0.2.3"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: postgressor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Afanasev
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-08-20 00:00:00.000000000 Z
11
+ date: 2020-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -91,6 +91,7 @@ extra_rdoc_files: []
91
91
  files:
92
92
  - ".gitignore"
93
93
  - ".travis.yml"
94
+ - CHANGELOG.md
94
95
  - Gemfile
95
96
  - LICENSE.txt
96
97
  - README.md
@@ -121,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
122
  - !ruby/object:Gem::Version
122
123
  version: '0'
123
124
  requirements: []
124
- rubygems_version: 3.0.3
125
+ rubygems_version: 3.1.2
125
126
  signing_key:
126
127
  specification_version: 4
127
128
  summary: Manage your application Postgres user and database easily using simple CLI