Object
Application is the base class of all the application types that launchy may invoke. It essentially defines the public api of the launchy system.
Every class that inherits from Application must define:
A constructor taking no parameters
An instance method ‘open’ taking a string or URI as the first parameter and a hash as the second
A class method ‘handles?’ that takes a String and returns true if that class can handle the input.
Find the given executable in the available paths
# File lib/launchy/application.rb, line 29 29: def find_executable( bin, *paths ) 30: paths = ENV['PATH'].split( File::PATH_SEPARATOR ) if paths.empty? 31: paths.each do |path| 32: file = File.join( path, bin ) 33: if File.executable?( file ) then 34: Launchy.log "#{self.name} : found executable #{file}" 35: return file 36: end 37: end 38: Launchy.log "#{self.name} : Unable to find `#{bin}' in #{paths.join(", ")}" 39: return nil 40: end
Find the application that handles the given uri.
returns the Class that can handle the uri
# File lib/launchy/application.rb, line 21 21: def handling( uri ) 22: klass = find_child( :handles?, uri ) 23: return klass if klass 24: raise ApplicationNotFoundError, "No application found to handle '#{uri}'" 25: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.