Skip to content

Instantly share code, notes, and snippets.

@bunnymatic
Created May 25, 2012 21:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bunnymatic/2790661 to your computer and use it in GitHub Desktop.
Save bunnymatic/2790661 to your computer and use it in GitHub Desktop.
Sinatra console
#!/usr/bin/env ruby
require 'data_mapper'
require 'sinatra'
require 'sinatra/config_file'
disable :run
root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
Dir[File.join(root,"{lib,models}/**/*.rb")].each do |file|
require file
end
set :environments, %w{development test production staging}
set :environment, ENV['RACK_ENV'] || :development
config_file File.join( [root, 'config', 'config.yml'] )
DataMapper::setup(:default, settings.database_url)
DataMapper.auto_upgrade!
require 'irb'
IRB.start
@loveybot
Copy link

Yay Ruby!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment