Class: Jets::Command::Console

Inherits:
Object
  • Object
show all
Defined in:
lib/jets/commands/console/console_command.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(environment) ⇒ Console

Returns a new instance of Console.



22
23
24
# File 'lib/jets/commands/console/console_command.rb', line 22

def initialize(environment)
  @environment = environment
end

Instance Attribute Details

#environmentObject (readonly)

Returns the value of attribute environment.



20
21
22
# File 'lib/jets/commands/console/console_command.rb', line 20

def environment
  @environment
end

Instance Method Details

#runObject



26
27
28
29
30
31
32
33
34
35
# File 'lib/jets/commands/console/console_command.rb', line 26

def run
  puts Jets::Booter.message

  # Thanks: https://mutelight.org/bin-console
  require "irb"
  require "irb/completion"

  ARGV.clear # https://stackoverflow.com/questions/33070092/irb-start-not-starting/33136762
  IRB.start
end