Sha256: dc5e32df5727c6576b460fc06928ab42e8898df80000ad9b54ec3700828d0e0e

Contents?: true

Size: 1.24 KB

Versions: 4

Compression:

Stored size: 1.24 KB

Contents

# Dependencies contains all required gems, helpers and core configuration

class <%= @class_name %> < Sinatra::Application
  %w[rubygems rack-flash warden sinatra_more bcrypt].each { |gem| require gem }
  
  # Required middleware
  use Rack::Session::Cookie
  use Rack::Flash

  # Requires the initializer modules which configure specific components
  Dir[File.dirname(__FILE__) + '/initializers/*.rb'].each do |file|
    # Each initializer file contains a module called 'XxxxInitializer' (i.e HassleInitializer)
    require file
    file_class = File.basename(file, '.rb').classify
    register "#{file_class}Initializer".constantize
  end
  
  # Returns the list of load paths for this sinatra application
  def self.file_loading_paths
    ["lib/**/*.rb", "app/helpers/**/*.rb", "app/routes/**/*.rb", "app/models/*.rb", "app/mailers/*.rb"]
  end
  
  # Require all the folders and files necessary to run the application
  file_loading_paths.each { |load_path| Dir[root_path(load_path)].each { |file| require file } }
  
  # Includes all necessary sinatra_more helpers
  register SinatraMore::MarkupPlugin
  register SinatraMore::RenderPlugin
  register SinatraMore::MailerPlugin
  register SinatraMore::WardenPlugin
    
  # Required helpers
  helpers ViewHelpers
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sinatra_more-0.3.10 generators/base_app/config/dependencies.rb.tt
sinatra_more-0.3.9 generators/base_app/config/dependencies.rb.tt
sinatra_more-0.3.8 generators/base_app/config/dependencies.rb.tt
sinatra_more-0.3.7 generators/base_app/config/dependencies.rb.tt