dumpr 1.1 → 1.2

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: 205fecfb4696237b6e460954704b0f9553604c993f257acd7dc7dc4ebf96fd92
4
- data.tar.gz: b2be3a8c4b43607e1e0c606f5b3c1d53d5c5db7973b77a630f4ed6511dd1fb9c
3
+ metadata.gz: 1c4e092e069d3b3a1a9ddb44c6e4fae4b405c49510fce4e89ef1577bed0a6016
4
+ data.tar.gz: ea58fb39085ea624683a026f3fce5ddabe4cdbf2f1a3c8c5d69621067cc3bb01
5
5
  SHA512:
6
- metadata.gz: 0eaf3d62ba27241aaa50f17d31a8b5bd249ce12a2fb210179236bd8330ac2053f6580558f579ce0ed378411f6e94ab019362759f90f2a37aa1c4e2ef921aa29f
7
- data.tar.gz: c1268f23b9dee20df7b8179665b62c755aadc3fbfaebffee16bba8a11dbe111f2e8589137b6cb8dd9db7e016c44c52195386740fe4d71f2a4522721c64a38a90
6
+ metadata.gz: 53283e55f775af19059ee12c578e05012a5c141409e9484b562884bd80eb1b8ddfb34677753a3e6d37194367c12e3e904c9f712b2d57b5e93a602701a3a9cba5
7
+ data.tar.gz: 31d4147d81e4cede85aa7d70fef0707a00491415262487cfc9d9df5403ba56eb1cec02d92340ed458cbcfa4fc47c0627aa32dd9a68a2a13519ea9193c9fcbf92
data/README.md CHANGED
@@ -32,14 +32,14 @@ The *dumpr* command can be used to export and import database dumps.
32
32
  Generate yourdb.sql.gz and transfer it to server2
33
33
 
34
34
  ```sh
35
- dumpr --user user --password pw --db yourdb --dumpfile yourdb.sql --destination dbserver2:/data/dumps/
35
+ dumpr --user user --password pw --db yourdb --file yourdb.sql --destination dbserver2:/data/dumps/
36
36
  ```
37
37
 
38
38
  *Importing*
39
39
 
40
40
  Then, over on dbserver2, import your dump file
41
41
  ```sh
42
- dumpr -i --user user --password pw --dumpfile /data/dumps/yourdb.sql
42
+ dumpr -i --user user --password pw --file /data/dumps/yourdb.sql
43
43
  ```
44
44
 
45
45
  ## Ruby API
@@ -64,7 +64,7 @@ Then, over on dbserver2, import your dump file
64
64
  Dumpr::Driver::Mysql.import(
65
65
  :user => 'importuser', :pass => 'pass',
66
66
  :db => 'yourdb',
67
- :dumpfile => '/data/dumps/yourdb.sql'
67
+ :file => '/data/dumps/yourdb.sql'
68
68
  )
69
69
  ```
70
70
 
@@ -22,11 +22,11 @@ Usage: #{PROG_NAME} [options]
22
22
 
23
23
  Exporting:
24
24
 
25
- #{PROG_NAME} --user youruser --password yourpass --db yourdb --dumpfile yourdb.sql --destination server2:/data/backups
25
+ #{PROG_NAME} --user root --password yourpass --db yourdb --file yourdb.sql --destination server2:/data/backups
26
26
 
27
27
  Importing:
28
28
 
29
- #{PROG_NAME} -i --user youruser --password yourpass --db yourdb --dumpfile /data/backups/yourdb.sql
29
+ #{PROG_NAME} -i --user root --password yourpass --db yourdb --file /data/backups/yourdb.sql
30
30
 
31
31
  Don't forget to set up your .ssh/config so you won't be prompted for ssh passwords for file transfers
32
32
 
@@ -75,11 +75,15 @@ ENDSTR
75
75
  options[:port] = val
76
76
  end
77
77
 
78
- opts.on("--dumpfile [DUMPFILE]", "Filename of dump to create/import") do |val|
78
+ opts.on("--file FILENAME", "Filename of dump to create/import") do |val|
79
79
  options[:dumpfile] = val
80
80
  end
81
81
 
82
- opts.on("--destination [DESTINATION]", "Destination for dumpfile. This can be a remote host:path.") do |val|
82
+ opts.on("--dumpfile FILENAME", "Alias for --file") do |val|
83
+ options[:dumpfile] = val
84
+ end
85
+
86
+ opts.on("--destination DESTINATION", "Destination for dumpfile. This can be a remote host:path.") do |val|
83
87
  options[:destination] = val
84
88
  end
85
89
 
@@ -66,7 +66,7 @@ module Dumpr
66
66
  @gzip = opts[:gzip].nil? ? true : opts[:gzip]
67
67
  @gzip_options = opts[:gzip_options] || "-9"
68
68
  @dumpdir = opts[:dumpdir] || "./"
69
- @dumpfile = (opts[:dumpfile] || opts[:filename]) or raise BadConfig.new ":dumpfile => <file.sql> is required"
69
+ @dumpfile = (opts[:file] || opts[:dumpfile] || opts[:filename]) or raise BadConfig.new ":dumpfile => <file.sql> is required"
70
70
  @dumpfile = @dumpfile[0].chr == "/" ? @dumpfile : File.join(@dumpdir, @dumpfile)
71
71
  @dumpfile.chomp!(".gz")
72
72
  # (optional) :destination is where dumps are exported to, and can be a remote host:path
@@ -1,3 +1,3 @@
1
1
  module Dumpr
2
- Version = "1.1".freeze
2
+ Version = "1.2".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dumpr
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.1'
4
+ version: '1.2'
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Dickson