Module: SaferRailsConsole::Console
- Extended by:
- Colors
- Defined in:
- lib/safer_rails_console/console.rb
Constant Summary
Constants included
from Colors
SaferRailsConsole::Colors::BLACK, SaferRailsConsole::Colors::BLUE, SaferRailsConsole::Colors::CYAN, SaferRailsConsole::Colors::GREEN, SaferRailsConsole::Colors::NONE, SaferRailsConsole::Colors::PINK, SaferRailsConsole::Colors::RED, SaferRailsConsole::Colors::WHITE, SaferRailsConsole::Colors::YELLOW
Class Method Summary
collapse
Methods included from Colors
color_text
Class Method Details
.initialize_sandbox ⇒ Object
8
9
10
|
# File 'lib/safer_rails_console/console.rb', line 8
def initialize_sandbox
require 'safer_rails_console/patches/sandbox'
end
|
.load_config ⇒ Object
16
17
18
19
20
21
22
23
|
# File 'lib/safer_rails_console/console.rb', line 16
def load_config
gem = Gem::Specification.find_by_name('safer_rails_console')
gem_root = gem.gem_dir
ARGV.push(
'-r',
File.join(gem_root, 'lib', 'safer_rails_console', 'consoles', "#{SaferRailsConsole.config.console}.rb")
)
end
|
.sandbox_user_prompt ⇒ Object
25
26
27
28
29
30
|
# File 'lib/safer_rails_console/console.rb', line 25
def sandbox_user_prompt
puts 'Defaulting the console into sandbox mode.' puts "Type 'disable' to disable. Anything else will begin a sandboxed session:" input = gets.strip
input != 'disable'
end
|