monsoon 0.3 → 0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -58,18 +58,6 @@ module Monsoon
58
58
  config["database"]
59
59
  end
60
60
 
61
- # Helper method for database backup location.
62
- #
63
- # Examples
64
- #
65
- # Monsoon::Backup("mongodb://test.mongohq.com:10036/app_development").backup_location
66
- # # => "dump/app_development"
67
- #
68
- # Returns a String of the database name.
69
- def backup_location
70
- "dump/#{config['database']}"
71
- end
72
-
73
61
  # Helper to form the mongodump command.
74
62
  #
75
63
  # Examples
@@ -80,7 +68,7 @@ module Monsoon
80
68
  # Returns the command as a String.
81
69
  def mongo_dump_command
82
70
  cmd = ""
83
- cmd = "mongodump -h #{config['host']}:#{config['port']} -d #{config['database']} "
71
+ cmd = "mongodump -h #{config['host']}:#{config['port']} -d #{config['database']} -o . "
84
72
  cmd += "--username #{config['username']} --password #{config['password']}" unless config["username"].nil? and config["password"].nil?
85
73
  cmd
86
74
  end
@@ -29,7 +29,7 @@ module Monsoon
29
29
  #
30
30
  # Returns the command as a String.
31
31
  def compress_command
32
- "tar -czf #{filename} #{@backup.backup_location}"
32
+ "tar -czf #{filename} #{@backup.database}"
33
33
  end
34
34
 
35
35
  # Helper to form the tar compress command.
@@ -1,3 +1,3 @@
1
1
  module Monsoon
2
- VERSION = "0.3"
2
+ VERSION = "0.4"
3
3
  end
@@ -79,46 +79,20 @@ module Monsoon
79
79
  end
80
80
  end
81
81
 
82
- describe "#backup_location" do
83
- subject{ Backup.new(uri).backup_location }
84
-
85
- it "should return correct backup location for mongodump output" do
86
- subject.should == "dump/app_development"
87
- end
88
- end
89
-
90
82
  describe "#mongo_dump_command" do
91
83
  subject{ Backup.new(uri).mongo_dump_command }
92
84
 
93
- it "should include mongo dump command" do
94
- subject.should include("mongodump")
95
- end
96
-
97
- it "should include switch for host including port" do
98
- subject.should include("-h test.mongohq.com:10036")
99
- end
100
-
101
- it "should include switch for database" do
102
- subject.should include("-d app_development")
103
- end
104
-
105
- it "should include switch for username" do
106
- subject.should include("--username testuser")
107
- end
108
-
109
- it "should include switch for password" do
110
- subject.should include("--password pass1")
85
+ describe "when username/password is provided" do
86
+ it "should return correct command" do
87
+ subject.should == "mongodump -h test.mongohq.com:10036 -d app_development -o . --username testuser --password pass1"
88
+ end
111
89
  end
112
90
 
113
91
  describe "when user and password is not included" do
114
92
  let(:backup) { Backup.new("mongodb://test.mongohq.com:10036/app_development").mongo_dump_command }
115
93
 
116
- it "should not include username switch" do
117
- backup.should_not include("--username")
118
- end
119
-
120
- it "should not include password switch" do
121
- backup.should_not include("--password")
94
+ it "should return correct command" do
95
+ backup.should == "mongodump -h test.mongohq.com:10036 -d app_development -o . "
122
96
  end
123
97
  end
124
98
 
@@ -36,11 +36,11 @@ module Monsoon
36
36
  describe "#compress_command" do
37
37
  before(:each) do
38
38
  compress.stub(:filename).and_return("app_development.1234.tar.gz")
39
- backup.stub(:backup_location).and_return("dump/app_development")
39
+ backup.stub(:database).and_return("app_development")
40
40
  end
41
41
 
42
42
  it "should return correct tar command" do
43
- compress.compress_command.should == "tar -czf app_development.1234.tar.gz dump/app_development"
43
+ compress.compress_command.should == "tar -czf app_development.1234.tar.gz app_development"
44
44
  end
45
45
  end
46
46
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: monsoon
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.3'
4
+ version: '0.4'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-01-19 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70268861224460 !ruby/object:Gem::Requirement
16
+ requirement: &70101338915580 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '2.8'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70268861224460
24
+ version_requirements: *70101338915580
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: guard-rspec
27
- requirement: &70268861224040 !ruby/object:Gem::Requirement
27
+ requirement: &70101338915020 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70268861224040
35
+ version_requirements: *70101338915020
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rake
38
- requirement: &70268861223580 !ruby/object:Gem::Requirement
38
+ requirement: &70101338914560 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70268861223580
46
+ version_requirements: *70101338914560
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: aws-s3
49
- requirement: &70268861223160 !ruby/object:Gem::Requirement
49
+ requirement: &70101338914120 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70268861223160
57
+ version_requirements: *70101338914120
58
58
  description: Monsoon is a MongoDB backup tool that allows you to take backups and
59
59
  store them in Amazon S3.
60
60
  email: