2015/common.rb

12 lines
220 B
Ruby

class Input
FILE = 'input'
def initialize(directory, file = nil)
@filename = "#{directory}/#{file || FILE}"
end
def readlines
File.readlines(@filename).reject { |line| line.start_with?('#') }
end
end