class Diakonos::ConfigFile

Attributes

filename[R]
problems[RW]

Public Class Methods

new(filename, including_config_file) click to toggle source
# File lib/diakonos/config-file.rb, line 24
def initialize(filename, including_config_file)
  @filename, @including_config_file = filename, including_config_file
  @problems = []
end

Public Instance Methods

==(other_config_file) click to toggle source
# File lib/diakonos/config-file.rb, line 29
def ==(other_config_file)
  @filename == other_config_file.filename
end
each_line_with_index() { |line, line_number| ... } click to toggle source
# File lib/diakonos/config-file.rb, line 33
def each_line_with_index
  # TODO: Refactor line_number into index, then +1 before yielding
  IO.readlines(@filename).each_with_index do |line, line_number|
    line.chomp!
    # Skip comments
    next  if line[0] == ?#

    yield line, line_number
  end
end