monsoon 0.2 → 0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -17,7 +17,7 @@ To Configure:
17
17
  config.bucket = "mongo_backups"
18
18
  config.key = "my_super_secret_aws_key"
19
19
  config.secret = "my_super_secret_aws_secret"
20
- config.mongo_uri = "mongodb://user:password@test.mongohq.com:10036/add_development"
20
+ config.mongo_uri = "mongodb://user:password@test.mongohq.com:10036/app_development"
21
21
  end
22
22
 
23
23
  To use:
@@ -58,6 +58,18 @@ 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
+
61
73
  # Helper to form the mongodump command.
62
74
  #
63
75
  # Examples
@@ -25,11 +25,11 @@ module Monsoon
25
25
  # Examples
26
26
  #
27
27
  # Monsoon::Compress(#<Monsoon::Backup>).compress_command
28
- # # => "tar -czf app_development_1234.tar.gz app_development"
28
+ # # => "tar -czf app_development_1234.tar.gz dump/app_development"
29
29
  #
30
30
  # Returns the command as a String.
31
31
  def compress_command
32
- "tar -czf #{filename} #{@backup.database}"
32
+ "tar -czf #{filename} #{@backup.backup_location}"
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.2"
2
+ VERSION = "0.3"
3
3
  end
@@ -79,6 +79,14 @@ 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
+
82
90
  describe "#mongo_dump_command" do
83
91
  subject{ Backup.new(uri).mongo_dump_command }
84
92
 
@@ -34,13 +34,13 @@ module Monsoon
34
34
  end
35
35
 
36
36
  describe "#compress_command" do
37
- it "should include the tar command" do
38
- compress.compress_command.should include("tar -czf")
37
+ before(:each) do
38
+ compress.stub(:filename).and_return("app_development.1234.tar.gz")
39
+ backup.stub(:backup_location).and_return("dump/app_development")
39
40
  end
40
41
 
41
- it "should include filename with timestamp and tar.gz extension" do
42
- compress.stub(:filename).and_return("app_development.1234.tar.gz")
43
- compress.compress_command.should include("app_development.1234.tar.gz")
42
+ it "should return correct tar command" do
43
+ compress.compress_command.should == "tar -czf app_development.1234.tar.gz dump/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.2'
4
+ version: '0.3'
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: &70306214033220 !ruby/object:Gem::Requirement
16
+ requirement: &70268861224460 !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: *70306214033220
24
+ version_requirements: *70268861224460
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: guard-rspec
27
- requirement: &70306214032760 !ruby/object:Gem::Requirement
27
+ requirement: &70268861224040 !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: *70306214032760
35
+ version_requirements: *70268861224040
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rake
38
- requirement: &70306214032300 !ruby/object:Gem::Requirement
38
+ requirement: &70268861223580 !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: *70306214032300
46
+ version_requirements: *70268861223580
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: aws-s3
49
- requirement: &70306214031700 !ruby/object:Gem::Requirement
49
+ requirement: &70268861223160 !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: *70306214031700
57
+ version_requirements: *70268861223160
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: