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
#initialize ⇒ Base
Returns a new instance of Base.
31 32 33 34 35 36 |
# File 'lib/rubbr/viewer.rb', line 31 def initialize @distribution_name = Rubbr.[:distribution_name] @view_name = 'base' @executables = [] end |
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.options[:distribution_dir]}" end |