命名空间
- 类 Rails::Console::AppInstance
- 类 Rails::Console::ControllerHelper
- 类 Rails::Console::ControllerInstance
- 类 Rails::Console::IRBConsole
- 类 Rails::Console::NewSession
- 类 Rails::Console::RailsHelperBase
- 类 Rails::Console::ReloadCommand
- 类 Rails::Console::ReloadHelper
方法
- E
- N
- S
属性
[R] | app | |
[R] | console | |
[R] | options |
类公共方法
new(app, options = {}) 链接
# File railties/lib/rails/commands/console/console_command.rb, line 13 def initialize(app, options = {}) @app = app @options = options app.sandbox = sandbox? if sandbox? && app.config.disable_sandbox puts "Error: Unable to start console in sandbox mode as sandbox mode is disabled (config.disable_sandbox is true)." exit 1 end app.load_console @console = app.config.console || begin require "rails/commands/console/irb_console" IRBConsole.new(app) end end
start(*args) 链接
实例公共方法
sandbox?() 链接
set_environment!() 链接
start() 链接
# File railties/lib/rails/commands/console/console_command.rb, line 49 def start set_environment! if environment? if sandbox? puts "Loading #{Rails.env} environment in sandbox (Rails #{Rails.version})" puts "Any modifications you make will be rolled back on exit" else puts "Loading #{Rails.env} environment (Rails #{Rails.version})" end console.start end