rehabilitate 0.3.6 → 0.3.7

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,8 +1,9 @@
1
1
  require 'rubygems'
2
2
  require 'rake'
3
3
  require 'echoe'
4
+ require 'lib/rehabilitate.rb'
4
5
 
5
- Echoe.new('rehabilitate', "0.3.6") do |p|
6
+ Echoe.new('rehabilitate', Rehabilitate::VERSION) do |p|
6
7
  p.description = "Backup stuff"
7
8
  p.url = "https://github.com/fearoffish/rehabilitate"
8
9
  p.author = "Jamie van Dyke"
data/bin/rehabilitate CHANGED
@@ -28,7 +28,7 @@ require 'fileutils'
28
28
  include Log4r
29
29
 
30
30
  program :name, 'Rehabilitate'
31
- program :version, '0.3.2'
31
+ program :version, Rehabilitate::VERSION
32
32
  program :description, 'A backup system that can be given commands to be run before and after a backup or restore'
33
33
 
34
34
  global_option('-d', '--debug', 'More verbose logging and nothing is actually run') { $DEBUG = true }
@@ -19,10 +19,10 @@ class Postgresql < Plugin
19
19
  drop_table_sql = File.join(options.tmp, 'droptables.sql')
20
20
  log %[psql -t -h #{options.host} -U #{options.user} -d #{options.database} -c "SELECT 'DROP TABLE ' || n.nspname || '.' || c.relname || ' CASCADE;' FROM pg_catalog.pg_class AS c LEFT JOIN pg_catalog.pg_namespace AS n ON n.oid = c.relnamespace WHERE relkind = 'r' AND n.nspname NOT IN ('pg_catalog', 'pg_toast') AND pg_catalog.pg_table_is_visible(c.oid)" > #{drop_table_sql} ]
21
21
  log %x[psql -t -h #{options.host} -U #{options.user} -d #{options.database} -c "SELECT 'DROP TABLE ' || n.nspname || '.' || c.relname || ' CASCADE;' FROM pg_catalog.pg_class AS c LEFT JOIN pg_catalog.pg_namespace AS n ON n.oid = c.relnamespace WHERE relkind = 'r' AND n.nspname NOT IN ('pg_catalog', 'pg_toast') AND pg_catalog.pg_table_is_visible(c.oid)" > #{drop_table_sql} ]
22
- log %[psql -h #{options.host} -U #{options.user} #{options.database} < #{drop_table_sql} ] unless $? == 256
23
- log %x[psql -h #{options.host} -U #{options.user} #{options.database} < #{drop_table_sql} ] unless $? == 256
24
- log %[psql -h #{options.host} -U #{options.user} #{options.database} < #{backup_file}] unless $? == 256
25
- log %x[psql -h #{options.host} -U #{options.user} #{options.database} < #{backup_file}] unless $? == 256
22
+ log %[psql -h #{options.host} -U #{options.user} #{options.database} < #{drop_table_sql} #{"> /dev/null 2>&1" unless options.debug} ] unless $? == 256
23
+ log %x[psql -h #{options.host} -U #{options.user} #{options.database} < #{drop_table_sql} #{"> /dev/null 2>&1" unless options.debug} ] unless $? == 256
24
+ log %[psql -h #{options.host} -U #{options.user} #{options.database} < #{backup_file} #{"> /dev/null 2>&1" unless options.debug} ] unless $? == 256
25
+ log %x[psql -h #{options.host} -U #{options.user} #{options.database} < #{backup_file} #{"> /dev/null 2>&1" unless options.debug} ]] unless $? == 256
26
26
  options._tmp_files << drop_table_sql
27
27
  options._failure = true if $? == 256
28
28
  end
data/lib/rehabilitate.rb CHANGED
@@ -2,6 +2,8 @@ require 'rehabilitate/plugin'
2
2
  require 'rehabilitate/plugins/splitter'
3
3
 
4
4
  class Rehabilitate
5
+ VERSION = "0.3.7"
6
+
5
7
  def self.backup(options)
6
8
  driver = Plugin::create( options.driver )
7
9
  driver.backup(options)
data/rehabilitate.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{rehabilitate}
5
- s.version = "0.3.6"
5
+ s.version = "0.3.7"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Jamie van Dyke"]
9
- s.date = %q{2011-01-10}
9
+ s.date = %q{2011-01-12}
10
10
  s.default_executable = %q{rehabilitate}
11
11
  s.description = %q{Backup stuff}
12
12
  s.email = %q{jamie@fearoffish.com}
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rehabilitate
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 6
10
- version: 0.3.6
9
+ - 7
10
+ version: 0.3.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jamie van Dyke
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-01-10 00:00:00 +00:00
18
+ date: 2011-01-12 00:00:00 +00:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency