Browse files

make deploy_host an optional setting

  • Loading branch information...
1 parent 7a2e0d0 commit 109e5306763180f6dfac5194e707c141a4c2bb3a @tilsammans committed Aug 4, 2011
Showing with 7 additions and 6 deletions.
  1. +1 −1 capistrano_transmit.gemspec
  2. +6 −5 lib/capistrano/transmit.rb
View
2 capistrano_transmit.gemspec
@@ -2,7 +2,7 @@
Gem::Specification.new do |s|
s.name = %q{capistrano_transmit}
- s.version = "0.2.6"
+ s.version = "0.2.7"
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
s.authors = ["Joost Baaij"]
View
11 lib/capistrano/transmit.rb
@@ -4,11 +4,12 @@
Capistrano::Configuration.instance.load do
- _cset :user, nil
- _cset(:db_config) { capture("cat #{current_path}/config/database.yml") }
- _cset(:db_remote) { YAML::load(db_config)['production'] }
- _cset(:db_local) { YAML::load_file("config/database.yml")['development'] }
- _cset(:dumpfile) { "#{current_path}/tmp/#{db_remote['database']}.sql.gz" }
+ _cset :user, nil
+ _cset(:deploy_host) { find_servers(:roles => :app).first.host }
+ _cset(:db_config) { capture("cat #{current_path}/config/database.yml") }
+ _cset(:db_remote) { YAML::load(db_config)['production'] }
+ _cset(:db_local) { YAML::load_file("config/database.yml")['development'] }
+ _cset(:dumpfile) { "#{current_path}/tmp/#{db_remote['database']}.sql.gz" }
after "transmit:get:mysql", "transmit:cleanup"
after "transmit:put:mysql", "transmit:cleanup"

0 comments on commit 109e530

Please sign in to comment.