forked from backup/backup
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
46 changed files
with
637 additions
and
106 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
## | ||
# To run the test suite against all 3 rubies: 1.9.2, 1.8.7 and REE, simply run the following command: | ||
# $ guard start | ||
# | ||
# Be use you are using RVM and have Ruby 1.9.2, 1.8.7 and REE installed as well as all | ||
# Backup's gem dependencies for each of these Ruby intepreters. | ||
|
||
guard 'rspec', | ||
:version => 2, | ||
:rvm => ['1.9.2', '1.8.7', 'ree'], | ||
:bundler => true, | ||
:cli => '--color --format Fuubar --fail-fast' do | ||
|
||
watch(%r{^spec/.+_spec\.rb}) | ||
watch(%r{^lib/(.+)\.rb}) { 'spec' } | ||
watch('spec/spec_helper.rb') { 'spec' } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# encoding: utf-8 | ||
|
||
module Backup | ||
module Compressor | ||
class Bzip2 < Base | ||
|
||
## | ||
# Tells Backup::Compressor::Bzip2 to compress | ||
# better (-9) rather than faster when set to true | ||
attr_writer :best | ||
|
||
## | ||
# Tells Backup::Compressor::Bzip2 to compress | ||
# faster (-1) rather than better when set to true | ||
attr_writer :fast | ||
|
||
## | ||
# Creates a new instance of Backup::Compressor::Bzip2 and | ||
# configures it to either compress faster or better | ||
# bzip2 compresses by default with -9 (best compression) | ||
# and lower block sizes don't make things significantly faster | ||
# (according to official bzip2 docs) | ||
def initialize(&block) | ||
load_defaults! | ||
|
||
@best ||= false | ||
@fast ||= false | ||
|
||
instance_eval(&block) if block_given? | ||
end | ||
|
||
## | ||
# Performs the compression of the packages backup file | ||
def perform! | ||
log! | ||
run("#{ utility(:bzip2) } #{ options } '#{ Backup::Model.file }'") | ||
Backup::Model.extension += '.bz2' | ||
end | ||
|
||
private | ||
|
||
## | ||
# Combines the provided options and returns a bzip2 options string | ||
def options | ||
(best + fast).join("\s") | ||
end | ||
|
||
## | ||
# Returns the bzip2 option syntax for compressing | ||
# setting @best to true is redundant, as bzip2 compresses best by default | ||
def best | ||
return ['--best'] if @best; [] | ||
end | ||
|
||
## | ||
# Returns the bzip2 option syntax for compressing | ||
# (not significantly) faster when @fast is set to true | ||
def fast | ||
return ['--fast'] if @fast; [] | ||
end | ||
|
||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# encoding: utf-8 | ||
|
||
module Backup | ||
module Configuration | ||
module Compressor | ||
class Bzip2 < Base | ||
class << self | ||
|
||
## | ||
# Tells Backup::Compressor::Bzip2 to compress | ||
# better (-9) which is bzip2 default anyway | ||
attr_accessor :best | ||
|
||
## | ||
# Tells Backup::Compressor::Bzip2 to compress | ||
# faster (-1) (but not significantly faster) | ||
attr_accessor :fast | ||
|
||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# encoding: utf-8 | ||
|
||
module Backup | ||
module Configuration | ||
module Notifier | ||
class Presently < Base | ||
class << self | ||
|
||
## | ||
# Presently subdomain | ||
attr_accessor :subdomain | ||
|
||
## | ||
# Presently credentials | ||
attr_accessor :user_name, :password | ||
|
||
## | ||
# Group id | ||
attr_accessor :group_id | ||
|
||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.