class Nand::Launcher::PluginLauncher

Public Class Methods

launchable?( target, io, opts ) click to toggle source
# File lib/nand/launcher/plugin_launcher.rb, line 11
def self.launchable?( target, io, opts )
  specs = Gem::Specification.find_all do |s|
    s.name =~/^(nand-)*#{target}$/ and s.dependencies.find{ |d| d.name == "nand" }
  end
  raise "Not Found #{target} in Installed gems" if specs.empty?
  raise "Target name #{target} is Not Uniq for installed gem" if 1 < specs.size
  require_rb(specs.first.name)
  true
rescue LoadError => e
  io.puts "\t- " + e.message
  false
rescue => e
  io.puts "\t- " + e.message
  false
end
require_rb(target) click to toggle source
# File lib/nand/launcher/plugin_launcher.rb, line 8
def self.require_rb(target)
  require "#{target}/nand/plugin"
end