Skip to content

Commit

Permalink
add a rails/script shim so that we can use $ rails generate migration
Browse files Browse the repository at this point in the history
  • Loading branch information
Sven Fuchs committed Mar 20, 2012
1 parent 2fe58a0 commit 3f23850
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
18 changes: 18 additions & 0 deletions config/application.rb
@@ -0,0 +1,18 @@
# dummy application.rb file that is used in script/rails so we can use the
# `rails generate migration` command

require File.expand_path('../boot', __FILE__)

require 'active_model/railtie'
require 'active_record/railtie'
require 'action_controller/railtie'
require 'action_view/railtie'
require 'action_mailer/railtie'

Bundler.require
require 'travis'

module Travis::Core
class Application < Rails::Application
end
end
10 changes: 10 additions & 0 deletions config/boot.rb
@@ -0,0 +1,10 @@
# dummy boot.rb file that is used in script/rails so we can use the
# `rails generate migration` command

require 'rubygems'
ENV['BUNDLE_GEMFILE'] = File.expand_path('../../Gemfile', __FILE__)
require 'bundler'
Bundler.setup

$:.unshift File.expand_path('../../lib', __FILE__)

5 changes: 5 additions & 0 deletions script/rails
@@ -0,0 +1,5 @@
#!/usr/bin/env ruby

APP_PATH = File.expand_path('../../config/application', __FILE__)
require File.expand_path('../../config/boot', __FILE__)
require 'rails/commands'

0 comments on commit 3f23850

Please sign in to comment.