class Rouge::FileReader
Attributes
Public Class Methods
Public Instance Methods
Source
# File lib/rouge/cli.rb, line 15 def file case input when '-' IO.new($stdin.fileno, 'rt:bom|utf-8') when String File.new(input, 'rt:bom|utf-8') when ->(i){ i.respond_to? :read } input end end
Source
# File lib/rouge/cli.rb, line 26 def read @read ||= begin file.read rescue => e $stderr.puts "unable to open #{input}: #{e.message}" exit 1 ensure file.close end end