crashbreak 0.9.8 → 0.9.9

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: fd8632fb1f25e7a084e471c6c75609daa428f1b9
4
- data.tar.gz: aad96e49eea6b235b71069ab3ceac8a01ee00abf
3
+ metadata.gz: 4df45d34d6e9036c52b70b7c7719925cd7204228
4
+ data.tar.gz: fd14f19299eb5dab7082000818db713f714d1e76
5
5
  SHA512:
6
- metadata.gz: f484f92e3db991498e1080258cdb4e6c2f612e7fdece77c99fd6a15160d0c9d4059714bd6a2ad60b834c1c476cc7fbd0984f59e68c2b1efd440c37898e252f7d
7
- data.tar.gz: 5cc115f292facd31a1b1d6975d8f17bc266adc728dea4b85121509757af101bfaadcd158e0841a89b963540f113c583d956a5ba831d16046b970aec36572bbff
6
+ metadata.gz: 3b59aa2de3910274e2c670487634f4f0dbed9ce987b3f3a55fda5c698c741b86a81dc508e31066eeefb7ef0349ca9db3c31eaef115dce9351e3a542827f1cdfa
7
+ data.tar.gz: 5d7fdc4a29c2e1407815148d094b76ef86885cf7900acaedecc4f0e4966d86c7304ef8fd2ce5516b2fd5be610c05ac9dff4bc1a44afb6b643c8e301ef1d050e3
@@ -1,3 +1,3 @@
1
1
  module Crashbreak
2
- VERSION = '0.9.8'
2
+ VERSION = '0.9.9'
3
3
  end
@@ -5,7 +5,7 @@ module Crashbreak
5
5
  def dump
6
6
  dump_database
7
7
  prepare_aws
8
- upload_dump
8
+ aws_file_name = upload_dump
9
9
  remove_locally_dump
10
10
  { file_name: aws_file_name }
11
11
  end
@@ -17,15 +17,17 @@ module Crashbreak
17
17
  end
18
18
 
19
19
  def upload_dump
20
- client.put_object(bucket: bucket_name, key: aws_file_name, body: File.read(dump_location))
20
+ generate_aws_file_name.tap do |aws_file_name|
21
+ client.put_object(bucket: bucket_name, key: aws_file_name, body: File.read(dump_location))
22
+ end
21
23
  end
22
24
 
23
25
  def remove_locally_dump
24
26
  File.delete(dump_location)
25
27
  end
26
28
 
27
- def aws_file_name
28
- @aws_file_name ||= "Crashbreak - database dump #{unique_string}"
29
+ def generate_aws_file_name
30
+ "Crashbreak - database dump #{DateTime.now.utc}"
29
31
  end
30
32
 
31
33
  def dump_location
@@ -35,10 +37,5 @@ module Crashbreak
35
37
  def dump_command
36
38
  Crashbreak.configure.dumper_options[:dump_command]
37
39
  end
38
-
39
- def unique_string
40
- o = [('a'..'z'), ('A'..'Z')].map { |i| i.to_a }.flatten
41
- (0...50).map { o[rand(o.length)] }.join
42
- end
43
40
  end
44
41
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crashbreak
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.8
4
+ version: 0.9.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michal Janeczek