Class: Rails
Overview
TODO abstract out the heroku stuff
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from GitConfig
#author, #email, #github_token, #github_user, #jenkins_password, #jenkins_server, #jenkins_user
Class Method Details
.source_root ⇒ Object
13
14
15
|
# File 'lib/rails.rb', line 13
def self.source_root
File.join(File.dirname(__FILE__), '..', 'templates', 'rails')
end
|
Instance Method Details
#preflight ⇒ Object
18
19
20
21
22
23
24
25
26
|
# File 'lib/rails.rb', line 18
def preflight
abort "#{name} is already taken on heroku" unless
HTTParty.get("http://#{name}.heroku.com").code == 404
author && email
end
|
#setup ⇒ Object
29
30
31
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/rails.rb', line 29
def setup
guarded "git clone git://github.com/mwotton/railstemplate.git #{name}"
guarded "rm #{name}/config/database.yml"
template "database_yml.tt", "#{name}/config/database.yml"
Dir.chdir name do
system "git remote rm origin 2>/dev/null >/dev/null" guarded "heroku create #{name}"
File.open("runtests.sh", "w") do |f|
f.write "bundle exec rspec spec"
end
end
end
|