backup 2.1.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -6,7 +6,7 @@ Backup is a Ruby Gem, written specifically for Ruby on Rails applications. This
6
6
  MySQL database (soon PostgreSQL and possibly more) and Archives (any files or folders) to "Amazon S3" or "any remotely accessible server using SCP".
7
7
  Backup handles: Compression, Archiving, Encryption and Backup Cleaning.
8
8
 
9
- == Backup just updated to version 2.0.0(+)!
9
+ == Backup just updated to version 2.1.0!
10
10
 
11
11
  This was a major update (read below) and a lot of stuff has changed since version 1.x.x!
12
12
  Notable changes:
@@ -19,18 +19,18 @@ Notable changes:
19
19
  * Can now configure an unlimited amount of customizable backup settings and run them each "individually"!
20
20
  * HIGHLY IMPROVED USABILITY!
21
21
 
22
- == HAVING TROUBLE WITH VERSION "2.0.0"?
22
+ == TO ANYONE RUNNING BACKUP VERSION 2.0.0! PLEASE READ!
23
23
 
24
- I have encountered and issue with Backup version "2.0.0" after the release. This issue has been addressed and patched to both version 2.0.0 as well as version 2.1.0. This involved the use of the SQLite3 database, which is no longer utilized by Backup. So for people that are going to install Backup version 2.0.0 (or later) right now, this issue no longer applies. However, for users that installed Backup 2.0.0 pretty early after the release, this might cause problems.
24
+ I would like to ask you to install the latest version of Backup, as 2.0.0 has some issues.
25
+ A few things that were left unchanged in 2.0.0 have been changed in 2.1.0 and I have updated the Wiki page "Getting Started"
26
+ based on the 2.1.0 release to get everyone up and running!
25
27
 
26
- ==== If you are running Backup version "2.0.0", please run the following to ensure you have a "good" install.
28
+ ==== If you have Backup version 2.0.0 installed, please do the following:
27
29
 
28
30
  sudo gem uninstall backup -v 2.0.0
29
31
  sudo gem install backup
30
32
 
31
- This will obviously uninstall your currently installed backup version 2.0.0 and install the latest version of Backup.
32
- Do this and you're set! My apologies for the initial hassle! ;)
33
-
33
+ And have a quick read through the "Getting Started" Wiki page to see how simple the Backup setup is since 2.1.0!
34
34
 
35
35
  === Refer to the Getting Started page to get up and running incredibly fast with "Backup 2"!
36
36
  http://wiki.github.com/meskyanichi/backup/getting-started
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.1.0
1
+ 2.1.1
data/backup.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{backup}
8
- s.version = "2.1.0"
8
+ s.version = "2.1.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Michael van Rooijen"]
@@ -1,24 +1,17 @@
1
1
  class CreateBackupTables < ActiveRecord::Migration
2
2
  def self.up
3
- create_table :backup_s3 do |t|
4
- t.string :trigger
5
- t.string :adapter
6
- t.string :filename
7
- t.string :bucket
8
- t.timestamps
9
- end
10
-
11
- create_table :backup_scp do |t|
3
+ create_table :backup do |t|
4
+ t.string :storage
12
5
  t.string :trigger
13
6
  t.string :adapter
14
7
  t.string :filename
15
8
  t.string :path
9
+ t.string :bucket
16
10
  t.timestamps
17
11
  end
18
12
  end
19
13
 
20
14
  def self.down
21
- drop_table :backup_s3
22
- drop_table :backup_scp
15
+ drop_table :backup
23
16
  end
24
17
  end
@@ -9,8 +9,8 @@ namespace :backup do
9
9
  task :truncate => :environment do
10
10
  backup = Backup::Setup.new(ENV['trigger'], @backup_procedures)
11
11
  case backup.procedure.storage_name.to_sym
12
- when :s3 then Backup::Record::S3.destroy_all(:trigger => ENV['trigger'])
13
- when :scp then Backup::Record::SCP.destroy_all(:trigger => ENV['trigger'])
12
+ when :s3 then Backup::Record::S3.destroy_all(:trigger => ENV['trigger'], :storage => 's3')
13
+ when :scp then Backup::Record::SCP.destroy_all(:trigger => ENV['trigger'], :storage => 'scp')
14
14
  end
15
15
  end
16
16
 
@@ -1,20 +1,18 @@
1
1
  module Backup
2
2
  module Record
3
3
  class S3 < ActiveRecord::Base
4
-
5
- # Establishes a connection with the SQLite3
6
- # local database to avoid conflict with users
7
- # Production database.
8
- # establish_connection(
9
- # :adapter => "sqlite3",
10
- # :database => "db/backup.sqlite3",
11
- # :pool => 5,
12
- # :timeout => 5000 )
13
-
14
- set_table_name 'backup_s3'
15
4
 
16
- # Scopes
17
- default_scope :order => 'created_at desc'
5
+ if connection.table_exists?('backup')
6
+ set_table_name 'backup'
7
+ default_scope \
8
+ :order => 'created_at desc',
9
+ :conditions => {:storage => 's3'}
10
+ else
11
+ set_table_name 'backup_s3'
12
+ attr_accessor :storage
13
+ default_scope \
14
+ :order => 'created_at desc'
15
+ end
18
16
 
19
17
  # Callbacks
20
18
  after_save :clean_backups
@@ -26,8 +24,9 @@ module Backup
26
24
  # Sets the S3 values
27
25
  def load_adapter(adapter)
28
26
  self.adapter_config = adapter
27
+ self.storage = 's3'
29
28
  self.trigger = adapter.procedure.trigger
30
- self.adapter = adapter.procedure.adapter_name
29
+ self.adapter = adapter.procedure.adapter_name.to_s
31
30
  self.filename = adapter.final_file
32
31
  self.bucket = adapter.procedure.get_storage_configuration.attributes['bucket']
33
32
  self.keep_backups = adapter.procedure.attributes['keep_backups']
@@ -1,20 +1,18 @@
1
1
  module Backup
2
2
  module Record
3
3
  class SCP < ActiveRecord::Base
4
-
5
- # Establishes a connection with the SQLite3
6
- # local database to avoid conflict with users
7
- # Production database.
8
- # establish_connection(
9
- # :adapter => "sqlite3",
10
- # :database => "db/backup.sqlite3",
11
- # :pool => 5,
12
- # :timeout => 5000 )
13
-
14
- set_table_name 'backup_scp'
15
4
 
16
- # Scopes
17
- default_scope :order => 'created_at desc'
5
+ if connection.table_exists?('backup')
6
+ set_table_name 'backup'
7
+ default_scope \
8
+ :order => 'created_at desc',
9
+ :conditions => {:storage => 'scp'}
10
+ else
11
+ set_table_name 'backup_scp'
12
+ attr_accessor :storage
13
+ default_scope \
14
+ :order => 'created_at desc'
15
+ end
18
16
 
19
17
  # Callbacks
20
18
  after_save :clean_backups
@@ -26,8 +24,9 @@ module Backup
26
24
  # Sets the SCP values
27
25
  def load_adapter(adapter)
28
26
  self.adapter_config = adapter
27
+ self.storage = 'scp'
29
28
  self.trigger = adapter.procedure.trigger
30
- self.adapter = adapter.procedure.adapter_name
29
+ self.adapter = adapter.procedure.adapter_name.to_s
31
30
  self.filename = adapter.final_file
32
31
  self.keep_backups = adapter.procedure.attributes['keep_backups']
33
32
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: backup
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael van Rooijen