class Cucumber::Runtime::NormalisedEncodingFile
Public Class Methods
Source
# File lib/cucumber/runtime.rb, line 158 def initialize(path) @file = File.new(path) set_encoding rescue Errno::EACCES => e raise FileNotFoundException.new(e, File.expand_path(path)) rescue Errno::ENOENT raise FeatureFolderNotFoundException, path end
Public Instance Methods
Private Instance Methods
Source
# File lib/cucumber/runtime.rb, line 173 def set_encoding @file.each do |line| if ENCODING_PATTERN =~ line @file.set_encoding Regexp.last_match(1) break end break unless COMMENT_OR_EMPTY_LINE_PATTERN =~ line end @file.rewind end