mongo-db-utils 0.1.4 → 0.1.5

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: 6a6af9722c7c463cdf07a250dc442d0459e4cbc8
4
- data.tar.gz: 772568c00c9c67a2159a424bb89664b09c561d23
3
+ metadata.gz: 5ebca148c29c6c312df7459863527b52e53c2347
4
+ data.tar.gz: f61231bfa2e9d579aec99f55d3ff0c42158f804f
5
5
  SHA512:
6
- metadata.gz: 269ecf98e11be7e873d6d5ea0ae3df4dabebedea306251b96c088b305160bf1e815c43e375ab74de5ba1ee1b4bab9a56711175dce0af00cb43d6c3a2abc2dec9
7
- data.tar.gz: 5fde489b2db9c0be90140a482905cd80faccc8791fb41b594d6d658352c711b05ba74dba03dc70593022381a9c3a1795108f8763b56524c62b9e5d324f5f69f0
6
+ metadata.gz: dc1e86cc61d9ee1a748c508f8875fab63774e7583a1683fdbc78c1c66c5aed0670625da5e867f5198ad507fa807272244f4961c575b0ac5d2f38d552efb82041
7
+ data.tar.gz: 9467a8f2f6c08b93324842b881fd7a8418246b66c889cfca24e5db1bb72482cfd913ce9303323cf8933200b75e8c483badb6d2b6fb53ee9514e93636ccf0fd19
@@ -41,9 +41,9 @@ module MongoDbUtils
41
41
  end
42
42
 
43
43
  # With remote dbs you can't do a copy_database if you're not an admin.
44
- def self.copy(path, source, destination, halt_on_no_backup = true)
44
+ def self.copy(path, source, destination, halt_on_no_backup = true, skip_backup = false)
45
45
 
46
- backup_made = backup(destination, path)
46
+ backup_made = if skip_backup then true else backup(destination, path) end
47
47
 
48
48
  if( !backup_made && halt_on_no_backup)
49
49
  puts "aborting - no backup was made"
@@ -223,15 +223,16 @@ eos
223
223
  say("#{plan[:source].to_s} --> #{plan[:destination].to_s}")
224
224
 
225
225
  my_menu("") do |menu|
226
- menu.choice "Do it!" do begin_copy(plan) end
226
+ menu.choice "Do it!" do begin_copy(plan, false) end
227
+ menu.choice "Do it - skip backup" do begin_copy(plan, true) end
227
228
  menu.choice "Reverse" do
228
229
  show_copy_plan( {:source => plan[:destination], :destination => plan[:source]})
229
230
  end
230
231
  end
231
232
  end
232
233
 
233
- def begin_copy(plan)
234
- @cmd.copy(@config.backup_folder, plan[:source], plan[:destination], false)
234
+ def begin_copy(plan, skip_backup = false)
235
+ @cmd.copy(@config.backup_folder, plan[:source], plan[:destination], false, skip_backup)
235
236
  end
236
237
 
237
238
  def my_menu(prompt, show_defaults = true)
@@ -1,4 +1,4 @@
1
1
  module MongoDbUtils
2
- VERSION = "0.1.4"
3
- READY_FOR_USE = "(Beta version)"
2
+ VERSION = "0.1.5"
3
+ READY_FOR_USE = "(prod version)"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongo-db-utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - edeustace
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-26 00:00:00.000000000 Z
11
+ date: 2014-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec