Class: Safeconsole::Console
- Inherits:
-
Object
- Object
- Safeconsole::Console
- Extended by:
- Commands
- Includes:
- Messages, Singleton
- Defined in:
- lib/safeconsole/console.rb
Class Attribute Summary collapse
-
.__console_commit ⇒ Object
Returns the value of attribute __console_commit.
-
.__console_done ⇒ Object
Returns the value of attribute __console_done.
Class Method Summary collapse
Methods included from Commands
commands, commit, done, nevermind, refresh, stats
Methods included from Messages
app_name, commands, commit, done, included, invalid_query, method_missing, nevermind, refresh, respond_to_missing?, session_expired, session_start, session_stats, transaction_start, unsafe_env, welcome
Class Attribute Details
.__console_commit ⇒ Object
Returns the value of attribute __console_commit.
12 13 14 |
# File 'lib/safeconsole/console.rb', line 12 def __console_commit @__console_commit end |
.__console_done ⇒ Object
Returns the value of attribute __console_done.
12 13 14 |
# File 'lib/safeconsole/console.rb', line 12 def __console_done @__console_done end |
Class Method Details
.done! ⇒ Object
40 41 42 43 |
# File 'lib/safeconsole/console.rb', line 40 def done! @__console_done = true @__exit_safeconsole = true end |
.done? ⇒ Boolean
45 46 47 |
# File 'lib/safeconsole/console.rb', line 45 def done? @__console_done end |
.run ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/safeconsole/console.rb', line 14 def run (:welcome) (:commands) SessionWatcher.watch_session! if Safeconsole.watch_session? (:session_start) loop do @__console_done = false @__console_commit = false (:transaction_start) ActiveRecord::Base.transaction do binding.pry quiet: true, prompt_name: "safeconsole" # standard:disable Lint/Debugger raise ActiveRecord::Rollback unless @__console_commit end break (:done) if @__console_done (:refresh) sleep 0.5 end end |