class Nand::Launcher::ExecutableFileLauncher
Attributes
name[R]
Public Class Methods
exec_file(target)
click to toggle source
# File lib/nand/launcher/executable_file_launcher.rb, line 20 def self.exec_file(target) Pathname.new(target).expand_path end
launchable?(target, io, opts)
click to toggle source
# File lib/nand/launcher/executable_file_launcher.rb, line 7 def self.launchable?(target, io, opts) file = exec_file(target) raise "Not Found #{file.to_s}" unless file.exist? raise "Not Executable #{file.to_s}" unless file.executable? true rescue => e io.puts "\t- " + e.message false end
load(target, opts = {}, *argv)
click to toggle source
# File lib/nand/launcher/executable_file_launcher.rb, line 16 def self.load(target, opts = {}, *argv) file = exec_file(target) new(target, opts, *argv) end
new(target, opts, *argv)
click to toggle source
Calls superclass method
# File lib/nand/launcher/executable_file_launcher.rb, line 24 def initialize(target, opts, *argv) super(target, opts, *argv) @file = self.class.exec_file(target) @name = opts[:name] || @file.basename.to_s end
Public Instance Methods
cmd()
click to toggle source
# File lib/nand/launcher/executable_file_launcher.rb, line 29 def cmd; "#{@file} #{@argv.join(" ")}" end