Sha256: 9bfe42e0679e026c1377cb4a28bdcaf0a21d6c5861576b0d4293f88c4158c19c
Contents?: true
Size: 926 Bytes
Versions: 7
Compression:
Stored size: 926 Bytes
Contents
module SaferRailsConsole module Console class << self include SaferRailsConsole::Colors def initialize_sandbox require 'safer_rails_console/patches/sandbox' end def print_warning puts color_text(SaferRailsConsole.config.warn_text, SaferRailsConsole.prompt_color) # rubocop:disable Rails/Output end def load_config gem = Gem::Specification.find_by_name('safer_rails_console') # rubocop:disable Rails/DynamicFindBy gem_root = gem.gem_dir ARGV.push '-r', File.join(gem_root, 'lib', 'safer_rails_console', 'consoles', "#{SaferRailsConsole.config.console}.rb") end def sandbox_user_prompt puts "Defaulting the console into sandbox mode.\nType 'disable' to disable. Anything else will begin a sandboxed session:" # rubocop:disable Rails/Output input = gets.strip input != 'disable' end end end end
Version data entries
7 entries across 7 versions & 1 rubygems