Method: SparkApi::CLI::ConsoleCLI.execute

Defined in:
lib/spark_api/cli.rb

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



37
38
39
40
41
42
43
44
45
46
47
# File 'lib/spark_api/cli.rb', line 37

def self.execute(stdout, arguments=[])
  options = setup_options(stdout,arguments)
  libs =  " -r irb/completion"
  # Perhaps use a console_lib to store any extra methods I may want available in the cosole
  libs << (options[:oauth2] ? setup_oauth2 : setup_api_auth)
  
  bundler = (options[:console] ? "bundle exec" : "")  
  cmd = "#{export_env(options)} #{bundler} #{irb} #{libs} --simple-prompt"
  puts "Loading spark_api gem..."
  exec "#{cmd}"
end