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
Methods included from OS
Constructor Details
Instance Attribute Details
#distribution_name ⇒ Object
The name prefix of the distribution file.
25 26 27 |
# File 'lib/rubbr/viewer.rb', line 25 def distribution_name @distribution_name end |
Instance Method Details
#distribution_file ⇒ Object
27 28 29 30 |
# File 'lib/rubbr/viewer.rb', line 27 def distribution_file File.join(Rubbr.[:distribution_dir], "#@distribution_name.#@view_name") end |
#find_viewer ⇒ Object
39 40 41 42 43 |
# File 'lib/rubbr/viewer.rb', line 39 def find_viewer @executables.each do |executable| return executable if executable? executable end end |
#launch ⇒ Object
45 46 47 48 49 50 |
# File 'lib/rubbr/viewer.rb', line 45 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 |