module Rails::Sh::Rails

Public Class Methods

_invoke(line) click to toggle source
# File lib/rails/sh/rails.rb, line 16
def _invoke(line)
  reload!
  ARGV.clear
  ARGV.concat line.split(/\s+/)
  puts "\e[42m$ rails #{ARGV.join(" ")}\e[0m"
  require 'rails/commands'
end
init() click to toggle source
# File lib/rails/sh/rails.rb, line 7
def init
  before_fork do
    ActiveRecord::Base.remove_connection if defined?(ActiveRecord::Base)
  end
  after_fork do
    ActiveRecord::Base.establish_connection if defined?(ActiveRecord::Base)
  end
end
reload!() click to toggle source
# File lib/rails/sh/rails.rb, line 24
def reload!
  ActionDispatch::Callbacks.new(Proc.new {}).call({})
end
sub_commands() click to toggle source
# File lib/rails/sh/rails.rb, line 28
def sub_commands
  %w(generate destroy plugin benchmarker profiler
    console server dbconsole application runner)
end