Allow the dump task to be run alone without the import #1

Merged
merged 3 commits into from Nov 29, 2011
Jump to file or symbol
Failed to load files and symbols.
+39 −4
Split
View
@@ -1,5 +1,5 @@
require 'echoe'
-Echoe.new('capistrano-mysqldump', '1.06') do |p|
+Echoe.new('capistrano-mysqldump', '1.07') do |p|
p.author = "Alexander Farrill"
p.email = "alex.farrill@gmail.com"
p.summary = "Capistrano extension to run mysqldump remotely, download, and import into your local Rails development database"
@@ -0,0 +1,32 @@
+# -*- encoding: utf-8 -*-
+
+Gem::Specification.new do |s|
+ s.name = %q{capistrano-mysqldump}
+ s.version = "1.07"
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
+ s.authors = [%q{Alexander Farrill}]
+ s.date = %q{2011-11-29}
+ s.description = %q{Capistrano extension to run mysqldump remotely, download, and import into your local Rails development database}
+ s.email = %q{alex.farrill@gmail.com}
+ s.extra_rdoc_files = [%q{README}, %q{lib/capistrano/mysqldump.rb}]
+ s.files = [%q{MIT-LICENSE}, %q{Manifest}, %q{README}, %q{Rakefile}, %q{lib/capistrano/mysqldump.rb}, %q{capistrano-mysqldump.gemspec}]
+ s.homepage = %q{http://capistrano-mysqldump.github.com/capistrano-mysqldump/}
+ s.rdoc_options = [%q{--line-numbers}, %q{--inline-source}, %q{--title}, %q{Capistrano-mysqldump}, %q{--main}, %q{README}]
+ s.require_paths = [%q{lib}]
+ s.rubyforge_project = %q{capistrano-mysqldump}
+ s.rubygems_version = %q{1.8.6}
+ s.summary = %q{Capistrano extension to run mysqldump remotely, download, and import into your local Rails development database}
+
+ if s.respond_to? :specification_version then
+ s.specification_version = 3
+
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
+ s.add_runtime_dependency(%q<capistrano>, [">= 1.0.0"])
+ else
+ s.add_dependency(%q<capistrano>, [">= 1.0.0"])
+ end
+ else
+ s.add_dependency(%q<capistrano>, [">= 1.0.0"])
+ end
+end
@@ -1,6 +1,11 @@
Capistrano::Configuration.instance.load do
namespace :mysqldump do
task :default, :roles => :db do
+ dump
+ import
+ end
+
+ task :setup do
set :mysqldump_config, YAML.load_file("config/database.yml")[rails_env.to_s]
host = mysqldump_config["host"]
@@ -16,12 +21,10 @@
set :mysqldump_remote_filename, File.join( mysqldump_remote_tmp_dir, mysqldump_filename_gz )
set :mysqldump_local_filename, File.join( mysqldump_local_tmp_dir, mysqldump_filename )
set :mysqldump_local_filename_gz, File.join( mysqldump_local_tmp_dir, mysqldump_filename_gz )
-
- dump
- import
end
task :dump, :roles => :db do
+ setup
username, password, database, host = mysqldump_config.values_at *%w( username password database host )
case mysqldump_location