Sha256: f2973e1dffff13f399f4f2c19cf09cf4cfd8a2606aa2de3b83e99d54bf0a42a5

Contents?: true

Size: 1.45 KB

Versions: 17

Compression:

Stored size: 1.45 KB

Contents

# This file is merely for beginning the boot process, check dependencies.rb for more information
require 'rubygems'
require 'sinatra/base'

RACK_ENV = ENV["RACK_ENV"] ||= "development" unless defined? RACK_ENV
ROOT_DIR = File.dirname(__FILE__) + '/../' unless defined? ROOT_DIR

# Helper method for file references.
# root_path("config", "settings.yml")
def root_path(*args)
  File.join(ROOT_DIR, *args)
end

# Returns the full path to the public folder along with any given additions
# public_path("images")
def public_path(*args)
  root_path('public', *args)
end

class <%= @class_name %> < Sinatra::Application
  # Defines basic application settings
  set :root, root_path
  set :views, root_path("app", "views")
  set :images_path, public_path("images")
  set :default_builder, 'StandardFormBuilder'
  set :environment, RACK_ENV.to_sym if defined?(RACK_ENV)

  # Attempts to require all dependencies with bundler, if this fails, bundle and then try again
  def self.bundler_require_dependencies(environment=nil)
    require 'bundler'
    require File.expand_path(File.join(File.dirname(__FILE__), '/../vendor', 'gems', 'environment'))
    Bundler.require_env(environment)
  rescue LoadError => e
    puts "Bundler must be run to resolve dependencies!"
    system("cd #{ROOT_DIR}; gem bundle")
    puts "Retrying with dependencies resolved..."
    retry
  end

  # Dependencies contains all required gems and core configuration
  require File.dirname(__FILE__) + '/dependencies.rb'
end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
darkhelmet-sinatra_more-0.3.36 generators/base_app/config/boot.rb.tt
darkhelmet-sinatra_more-0.3.35 generators/base_app/config/boot.rb.tt
darkhelmet-sinatra_more-0.3.34 generators/base_app/config/boot.rb.tt
darkhelmet-sinatra_more-0.3.33 generators/base_app/config/boot.rb.tt
sinatra_more-0.3.33 generators/base_app/config/boot.rb.tt
sinatra_more-0.3.32 generators/base_app/config/boot.rb.tt
sinatra_more-0.3.31 generators/base_app/config/boot.rb.tt
sinatra_more-0.3.30 generators/base_app/config/boot.rb.tt
sinatra_more-0.3.29 generators/base_app/config/boot.rb.tt
sinatra_more-0.3.28 generators/base_app/config/boot.rb.tt
sinatra_more-0.3.27 generators/base_app/config/boot.rb.tt
sinatra_more-0.3.26 generators/base_app/config/boot.rb.tt
sinatra_more-0.3.25 generators/base_app/config/boot.rb.tt
sinatra_more-0.3.24 generators/base_app/config/boot.rb.tt
sinatra_more-0.3.23 generators/base_app/config/boot.rb.tt
sinatra_more-0.3.22 generators/base_app/config/boot.rb.tt
sinatra_more-0.3.21 generators/base_app/config/boot.rb.tt