mongo-backup 0.1.1 → 0.1.2

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
  SHA1:
3
- metadata.gz: a31342fcd13da9ac19faed7b4b98a62db436fbd3
4
- data.tar.gz: 86257f9e324511491e5e1299e65574bed84b5420
3
+ metadata.gz: 6a006f1d511b1f675ee953ea8b4ee292c8cb1628
4
+ data.tar.gz: c18788010b999d172bc079f22feb490ee0cd8a63
5
5
  SHA512:
6
- metadata.gz: 235c6da89bfd533d13322f53a238f7863392546da1d98f084a33d2b47e6c5598e497689d4791ec8c21983bd76cd436ccf75d0c90eba4ba1ffe1e4e7ed0d78924
7
- data.tar.gz: fe157d39a750c6161a205a632830c508c7c4f0f5b415558c8afee556498d00a5abc43fa8be18a359a80def61d69db76777a14dc1ac0da2ab86bf86fd7b412376
6
+ metadata.gz: f8ac2ab46863402d8fcdf5d6fb1f8a5ca342e8d4c14fb62ddd20c76b45bd2c9f0f03984fb96db0098e9bee3cf292fb80cc01c6d7fdac92e5ec6131e90805c878
7
+ data.tar.gz: 53419a15b0193db8fbf4e6f8a460f3cf5e60f5f14c53057b4742e1f8de879a5794970593e1550cab96c04a11389e0efb0fbf31fae2517c755a96b3cb71b0dda6
@@ -1,5 +1,5 @@
1
1
  module MongoBackup
2
2
  module Rails
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
5
5
  end
@@ -21,7 +21,11 @@ namespace :mongo do
21
21
 
22
22
  uri, db_name = parse_uri()
23
23
  filename = Time.now.strftime("%Y-%m-%d_%H-%M-%S.tar.gz")
24
- backup_cmd = "mongodump -u #{uri.user} -p #{uri.password} -h #{uri.host}:#{uri.port} -d #{db_name}"
24
+ if uri.user
25
+ backup_cmd = "mongodump -u #{uri.user} -p #{uri.password} -h #{uri.host}:#{uri.port} -d #{db_name}"
26
+ else
27
+ backup_cmd = "mongodump -h #{uri.host}:#{uri.port} -d #{db_name}"
28
+ end
25
29
 
26
30
  system "cd /tmp ; #{backup_cmd} ; GZIP=-9 tar -zcvf #{filename} dump/"
27
31
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongo-backup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Slate Studio