Class: Rubbr::Viewer::Base
Instance Attribute Summary collapse
-
#distribution_name ⇒ Object
The name prefix of the distribution file.
Instance Method Summary collapse
- #distribution_file ⇒ Object
- #find_viewer ⇒ Object
-
#initialize ⇒ Base
constructor
A new instance of Base.
- #launch ⇒ Object
Methods included from Cli
#color?, #disable_stderr, #disable_stdinn, #disable_stdout, #error, #executable?, #notice, #valid_executable, #warning
Constructor Details
Instance Attribute Details
#distribution_name ⇒ Object
The name prefix of the distribution file.
24 25 26 |
# File 'lib/rubbr/viewer.rb', line 24 def distribution_name @distribution_name end |
Instance Method Details
#distribution_file ⇒ Object
26 27 28 29 |
# File 'lib/rubbr/viewer.rb', line 26 def distribution_file File.join(Rubbr.[:distribution_dir], "#@distribution_name.#@view_name") end |
#find_viewer ⇒ Object
38 39 40 41 42 |
# File 'lib/rubbr/viewer.rb', line 38 def find_viewer @executables.each do |executable| return executable if executable? executable end end |
#launch ⇒ Object
44 45 46 47 48 49 |
# File 'lib/rubbr/viewer.rb', line 44 def launch return unless viewer = find_viewer fork { exec "#{viewer} #{distribution_file}" } notice "Display of #@view_name completed for: #{@distribution_name}" + ".#@view_name in #{Rubbr.[:distribution_dir]}" end |