module SaferRailsConsole::Patches::Boot::SandboxFlag
Public Class Methods
console_options(opt, options = {})
click to toggle source
# File lib/safer_rails_console/patches/boot/sandbox_flag.rb, line 9 def self.console_options(opt, options = {}) opt.banner = 'Usage: rails console [environment] [options]' opt.on('-s', '--[no-]sandbox', 'Explicitly enable/disable sandbox mode.') { |v| options[:sandbox] = v } opt.on('-w', '--writable', 'Alias for --no-sandbox.') { |v| options[:writable] = v } opt.on('-r', '--read-only', 'Alias for --sandbox.') { |v| options[:'read-only'] = v } opt.on('-e', '--environment=name', String, 'Specifies the environment to run this console under (test/development/production).', 'Default: development') { |v| options[:environment] = v.strip } end