Class: Sinatra

Inherits:
Thor
  • Object
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

#preflightObject



13
14
15
16
17
18
19
20
21
# File 'lib/sinatra.rb', line 13

def preflight
  # bit rough and ready, but no heroku api for querying
  # app namespace
  abort "#{name} is already taken on heroku" unless
    HTTParty.get("http://#{name}.heroku.com").code == 404

  # these will abort anyway.
  author && email
end

#setupObject



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" # hide the evidence
    guarded "heroku create #{name}"
    File.open("runtests.sh", "w") do |f|
      f.write "bundle exec rspec spec"
    end
  end
end