class Dauphin::Runtime

Attributes

path[R]

Public Class Methods

new(exepath=nil) click to toggle source
# File lib/dauphin/runtime.rb, line 7
def initialize(exepath=nil)
  puts "Making new Runtime(#{self.inspect}), path: #{exepath.inspect}"
  @path = exepath || default_executable_path
  puts "default_executable_path: #{path}"
  puts "Path: #{@path}"
  check_for_binary
end

Public Instance Methods

check_for_binary() click to toggle source
# File lib/dauphin/runtime.rb, line 15
def check_for_binary
  raise 'Cannot find prince command-line app in $PATH' if !path || path.length == 0
  raise "Cannot run executable at #{path}" unless File.executable? path
end
default_executable_path() click to toggle source
# File lib/dauphin/runtime.rb, line 20
def default_executable_path
  if Platform.windows?
    return 'C:/Program Files/Prince/Engine/bin/prince'
  end
  if Platform.linux?
    `which prince`.chomp
  end
end
join(options) click to toggle source
# File lib/dauphin/runtime.rb, line 29
def join(options)
  ([@path] + Array(options)).join(' ')
end