Class: Volt::Console

Inherits:
Object show all
Defined in:
lib/volt/cli/console.rb

Defined Under Namespace

Modules: Helpers

Class Method Summary collapse

Class Method Details

.start ⇒ Object



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/volt/cli/console.rb', line 63

def self.start
  require 'pry'

  $LOAD_PATH << 'lib'
  ENV['SERVER'] = 'true'

  require 'volt'
  require 'volt/boot'
  require 'volt/volt/core'
  require 'volt/server/socket_connection_handler_stub'

  # Boot the volt app
  volt_app = Volt.boot(Dir.pwd)

  SocketConnectionHandlerStub.dispatcher = Dispatcher.new(volt_app)

  Pry.config.prompt_name = 'volt'

  Pry.main.instance_variable_set('@volt_app', volt_app)
  Pry.main.send(:include, Volt::Console::Helpers)

  Pry.start
end