Skip to content

Instantly share code, notes, and snippets.

@godfat
Created April 26, 2016 19:20
Show Gist options
  • Save godfat/ed80325e5b403733fe94ef50301b54ea to your computer and use it in GitHub Desktop.
Save godfat/ed80325e5b403733fe94ef50301b54ea to your computer and use it in GitHub Desktop.
minimal rails app
require 'rails'
require 'logger'
APP_PATH = 'rails'
root = File.expand_path("#{__dir__}/..")
config = Rails::Application::Configuration.new
config.root = root
app = Class.new(Struct.new(:root, :config)) do
def call _
[200, {}, ["OK\n"]]
end
end.new(root, config)
Rails.application = app
Rails.logger = Logger.new(File.open(IO::NULL))
require 'rails/commands'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment