Method: Elasticshell::Shell#initialize

Defined in:
lib/elasticshell/shell.rb

#initialize(options = {}) ⇒ Shell



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/elasticshell/shell.rb', line 85

def initialize options={}
  @interactive = false
  self.state  = :init
  self.client = Client.new(options)
  self.cache  = {}
  @initial_servers = (options[:servers] || [])
  self.verb   = (options[:verb] || 'GET')
  self.scope  = scope_from_path(options[:scope] || '/')
  self.only   = options[:only]
  self.ruby_code = options[:eval]
  self.input_stream  = (options[:input]  || $stdin)
  self.output = (options[:output] || $stdout)
  self.line   = 0
  @log_requests = (options[:log_requests] == false ? false : true)
  pretty! if options[:pretty]
end