Class: SinatraWhiz

Inherits:
WhizBase show all
Defined in:
lib/heroku_whiz.rb

Instance Method Summary collapse

Methods inherited from WhizBase

#deploy, #local_run, #local_testrun, #wipe_clean

Constructor Details

#initialize(app_path, debug: false) ⇒ SinatraWhiz

Returns a new instance of SinatraWhiz.



188
189
190
# File 'lib/heroku_whiz.rb', line 188

def initialize(app_path, debug: false)
  super(app_path, debug: debug)
end

Instance Method Details

#createObject



192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
# File 'lib/heroku_whiz.rb', line 192

def create()

  config = %q(
require './hello'
run Sinatra::Application
)

  gemfile = %q(
source 'https://rubygems.org'
gem 'sinatra'
gem 'puma'
)

  procfile = 'web: bundle exec rackup config.ru -p $PORT'

  create_basefiles(config, gemfile, procfile)

  hello_rb = %q(
require 'sinatra'

get '/' do
"Hello World!"
end
)
  File.write File.join(@app_path, 'hello.rb'), hello_rb
  sleep 0.3

end