heroku-mongo-backup 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/heroku_mongo_backup.rb +3 -1
  2. metadata +5 -5
@@ -40,6 +40,7 @@ module HerokuMongoBackup
40
40
  marshal_dump = Marshal.dump(backup)
41
41
 
42
42
  file = File.new(@file_name, 'w')
43
+ file.binmode
43
44
  file = Zlib::GzipWriter.new(file)
44
45
  file.write marshal_dump
45
46
  file.close
@@ -98,6 +99,7 @@ module HerokuMongoBackup
98
99
  def s3_download
99
100
  open(@file_name, 'w') do |file|
100
101
  object = @bucket.objects.find("backups/#{@file_name}")
102
+ file.binmode
101
103
  file.write object.content
102
104
  end
103
105
  end
@@ -105,7 +107,7 @@ module HerokuMongoBackup
105
107
  def initialize
106
108
  @file_name = Time.now.strftime("%Y-%m-%d_%H-%M-%S.gz")
107
109
 
108
- if ENV[:RAILS_ENV] == 'production'
110
+ if ENV['RAILS_ENV'] == 'production'
109
111
  uri = YAML.load_file("config/mongoid.yml")['production']['uri']
110
112
  else
111
113
  config = YAML.load_file("config/mongoid.yml")['development']
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heroku-mongo-backup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-09-13 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70358971982280 !ruby/object:Gem::Requirement
16
+ requirement: &70126427513420 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70358971982280
24
+ version_requirements: *70126427513420
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: mocha
27
- requirement: &70358971981540 !ruby/object:Gem::Requirement
27
+ requirement: &70126427512740 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70358971981540
35
+ version_requirements: *70126427512740
36
36
  description: Rake task for backing up mongo database on heroku and push it to S3.
37
37
  email: mail@alexkravets.com
38
38
  executables: []