Module: Safeconsole

Defined in:
lib/safeconsole.rb,
lib/safeconsole/utils.rb,
lib/safeconsole/console.rb,
lib/safeconsole/railtie.rb,
lib/safeconsole/version.rb,
lib/safeconsole/commands.rb,
lib/safeconsole/messages.rb,
lib/safeconsole/pry_config.rb,
lib/safeconsole/configuration.rb,
lib/safeconsole/session_watcher.rb

Defined Under Namespace

Modules: Commands, Messages, Utils Classes: Configuration, Console, PryConfig, Railtie, SessionWatcher

Constant Summary collapse

VERSION =
"1.0.0"

Class Method Summary collapse

Class Method Details

.allow_unsafe?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/safeconsole/configuration.rb', line 19

def allow_unsafe?
  config.allow_unsafe
end

.configObject



31
32
33
# File 'lib/safeconsole/configuration.rb', line 31

def config
  @configuration ||= Configuration.new
end

.configure {|config| ... } ⇒ Object

Yields:



35
36
37
# File 'lib/safeconsole/configuration.rb', line 35

def configure
  yield config
end

.envObject



27
28
29
# File 'lib/safeconsole/configuration.rb', line 27

def env
  config.current_env
end

.start!Object



18
19
20
21
# File 'lib/safeconsole.rb', line 18

def start!
  Safeconsole::PryConfig.add_hooks
  Safeconsole::Console.run
end

.watch_session?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/safeconsole/configuration.rb', line 23

def watch_session?
  config.command_timeout.present? || config.session_timeout.present?
end