airblade-mysql_s3_backup 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -35,6 +35,8 @@ Create a YAML config file:
35
35
  # S3 credentials
36
36
  access_key_id: XXXXXXXXXXXXXXX
37
37
  secret_access_key: XXXXXXXXXXXXXXXXXXXXXX
38
+ # Optional timeout in seconds
39
+ timeout: 30
38
40
 
39
41
  Create a full backup:
40
42
 
@@ -15,5 +15,6 @@ s3:
15
15
  # S3 credentials
16
16
  access_key_id: XXXXXXXXXXXXXXX
17
17
  secret_access_key: XXXXXXXXXXXXXXXXXXXXXX
18
+ # Optional timeout in seconds
18
19
  timeout: 30
19
20
 
@@ -6,7 +6,7 @@ module MysqlS3Backup
6
6
  class Backup
7
7
  attr_reader :mysql, :bucket, :timeout
8
8
 
9
- def initialize(mysql, bucket, timeout=30)
9
+ def initialize(mysql, bucket, timeout)
10
10
  @mysql = mysql
11
11
  @bucket = bucket
12
12
  @timeout = timeout
@@ -66,11 +66,15 @@ module MysqlS3Backup
66
66
  private
67
67
 
68
68
  def timeout
69
- result = nil
70
- Terminator.terminate @timeout do
71
- result = yield
69
+ if @timeout
70
+ result = nil
71
+ Terminator.terminate @timeout do
72
+ result = yield
73
+ end
74
+ result
75
+ else
76
+ yield
72
77
  end
73
- result
74
78
  end
75
79
 
76
80
  def lock
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "airblade-mysql_s3_backup"
3
- s.version = "0.0.3"
3
+ s.version = "0.0.4"
4
4
 
5
5
  s.authors = ["Marc-Andre Cournoyer", "Andrew Stewart"]
6
6
  s.email = "boss@airbladesoftware.com"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: airblade-mysql_s3_backup
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 3
10
- version: 0.0.3
9
+ - 4
10
+ version: 0.0.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Marc-Andre Cournoyer
@@ -70,7 +70,6 @@ extensions: []
70
70
  extra_rdoc_files: []
71
71
 
72
72
  files:
73
- - airblade-mysql_s3_backup-0.0.3.gem
74
73
  - bin/mysql_s3_backup
75
74
  - config/sample.yml
76
75
  - lib/mysql_s3_backup/backup.rb