crashbreak 0.9.6 → 0.9.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/crashbreak/version.rb +1 -1
- data/lib/restorers/database_restorer.rb +13 -0
- 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: aeddc67569778ac34f8fdf4d9486fa32b439b910
|
4
|
+
data.tar.gz: 03f2fc08f7c55d795c83f4ec23a727783afa03b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19ca61684edf97c7669cad5581e832705f1af579270ff39a0ea279db1a8b75b24719d6dbb064b21085254beca20cec83c9dde2cdcef1af40289852dd8b112bd6
|
7
|
+
data.tar.gz: 5e5431df098d0eb458f144d941bfe868be98759c5996df9b1eab21c2ad33677f1047ff95310c873990a1ce356ac456967b9aae8853cdde2fffbcb652bc5ba17b
|
data/lib/crashbreak/version.rb
CHANGED
@@ -12,6 +12,7 @@ module Crashbreak
|
|
12
12
|
prepare_aws
|
13
13
|
download_dump
|
14
14
|
restore_database
|
15
|
+
setup_connection_to_restored_database
|
15
16
|
end
|
16
17
|
|
17
18
|
private
|
@@ -31,5 +32,17 @@ module Crashbreak
|
|
31
32
|
def restore_command
|
32
33
|
Crashbreak.configure.restorer_options[:restore_command]
|
33
34
|
end
|
35
|
+
|
36
|
+
def setup_connection_to_restored_database
|
37
|
+
if Crashbreak.configure.restorer_options[:setup_database_connection].present?
|
38
|
+
Crashbreak.configure.restorer_options[:setup_database_connection].call
|
39
|
+
else
|
40
|
+
ActiveRecord::Base.establish_connection(database_config.merge(database: 'crashbreak-test')) if database_config
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def database_config
|
45
|
+
@database_config ||= YAML.load(File.read('config/database.yml')).try(:[], 'test')
|
46
|
+
end
|
34
47
|
end
|
35
48
|
end
|
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.7
|
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-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|