Class: ESM::Command::Development::Eval
- Inherits:
-
ApplicationCommand
- Object
- Base
- ApplicationCommand
- ESM::Command::Development::Eval
- Defined in:
- lib/esm/command/development/eval.rb
Instance Method Summary collapse
-
#on_execute ⇒ Object
lmao, the amount of rubocop disables in this one method.
Instance Method Details
#on_execute ⇒ Object
lmao, the amount of rubocop disables in this one method
35 36 37 38 39 40 41 42 43 |
# File 'lib/esm/command/development/eval.rb', line 35 def on_execute code = arguments.code return binding.pry if code == "bd" && ESM.env.development? # rubocop:disable Lint/Debugger response = eval arguments.code # rubocop:disable Security/Eval reply("Input:\n```ruby\n#{arguments.code}\n```\nOutput:\n```ruby\n#{response.ai(plain: true, index: false)}\n```") # rubocop:disable Rails/Output rescue => e reply("An error occurred: ```#{e.}```Backtrace: ```#{e.backtrace[0..2].join("\n")}```") end |