Class: Cwb::FileParser

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

Instance Method Summary collapse

Methods inherited from Parser

#benchmark_suite, #execute, #init_config

Constructor Details

#initialize(path) ⇒ FileParser

Returns a new instance of FileParser.



5
6
7
8
9
# File 'lib/cwb/file_parser.rb', line 5

def initialize(path)
  super(path)
  init_config(parent_dir)
  init_config(working_dir)
end

Instance Method Details

#delegate_executionObject



11
12
13
14
15
16
# File 'lib/cwb/file_parser.rb', line 11

def delegate_execution
  filename = File.basename(@path, ".rb")
  class_name = filename.camelize
  cwb_benchmark = Cwb.const_get(class_name).new(working_dir)
  benchmark_suite.execute_suite([cwb_benchmark])
end

#validateObject



18
19
20
21
# File 'lib/cwb/file_parser.rb', line 18

def validate
  check_file_exists(@path)
  require @path
end