Module: RailsConsole
- Defined in:
- lib/rails-console.rb,
lib/rails-console/user.rb,
lib/rails-console/broker.rb,
lib/rails-console/config.rb,
lib/rails-console/engine.rb,
lib/rails-console/logging.rb,
lib/rails-console/version.rb,
lib/rails-console/pty_session.rb,
app/models/rails_console/session.rb,
app/models/rails_console/log_line.rb,
app/channels/rails_console/console_channel.rb,
app/models/rails_console/application_record.rb,
lib/generators/rails_console/install_generator.rb,
app/controllers/rails_console/consoles_controller.rb
Defined Under Namespace
Modules: Logging Classes: ApplicationRecord, Broker, ConsoleChannel, ConsolesController, Engine, InstallGenerator, LogLine, PtySession, Session
Constant Summary collapse
- VERSION =
'0.1.0'
Class Attribute Summary collapse
-
.audit ⇒ Object
Returns the value of attribute audit.
-
.authorize ⇒ Object
Returns the value of attribute authorize.
-
.command ⇒ Object
Returns the value of attribute command.
-
.current_user ⇒ Object
Returns the value of attribute current_user.
-
.idle_timeout ⇒ Object
Returns the value of attribute idle_timeout.
-
.sandbox_command ⇒ Object
Returns the value of attribute sandbox_command.
- .socket_path ⇒ Object
-
.user_class ⇒ Object
Returns the value of attribute user_class.
Class Method Summary collapse
- .authorized?(context) ⇒ Boolean
- .config ⇒ Object
- .configure {|_self| ... } ⇒ Object
- .default_socket_path ⇒ Object
- .user_from(context) ⇒ Object
Class Attribute Details
.audit ⇒ Object
Returns the value of attribute audit.
7 8 9 |
# File 'lib/rails-console/config.rb', line 7 def audit @audit end |
.authorize ⇒ Object
Returns the value of attribute authorize.
7 8 9 |
# File 'lib/rails-console/config.rb', line 7 def @authorize end |
.command ⇒ Object
Returns the value of attribute command.
7 8 9 |
# File 'lib/rails-console/config.rb', line 7 def command @command end |
.current_user ⇒ Object
Returns the value of attribute current_user.
7 8 9 |
# File 'lib/rails-console/config.rb', line 7 def current_user @current_user end |
.idle_timeout ⇒ Object
Returns the value of attribute idle_timeout.
7 8 9 |
# File 'lib/rails-console/config.rb', line 7 def idle_timeout @idle_timeout end |
.sandbox_command ⇒ Object
Returns the value of attribute sandbox_command.
7 8 9 |
# File 'lib/rails-console/config.rb', line 7 def sandbox_command @sandbox_command end |
.socket_path ⇒ Object
29 30 31 |
# File 'lib/rails-console/config.rb', line 29 def socket_path @socket_path || default_socket_path end |
.user_class ⇒ Object
Returns the value of attribute user_class.
7 8 9 |
# File 'lib/rails-console/config.rb', line 7 def user_class @user_class end |
Class Method Details
.authorized?(context) ⇒ Boolean
4 5 6 |
# File 'lib/rails-console/user.rb', line 4 def self.(context) config..call(user_from(context)) end |
.config ⇒ Object
17 18 19 |
# File 'lib/rails-console/config.rb', line 17 def config self end |
.configure {|_self| ... } ⇒ Object
21 22 23 |
# File 'lib/rails-console/config.rb', line 21 def configure yield(self) end |
.default_socket_path ⇒ Object
25 26 27 |
# File 'lib/rails-console/config.rb', line 25 def default_socket_path Rails.root.join('tmp/sockets/rails_console.sock') end |
.user_from(context) ⇒ Object
8 9 10 11 12 |
# File 'lib/rails-console/user.rb', line 8 def self.user_from(context) return context.current_user if context.respond_to?(:current_user) context.env['warden']&.user end |