Method: Herdic::Client#initialize

Defined in:
lib/herdic/client.rb

#initialize(file, options) ⇒ Client

Returns a new instance of Client.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/herdic/client.rb', line 17

def initialize(file, options)
  @file, @options = file, options

  @context = binding

  @config_file = @options['c'] || Util.find_files_upward(Herdic.config_filename, Herdic.pwd, 1)[0]
  load_config @config_file if @config_file

  @printer = Printer.new @options
  @printer.start_message @config_file

  @store    = Store.new @config_file
  @registry = @store.data
  @cookie   = (@registry[:_cookie] ||= {})
end