Skip to content

Instantly share code, notes, and snippets.

@Teino1978-Corp
Created November 16, 2015 02:43
Show Gist options
  • Save Teino1978-Corp/58cc3d699dc39987379f to your computer and use it in GitHub Desktop.
Save Teino1978-Corp/58cc3d699dc39987379f to your computer and use it in GitHub Desktop.
Lean Rails Application
Doing it this way means you are loading the app directly from a custom boot script. I also specified a custom environment and Gemfile:
RAILS_ENV=lean_development BUNDLE_GEMFILE=LeanGemfile bundle exec script/lean
# config/lean_application.rb
#
# Require and run only a part of your Rails app (maybe as a background process)
#
require File.expand_path('../boot', __FILE__)
require 'active_record/railtie'
require 'action_mailer/railtie'
Bundler.require *Rails.groups(:assets => %w(development test))
module Lean
class Application < Rails::Application
config.time_zone = 'Pacific Time (US & Canada)'
config.encoding = 'utf-8'
config.autoload_paths << config.root.join('lib')
config.assets.enabled = false
config.paths['config/routes'] = [] # skip routes
config.paths['config/initializers'] = Dir[config.root.join('config/lean_initializers/*')] # custom initializers
end
end
Lean::Application.initialize!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment