Class: Boson::RequireLibrary

Inherits:
GemLibrary show all
Defined in:
lib/boson/libraries/require_library.rb

Overview

This library requires the given name. This is useful for loading standard libraries, non-gem libraries (i.e. rip packages) and anything else in $LOAD_PATH.

Example:

>> load_library 'fileutils', :class_commands=>{'cd'=>'FileUtils.cd', 'cp'=>'FileUtils.cp'}
=> true
>> cd '/home'
=> 0
>> Dir.pwd
>> '/home'

Constant Summary collapse

EXTENSIONS =
['', '.rb', '.rbw', '.so', '.bundle', '.dll', '.sl', '.jar']

Constants inherited from Library

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 GemLibrary

is_a_gem?, #load_source_and_set_module

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_name, #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, #module_callbacks, #set_library_commands

Constructor Details

This class inherits a constructor from Boson::Library

Instance Method Details

#loaded_correctly?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/boson/libraries/require_library.rb', line 20

def loaded_correctly?
  super || $".grep(/^#{@name}\.([a-z]+)?$/).size > 0
end