captools 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +4 -0
- data/Rakefile +1 -2
- data/lib/captools.rb +1 -1
- data/lib/captools/recipes.rb +5 -3
- metadata +3 -3
data/History.txt
CHANGED
data/Rakefile
CHANGED
@@ -5,12 +5,11 @@ require 'hoe'
|
|
5
5
|
require './lib/captools.rb'
|
6
6
|
|
7
7
|
Hoe.new('captools', Captools::VERSION) do |p|
|
8
|
-
p.rubyforge_name = '
|
8
|
+
p.rubyforge_name = 'nycrb'
|
9
9
|
p.summary = 'some sweet capistrano tools'
|
10
10
|
p.description = p.paragraphs_of('README.txt', 2..5).join("\n\n")
|
11
11
|
p.url = p.paragraphs_of('README.txt', 0).first.split(/\n/)[1..-1]
|
12
12
|
p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
|
13
|
-
#p.extra_deps
<<
['mysql']
|
14
13
|
end
|
15
14
|
|
16
15
|
# vim: syntax=Ruby
|
data/lib/captools.rb
CHANGED
data/lib/captools/recipes.rb
CHANGED
@@ -51,13 +51,15 @@ Capistrano.configuration(:must_exist).load do
|
|
51
51
|
|
52
52
|
set :environment_database_password, proc { Capistrano::CLI.password_prompt("#{rails_env} database remote Password : ") }
|
53
53
|
@buffer = YAML::load_file('config/database.yml')
|
54
|
-
|
54
|
+
set :db_password, proc { Capistrano::CLI.password_prompt("Remote Database Password : ") }
|
55
55
|
#get remote version
|
56
|
-
run("#{
|
56
|
+
run("mysql -u #{@buffer["production"]["username"]} -p #{@buffer["production"]["database"]} --batch --skip-column-names -e 'select version from schema_info;'") do |ch, stream, data|
|
57
|
+
ch.send_data "#{db_password}\n" if data =~ /^Enter password:/
|
58
|
+
@remote_version = data.to_i
|
59
|
+
end
|
57
60
|
|
58
61
|
if @remote_version == local_version
|
59
62
|
puts "Your Database Structure is in sync with the remote server..."
|
60
|
-
set :db_password, proc { Capistrano::CLI.password_prompt("Remote Database Password : ") }
|
61
63
|
tmp_file = File.new("tmp/dump.sql", "w+")
|
62
64
|
run "mysqldump -u #{@buffer["production"]["username"]} -p #{@buffer["production"]["database"]}" do |ch, stream, out|
|
63
65
|
ch.send_data "#{db_password}\n" if out =~ /^Enter password:/
|
metadata
CHANGED
@@ -3,14 +3,14 @@ rubygems_version: 0.8.11
|
|
3
3
|
specification_version: 1
|
4
4
|
name: captools
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.0.
|
7
|
-
date: 2007-01-
|
6
|
+
version: 0.0.3
|
7
|
+
date: 2007-01-30 00:00:00 -05:00
|
8
8
|
summary: some sweet capistrano tools
|
9
9
|
require_paths:
|
10
10
|
- lib
|
11
11
|
email: ryand-ruby@zenspider.com
|
12
12
|
homepage: " by Jake Howerton, Evan Short"
|
13
|
-
rubyforge_project:
|
13
|
+
rubyforge_project: nycrb
|
14
14
|
description: "== FEATURES/PROBLEMS: * There are only two tasks * +pull_assets+ can help you download assets( like images) from a staging or production server to your local environment * +pull_database+ will grab all your production data for you and stick it in your development database ( this could possibly be dangerous if you dont think about it first) * The tasks are currently highly dependent on my environment... lets generalize them == SYNOPSIS: Capistrano task repository == REQUIREMENTS:"
|
15
15
|
autorequire:
|
16
16
|
default_executable:
|