Class: Splunker::CLI::ConsoleCLI

Inherits:
Object
  • Object
show all
Defined in:
lib/splunker/cli.rb

Constant Summary collapse

OPTIONS_ENV =
{
  :debug=> "DEBUG",
  :console => "SPLUNKER_CONSOLE"
}

Class Method Summary collapse

Class Method Details

.execute(stdout, arguments = []) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
# File 'lib/splunker/cli.rb', line 22

def self.execute(stdout, arguments=[])
  options = setup_options(stdout,arguments)

  libs =  " -r irb/completion"
  setup = " -r #{File.dirname(__FILE__) + '/../../lib/splunker/cli/setup.rb'}"

  bundler = (options[:console] ? "bundle exec" : "")  
  cmd = "#{export_env(options)} #{bundler} #{irb} #{libs} #{setup} --simple-prompt"
  puts "Loading splunker gem..."
  exec "#{cmd}"
end

.irbObject



34
35
36
# File 'lib/splunker/cli.rb', line 34

def self.irb()
  RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
end