Module: Launchy
- Defined in:
- lib/gems/launchy-0.3.2/lib/launchy/gemspec.rb,
lib/gems/launchy-0.3.2/lib/launchy.rb,
lib/gems/launchy-0.3.2/lib/launchy/browser.rb,
lib/gems/launchy-0.3.2/lib/launchy/version.rb,
lib/gems/launchy-0.3.2/lib/launchy/application.rb,
lib/gems/launchy-0.3.2/lib/launchy/command_line.rb,
lib/gems/launchy-0.3.2/lib/launchy/specification.rb
Overview
The Gem Specification plus some extras for launchy.
Defined Under Namespace
Classes: Application, Browser, CommandLine, Specification, Version
Constant Summary collapse
- ROOT_DIR =
File.(File.join(File.dirname(__FILE__),".."))
- LIB_DIR =
File.join(ROOT_DIR,"lib").freeze
- RESOURCE_DIR =
File.join(ROOT_DIR,"resources").freeze
- SPEC =
Launchy::Specification.new do |spec| spec.name = "launchy" spec.version = Launchy::VERSION spec.rubyforge_project = "copiousfreetime" spec. = "Jeremy Hinegardner" spec.email = "[email protected]" spec.homepage = "http://copiousfreetime.rubyforge.org/launchy/" spec.summary = "A helper to launch apps from within ruby programs." spec.description = <<-DESC Launchy is helper class for launching cross-platform applications in a fire and forget manner. There are application concepts (browser, email client, etc) that are common across all platforms, and they may be launched differently on each platform. Launchy is here to make a common approach to launching external application from within ruby programs. DESC spec.extra_rdoc_files = FileList["CHANGES", "LICENSE", "README"] spec.has_rdoc = true spec.rdoc_main = "README" spec. = [ "--line-numbers" , "--inline-source" ] spec.test_files = FileList["spec/**/*.rb", "test/**/*.rb"] spec.files = spec.test_files + spec.extra_rdoc_files + FileList["lib/**/*.rb", "resources/**/*"] spec.executable = spec.name spec.platform = Gem::Platform::RUBY spec.required_ruby_version = ">= 1.8.5" spec.local_rdoc_dir = "doc/rdoc" spec.remote_rdoc_dir = "" spec.local_coverage_dir = "doc/coverage" spec.remote_coverage_dir= "coverage" spec.remote_user = "jjh" spec.remote_site_dir = "#{spec.name}/" end
- VERSION =
Version.to_s
Class Method Summary collapse
-
.command_line ⇒ Object
Create an instance of the commandline application of launchy.
-
.log(msg) ⇒ Object
Setting the LAUNCHY_DEBUG environment variable to ‘true’ will spew debug information to $stderr.
- .open(*params) ⇒ Object
-
.require_all_libs_relative_to(fname) ⇒ Object
Utility method to require all files ending in .rb in the directory with the same name as this file minus .rb.
Class Method Details
.command_line ⇒ Object
Create an instance of the commandline application of launchy
50 51 52 |
# File 'lib/gems/launchy-0.3.2/lib/launchy.rb', line 50 def command_line Launchy::CommandLine.new end |
.log(msg) ⇒ Object
Setting the LAUNCHY_DEBUG environment variable to ‘true’ will spew debug information to $stderr
43 44 45 46 47 |
# File 'lib/gems/launchy-0.3.2/lib/launchy.rb', line 43 def log(msg) if ENV['LAUNCHY_DEBUG'] == 'true' then $stderr.puts "LAUNCHY_DEBUG: #{msg}" end end |
.open(*params) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/gems/launchy-0.3.2/lib/launchy.rb', line 24 def open(*params) begin klass = Launchy::Application.find_application_class_for(*params) if klass then klass.run(*params) else msg = "Unable to launch #{params.join(' ')}" Launchy.log "#{self.name} : #{msg}" $stderr.puts msg end rescue Exception => e msg = "Failure in opening #{params.join(' ')} : #{e}" Launchy.log "#{self.name} : #{msg}" $stderr.puts msg end end |
.require_all_libs_relative_to(fname) ⇒ Object
Utility method to require all files ending in .rb in the directory with the same name as this file minus .rb
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/gems/launchy-0.3.2/lib/launchy.rb', line 11 def require_all_libs_relative_to(fname) prepend = File.basename(fname,".rb") search_me = File.join(File.dirname(fname),prepend) Dir.entries(search_me).each do |rb| if File.extname(rb) == ".rb" then require "#{prepend}/#{File.basename(rb,".rb")}" end end end |