Class: Hanami::Commands::Console Private

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

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

REPL that supports different engines.

It is run with:

`bundle exec hanami console`

Since:

  • 0.1.0

Defined Under Namespace

Modules: CodeReloading

Constant Summary collapse

ENGINES =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Supported engines

Since:

  • 0.2.0

{
  'pry'  => 'Pry',
  'ripl' => 'Ripl',
  'irb'  => 'IRB'
}.freeze
DEFAULT_ENGINE =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0

['irb'].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Command

inherited

Constructor Details

#initialize(options) ⇒ Console

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Console

Parameters:

  • options (Hash)

    Environment's options

See Also:

Since:

  • 0.1.0


46
47
48
49
50
# File 'lib/hanami/commands/console.rb', line 46

def initialize(options)
  super(options)

  @options = @environment.to_options
end

Instance Attribute Details

#optionsObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0


40
41
42
# File 'lib/hanami/commands/console.rb', line 40

def options
  @options
end

Instance Method Details

#engineObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0


60
61
62
# File 'lib/hanami/commands/console.rb', line 60

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

#startObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0


53
54
55
56
# File 'lib/hanami/commands/console.rb', line 53

def start
  prepare
  engine.start
end