Sha256: 085363552f5a9dfa6badd89b3a56de9146f134362261ad2e4e8a699242810cea

Contents?: true

Size: 1.14 KB

Versions: 6

Compression:

Stored size: 1.14 KB

Contents

desc 'Run by git post-update hook when deployed to a web server'
task :deploy do
	# This task is typiclly run after the site is updated but before the server is restarted.
end

desc 'Restart the application server'
task :restart do
	# This task is run after the deployment task above.
	if passenger_config = `which passenger-config`.chomp!
		sh(passenger_config, 'restart-app', '--ignore-passenger-not-running', File.dirname(__dir__))
	end
end

desc 'Set up the environment for running your web application'
task :environment do
	require_relative '../config/environment'
	
	# We ensure this is part of the shell environment so if other commands are invoked they will work correctly.
	ENV['RACK_ENV'] = RACK_ENV.to_s
end

desc 'Run a server for testing your web application'
task :server => :environment do
	port = ENV.fetch('SERVER_PORT', 9292).to_s
	exec('puma', '-v', '-p', port)
end

desc 'Start an interactive console for your web application'
task :console => :environment do
	require 'pry'
	require 'rack/test'
	
	include Rack::Test::Methods
	
	def app
		@app ||= Rack::Builder.parse_file(File.expand_path("../config.ru", __dir__)).first
	end
	
	Pry.start
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
utopia-1.9.11 setup/site/tasks/utopia.rake
utopia-1.9.10 setup/site/tasks/utopia.rake
utopia-1.9.9 setup/site/tasks/utopia.rake
utopia-1.9.7 setup/site/tasks/utopia.rake
utopia-1.9.6 setup/site/tasks/utopia.rake
utopia-1.9.5 setup/site/tasks/utopia.rake