rehabilitate 0.4.2 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,14 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rehabilitate (0.4.0)
4
+ rehabilitate (0.4.3)
5
5
  commander
6
6
  fog
7
7
  log4r
8
8
  net-scp
9
9
  net-ssh
10
10
  pluginfactory
11
- rehabilitate
12
11
 
13
12
  GEM
14
13
  remote: http://rubygems.org/
data/bin/rehabilitate CHANGED
@@ -12,11 +12,16 @@
12
12
  #
13
13
  # example: rehabilitate save --driver postgresql --type scp --location user:pass@ftp.example.com
14
14
 
15
- require "bundler/setup"
15
+ begin
16
+ require "bundler/setup"
17
+ rescue LoadError
18
+ require "rubygems"
19
+ end
16
20
 
17
21
  $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../lib"
18
22
  $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../lib/rehabilitate"
19
23
 
24
+ require "pluginfactory"
20
25
  require 'rehabilitate'
21
26
  require 'commander/import'
22
27
  require 'log4r'
@@ -1,13 +1,13 @@
1
- require "pluginfactory"
2
-
3
- class Plugin
4
- include PluginFactory
1
+ module Rehabilitate
2
+ class Plugin
3
+ include ::PluginFactory
5
4
 
6
- def self::derivative_dirs
7
- ["plugins"]
8
- end
5
+ def self::derivative_dirs
6
+ ["plugins"]
7
+ end
9
8
 
10
- def log(message)
11
- $LOGGER.info message
9
+ def log(message)
10
+ $LOGGER.info message
11
+ end
12
12
  end
13
13
  end
@@ -1,6 +1,6 @@
1
1
  require 'rehabilitate/plugin'
2
2
 
3
- class Lzop < Plugin
3
+ class Lzop < Rehabilitate::Plugin
4
4
  def compress(options)
5
5
  options._backup_files.collect! do |backup_file|
6
6
  new_backup_name = "#{backup_file}.tar.lzop"
@@ -1,6 +1,6 @@
1
1
  require 'rehabilitate/plugin'
2
2
 
3
- class Postgresql < Plugin
3
+ class Postgresql < Rehabilitate::Plugin
4
4
  def backup(options)
5
5
  options._backup_files.collect! do |backup_file|
6
6
  new_backup_name = "#{backup_file}.sql"
@@ -2,7 +2,7 @@ require 'rehabilitate/plugin'
2
2
  require 'fog'
3
3
  require 'yaml'
4
4
 
5
- class S3 < Plugin
5
+ class S3 < Rehabilitate::Plugin
6
6
  def list(options)
7
7
  location = parse_upload_string(options.location)
8
8
  s3 = setup_fog(location)
@@ -3,7 +3,7 @@ require 'uri'
3
3
  require 'net/ssh'
4
4
  require 'net/scp'
5
5
 
6
- class Scp < Plugin
6
+ class Scp < Rehabilitate::Plugin
7
7
  def upload(options)
8
8
  location = parse_upload_string(options.location)
9
9
  remote_dir = "#{location[:dir]}/#{options._base_backup_name}"
@@ -1,11 +1,11 @@
1
1
  require 'rehabilitate/plugin'
2
2
 
3
- class Splitter < Plugin
3
+ class Splitter < Rehabilitate::Plugin
4
4
  MAX_FILE_SIZE = (4.5*1024*1024*1024*1024*10).to_i #4.5TB
5
5
 
6
6
  def join(files)
7
- log %[ cat #{files.join(" ")} > #{files[0].split("-")[0..-2].join("-")} ]
8
- log %x[ cat #{files.join(" ")} > #{files[0].split("-")[0..-2].join("-")} ]
7
+ log %[ cat #{files.reverse.join(" ")} > #{files[0].split("-")[0..-2].join("-")} ]
8
+ log %x[ cat #{files.reverse.join(" ")} > #{files[0].split("-")[0..-2].join("-")} ]
9
9
  files[0].split("-")[0..-2].join("-")
10
10
  end
11
11
 
@@ -1,3 +1,3 @@
1
- class Rehabilitate
2
- VERSION = "0.4.2"
1
+ module Rehabilitate
2
+ VERSION = "0.4.4" unless const_defined?("VERSION")
3
3
  end
data/lib/rehabilitate.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  require 'rehabilitate/plugin'
2
- require 'rehabilitate/plugins/splitter'
3
2
 
4
- class Rehabilitate
3
+ module Rehabilitate
5
4
  def self.backup(options)
6
5
  driver = Plugin::create( options.driver )
7
6
  driver.backup(options)
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: rehabilitate
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.4.2
5
+ version: 0.4.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - Jamie van Dyke