Class: Alx::Viewer
Instance Method Summary collapse
-
#initialize(conf) ⇒ Viewer
constructor
A new instance of Viewer.
- #view(file_name) ⇒ Object
Methods included from Executer
Constructor Details
#initialize(conf) ⇒ Viewer
Returns a new instance of Viewer.
6 7 8 |
# File 'lib/alx/viewer.rb', line 6 def initialize( conf ) @conf = conf end |
Instance Method Details
#view(file_name) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/alx/viewer.rb', line 10 def view( file_name ) if @conf[ :stdout ] File.open( file_name ) do | file | while line = file.gets $stdout.puts line end end return true end if @conf[ :html ] start( @conf[ :html_viewer ] + " " + file_name ) return true end start( @conf[ :terminal_viewer ] + " " + file_name ) end |