Class: Cwb::Parser

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

Direct Known Subclasses

DirectoryParser, FileParser

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Parser

Returns a new instance of Parser.



3
4
5
6
# File 'lib/cwb/parser.rb', line 3

def initialize(path)
  @path = File.expand_path(path)
  init_config(@path)
end

Instance Method Details

#benchmark_suiteObject



28
29
30
# File 'lib/cwb/parser.rb', line 28

def benchmark_suite
  Cwb::BenchmarkSuite.new(@path)
end

#delegate_executionObject



24
25
26
# File 'lib/cwb/parser.rb', line 24

def delegate_execution
  fail "Not implemented in abstract base class"
end

#executeObject



15
16
17
18
# File 'lib/cwb/parser.rb', line 15

def execute
  validate
  delegate_execution
end

#init_config(dir) ⇒ Object



8
9
10
11
12
13
# File 'lib/cwb/parser.rb', line 8

def init_config(dir)
  if Cwb::Config.exists_in_dir?(dir)
    config = Cwb::Config.from_dir(dir)
    Cwb::Client.instance.reconfigure(config)
  end
end

#validateObject



20
21
22
# File 'lib/cwb/parser.rb', line 20

def validate
  fail "Not implemented in abstract base class"
end