Class: Boson::LocalFileLibrary

Inherits:
FileLibrary show all
Defined in:
lib/boson/libraries/local_file_library.rb

Overview

This class loads any local file and is most commonly used to load a local Bosonfile. Since this file doesn’t exist inside a normal Repo, it is not indexed with any repo. Since file-based libraries need to be associated with a repository, Boson associates it with a local repository if it exists or defaults to Boson.repo. See Boson::FileLibrary for more info about this library.

Example:

>> load_library 'Bosonfile'
=> true

Constant Summary

Constants inherited from Library

Boson::Library::ATTRIBUTES

Instance Attribute Summary

Attributes inherited from Library

#class_commands, #lib_file, #namespace, #new_commands, #new_module, #no_alias_creation, #repo_dir

Instance Method Summary collapse

Methods inherited from FileLibrary

#create_module_from_path, #determine_lib_module, library_file, #load_source, #load_source_and_set_module, matched_repo, read_library_file, reset_file_cache, #set_repo

Methods inherited from Library

#clean_name, #command_object, #command_objects, handles, #initialize, #library_type, #local?, #marshal_dump, #marshal_load, #namespace_object, #set_attributes, #set_command_aliases, #set_config, #set_repo

Methods included from Loader

#check_for_method_conflicts, #detect_additions, #include_in_universe, #initialize_library_module, #load, #load_module_commands, #load_source_and_set_module, #loaded_correctly?, #module_callbacks, #set_library_commands

Constructor Details

This class inherits a constructor from Boson::Library

Instance Method Details

#base_moduleObject



22
23
24
# File 'lib/boson/libraries/local_file_library.rb', line 22

def base_module
  Boson::Commands
end

#library_fileObject



26
27
28
# File 'lib/boson/libraries/local_file_library.rb', line 26

def library_file
  @lib_file
end

#set_name(name) ⇒ Object

:stopdoc:



17
18
19
20
# File 'lib/boson/libraries/local_file_library.rb', line 17

def set_name(name)
  @lib_file = File.expand_path(name.to_s)
  File.basename(@lib_file).downcase
end