Sha256: 13eb7a22b7c592a8b70b19e019ab54f25db585e11beae133a2a6555353fc911b
Contents?: true
Size: 1.56 KB
Versions: 1
Compression:
Stored size: 1.56 KB
Contents
module Boson # Base class for runners. class Runner class<<self # Enables view, adds local load path and loads default_libraries def init View.enable add_load_path Manager.load default_libraries, load_options end # Libraries that come with Boson def default_libraries [Boson::Commands::Core, Boson::Commands::WebCore] + Boson.repos.map {|e| e.config[:defaults] || [] }.flatten end # Libraries detected in repositories def detected_libraries Boson.repos.map {|e| e.detected_libraries }.flatten.uniq end # Libraries specified in config files and detected_libraries def all_libraries Boson.repos.map {|e| e.all_libraries }.flatten.uniq end #:stopdoc: def add_load_path Boson.repos.each {|repo| if repo.config[:add_load_path] || File.exists?(File.join(repo.dir, 'lib')) $: << File.join(repo.dir, 'lib') unless $:.include? File.expand_path(File.join(repo.dir, 'lib')) end } end def load_options {:verbose=>@options[:verbose]} end def define_autoloader class << ::Boson.main_object def method_missing(method, *args, &block) Boson::Index.read if lib = Boson::Index.find_library(method.to_s) Boson::Manager.load lib, :verbose=>true send(method, *args, &block) if respond_to?(method) else super end end end end #:startdoc: end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
boson-0.2.1 | lib/boson/runner.rb |