Module: SaferRailsConsole::Patches::Boot::SandboxFlag

Defined in:
lib/safer_rails_console/patches/boot/sandbox_flag.rb

Defined Under Namespace

Modules: Rails

Class Method Summary collapse

Class Method Details

.console_options(opt, options = {}) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/safer_rails_console/patches/boot/sandbox_flag.rb', line 7

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