Class: Sinatra
- Inherits:
-
Thor
show all
- Includes:
- GitConfig, Thor::Actions
- Defined in:
- lib/sinatra.rb
Instance Method Summary
collapse
Methods included from GitConfig
#author, #email, #github_token, #github_user, #jenkins_password, #jenkins_server, #jenkins_user
Instance Method Details
#preflight ⇒ Object
13
14
15
16
17
18
19
20
21
|
# File 'lib/sinatra.rb', line 13
def preflight
abort "#{name} is already taken on heroku" unless
HTTParty.get("http://#{name}.heroku.com").code == 404
author && email
end
|
#setup ⇒ Object
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/sinatra.rb', line 24
def setup
guarded "git clone git://github.com/mwotton/heroku-sinatra-app.git #{name}"
Dir.chdir name do
guarded "git remote rm origin" guarded "heroku create #{name}"
File.open("runtests.sh", "w") do |f|
f.write "bundle exec rspec spec"
end
end
end
|