Class: Tzispa::Commands::Console

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

Constant Summary collapse

ENGINES =
{
  'pry'  => 'Pry',
  'irb'  => 'IRB'
}.freeze
DEFAULT_ENGINE =
['irb'].freeze

Constants inherited from Command

Tzispa::Commands::Command::NO_PROJECT_FOLDER

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Console

Returns a new instance of Console.



18
19
20
21
22
# File 'lib/tzispa/commands/console.rb', line 18

def initialize(options)
  super(options)

  @options = Tzispa::Environment.instance.to_options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



16
17
18
# File 'lib/tzispa/commands/console.rb', line 16

def options
  @options
end

Instance Method Details

#engineObject



29
30
31
# File 'lib/tzispa/commands/console.rb', line 29

def engine
  load_engine options.fetch(:engine) { engine_lookup }
end

#startObject



24
25
26
27
# File 'lib/tzispa/commands/console.rb', line 24

def start
  prepare
  engine.start
end