public
Description: Plugin for Rails to enhance the deployment process to RailsBoxcar.com instances
Homepage: http://railsboxcar.com/
Clone URL: git://github.com/planetargon/boxcar-conductor.git
commit  7e88c102d42e151244fadc25287ca57c41e2afa8
tree    dfef13e9aae0a4128f8dc9986e72589e4dc243d7
parent  6318b945d65bc18b6ad89f3c661424c102e29084
boxcar-conductor / install.rb
100644 24 lines (22 sloc) 0.987 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
def copy(file_name, from_dir, to_dir)
  FileUtils.mkdir to_dir unless File.exist?(File.expand_path(to_dir))
  from = File.expand_path(File.join(from_dir,file_name))
  to = File.expand_path(File.join(to_dir, file_name.gsub('.example', '')))
  FileUtils.cp from, to, :verbose => true unless File.exist?(to)
end
 
# copy config files to application directory
begin
  templates_dir = File.join(File.dirname(__FILE__), 'templates')
  config_dir = File.join(RAILS_ROOT, 'config')
  root_dir = File.join(RAILS_ROOT)
  copy 'Capfile.example', templates_dir, root_dir
  copy 'deploy.rb.example', templates_dir, config_dir
  puts "#############################################"
  puts "# Boxcar Conductor -- INSTALLED! "
  puts "# Next steps:"
  puts "# 1. Edit config/deploy.rb"
  puts "# 2. Run cap boxcar:config -q"
  puts "#############################################"
rescue Exception => e
  puts "There are problems copying Boxcar configuration files to you app: #{e.message}"
end