lib/boson.rb in boson-0.2.0 vs lib/boson.rb in boson-0.2.1
- old
+ new
@@ -1,13 +1,13 @@
$:.unshift File.dirname(__FILE__) unless $:.include? File.expand_path(File.dirname(__FILE__))
%w{hirb alias}.each {|e| require e }
%w{runner runners/console_runner repo manager loader inspector library}.each {|e| require "boson/#{e}" }
%w{argument method comment}.each {|e| require "boson/inspectors/#{e}_inspector" }
# order of library subclasses matters
-%w{module file gem require}.each {|e| require "boson/libraries/#{e}_library" }
+%w{module file gem require local_file}.each {|e| require "boson/libraries/#{e}_library" }
(%w{namespace view command util commands option_parser options} +
- %w{index scientist}).each {|e| require "boson/#{e}" }
+ %w{index repo_index scientist option_command pipe}).each {|e| require "boson/#{e}" }
# This module stores the libraries, commands, repos and main object used throughout Boson.
#
# Useful documentation links:
# * Boson::BinRunner - Runs the boson executable
@@ -15,11 +15,10 @@
# * Boson::Repo.config - Explains main config file
# * Boson::Library - All about libraries
# * Boson::FileLibrary - Explains creating libraries as files
# * Boson::Loader - Explains library module callbacks
# * Boson::OptionParser - All about options
-# * Boson::Scientist - Explains how commands can be both shell-commands and normal ruby methods
module Boson
# Module which is extended by Boson.main_object to give it command functionality.
module Universe; include Commands::Namespace; end
extend self
# The object which holds and executes all command functionality
@@ -43,16 +42,17 @@
end
# An optional local repository which defaults to ./lib/boson or ./.boson.
def local_repo
@local_repo ||= begin
+ ignored_dirs = (repo.config[:ignore_directories] || []).map {|e| File.expand_path(e) }
dir = ["lib/boson", ".boson"].find {|e| File.directory?(e) &&
- File.expand_path(e) != repo.dir }
+ File.expand_path(e) != repo.dir && !ignored_dirs.include?(File.expand_path('.')) }
Repo.new(dir) if dir
end
end
- # The array of loaded repositories
+ # The array of loaded repositories containing the main repo and a possible local repo
def repos
@repos ||= [repo, local_repo].compact
end
def main_object=(value) #:nodoc:
\ No newline at end of file