Class: File

Inherits:
Object
  • Object
show all
Defined in:
ext/encoding/character/utf-8/data/generate-unicode-data.rb

Class Method Summary collapse

Class Method Details

.process(path) ⇒ Object



31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'ext/encoding/character/utf-8/data/generate-unicode-data.rb', line 31

def self.process(path)
  begin
    File.open(path) do |file|
	file.each_line do |line|
 next if line =~ /^(#|\s*$)/
 yield line
	end
    end
  rescue IOError => e
    error("I/O error while processing input:\n" +
   "    file: %s\n" +
   "    error: %s\n", path, e.message)
  end
end