Class: Phut::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/phut/parser.rb

Overview

Configuration DSL parser.

Instance Method Summary collapse

Constructor Details

#initialize(logger = NullLogger.new) ⇒ Parser

Returns a new instance of Parser.



8
9
10
11
# File 'lib/phut/parser.rb', line 8

def initialize(logger = NullLogger.new)
  @config = Configuration.new(logger)
  @port_number = Hash.new(0)
end

Instance Method Details

#parse(file) ⇒ Object



13
14
15
16
17
18
# File 'lib/phut/parser.rb', line 13

def parse(file)
  Syntax.new(@config).instance_eval IO.read(file), file
  connect_links_to_switches
  connect_links_to_vhosts
  @config
end