Class: Sails::Console

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app_path) ⇒ Console


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

def initialize(app_path)
  @app_path = app_path
end

Class Method Details

.start(app_path) ⇒ Object


24
25
26
# File 'lib/sails/console.rb', line 24

def start(app_path)
  new(app_path).start
end

Instance Method Details

#startObject


33
34
35
36
37
38
39
40
41
42
# File 'lib/sails/console.rb', line 33

def start
  puts "Loading #{Sails.env} environment (Sails #{Sails.version})"
  IRB.conf[:IRB_NAME] = "Sails console"
  require @app_path
  ARGV.clear
  if defined?(IRB::ExtendCommandBundle)
    IRB::ExtendCommandBundle.send :include, Sails::ConsoleMethods
  end
  IRB.start
end