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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d943a7d2f3a78353805545a04922acdf8e841d79
4
- data.tar.gz: 5eb0864882ebfcc111be7bfd9e2639b0e449fd67
3
+ metadata.gz: aeddc67569778ac34f8fdf4d9486fa32b439b910
4
+ data.tar.gz: 03f2fc08f7c55d795c83f4ec23a727783afa03b3
5
5
  SHA512:
6
- metadata.gz: 801a7c44cc6ea929bc54aeecfb0b89b45989c91006a487d215e9b46b7b9d56cf7b9dcff13c1175d326bb763be0a63e99ab3392dad323830aff1b035302dab90b
7
- data.tar.gz: 23cc67630df928d9b638a758563c7300115d4eb1bafd507375dada7f1bc2bdf53419603ce97b12249e9150606e9399f9493618bc567495e9435a45bd1c981979
6
+ metadata.gz: 19ca61684edf97c7669cad5581e832705f1af579270ff39a0ea279db1a8b75b24719d6dbb064b21085254beca20cec83c9dde2cdcef1af40289852dd8b112bd6
7
+ data.tar.gz: 5e5431df098d0eb458f144d941bfe868be98759c5996df9b1eab21c2ad33677f1047ff95310c873990a1ce356ac456967b9aae8853cdde2fffbcb652bc5ba17b
@@ -1,3 +1,3 @@
1
1
  module Crashbreak
2
- VERSION = '0.9.6'
2
+ VERSION = '0.9.7'
3
3
  end
@@ -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.6
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-12 00:00:00.000000000 Z
11
+ date: 2015-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler