Skip to content
Browse files

add a rails/script shim so that we can use $ rails generate migration

  • Loading branch information...
1 parent 2fe58a0 commit 3f2385033444065520812d59055ec880fbfa3452 @svenfuchs svenfuchs committed
Showing with 33 additions and 0 deletions.
  1. +18 −0 config/application.rb
  2. +10 −0 config/boot.rb
  3. +5 −0 script/rails
View
18 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
View
10 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__)
+
View
5 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.
Something went wrong with that request. Please try again.