crashbreak 0.9.10 → 0.9.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/crashbreak/AWS.rb +4 -0
- data/lib/crashbreak/version.rb +1 -1
- data/lib/dumpers/database_dumper.rb +17 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94c401ee078a3f6f4d71f1309855ea77fc89e6ef
|
4
|
+
data.tar.gz: dcf09e8fc27a7934ad862119bfd4b7012f618263
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b4156728a4159720d0433e9087d202647390acfe07be068dab05660f4d040bb7eb0ffc82b4220016a4849b6289c98b006821b0d207a5f05889cdbc57b14c2bc
|
7
|
+
data.tar.gz: 72abcbadd27dfe83c3bab1dcd3ececf42819ed20f67e2ddb0fa077a42727ba112edb6b0cd4b8dd4b5ae6e6ba29efbe596bf79034dec99acb33552d73971cca81
|
data/lib/crashbreak/AWS.rb
CHANGED
data/lib/crashbreak/version.rb
CHANGED
@@ -1,12 +1,18 @@
|
|
1
|
+
require 'digest/md5'
|
2
|
+
|
1
3
|
module Crashbreak
|
2
|
-
class DatabaseDumper
|
4
|
+
class DatabaseDumper < BasicFormatter
|
3
5
|
include Crashbreak::AWS
|
4
6
|
|
5
7
|
def dump
|
6
|
-
dump_database
|
7
8
|
prepare_aws
|
8
|
-
|
9
|
-
|
9
|
+
|
10
|
+
if dump_not_exist_yet?
|
11
|
+
dump_database
|
12
|
+
upload_dump
|
13
|
+
remove_locally_dump
|
14
|
+
end
|
15
|
+
|
10
16
|
{ file_name: aws_file_name }
|
11
17
|
end
|
12
18
|
|
@@ -17,17 +23,19 @@ module Crashbreak
|
|
17
23
|
end
|
18
24
|
|
19
25
|
def upload_dump
|
20
|
-
|
21
|
-
client.put_object(bucket: bucket_name, key: aws_file_name, body: File.read(dump_location))
|
22
|
-
end
|
26
|
+
client.put_object(bucket: bucket_name, key: aws_file_name, body: File.read(dump_location))
|
23
27
|
end
|
24
28
|
|
25
29
|
def remove_locally_dump
|
26
30
|
File.delete(dump_location)
|
27
31
|
end
|
28
32
|
|
29
|
-
def
|
30
|
-
"Crashbreak - database dump #{
|
33
|
+
def aws_file_name
|
34
|
+
"Crashbreak - database dump #{Digest::MD5.hexdigest(ENV['RACK_ENV'] + exception.class.to_s + exception.backtrace[0])}"
|
35
|
+
end
|
36
|
+
|
37
|
+
def dump_not_exist_yet?
|
38
|
+
!aws_resource_bucket.object(aws_file_name).exists?
|
31
39
|
end
|
32
40
|
|
33
41
|
def dump_location
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: crashbreak
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michal Janeczek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|