Class: Jets::Commands::Console

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(environment) ⇒ Console

Returns a new instance of Console.



4
5
6
# File 'lib/jets/commands/console.rb', line 4

def initialize(environment)
  @environment = environment
end

Instance Attribute Details

#environmentObject (readonly)

Returns the value of attribute environment.



2
3
4
# File 'lib/jets/commands/console.rb', line 2

def environment
  @environment
end

Instance Method Details

#runObject



8
9
10
11
12
13
14
15
16
17
# File 'lib/jets/commands/console.rb', line 8

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