libraggi's subload-1.1.0 Documentation

DESCRIPTION:

A handy dandy autoload / require / load helper for your rubies. Similar to using[1], but with a few differences of opinion, and a bit shorter.

Basically, expand path is fine, up until a point. Sometimes there’s no point (i.e. when the load path already contains most of the path you’re trying to open). When you’re writing libs that users might require sub parts with ‘libname/sub_part’, then expand_path combined with say, rubygems, can lead to double requires. Lets not do that. :-)

1
github.com/smtlaissezfaire/using/

FEATURES/PROBLEMS:

SYNOPSIS:

  module A

    # The nominal use case, A.autoload :B, 'a/b'
    # You rarely need much else!
    subload :B

    # A custom path, A.autoload :C, 'a/c'
    subload :C, :path => 'a/c'
    # For example when 'a/c' defines several constants:
    subload :Ca, :path => 'a/c'
    subload :Cb, :path => 'a/c'

    # An expanded path, A.autoload :D, File.join(Dir.pwd, 'a/d')
    subload :D, :expand_path => true
    # This has interesting uses in combination, although not generally
    # recommended:
    subload :E, :path => '../../path/e', :expand_path => true

    # Explicitly override the mode, for this call only, A.require 'a/f'
    subload :F, :mode => :require

    # Set the mode for all subsiquent calls to subload in this class/module
    subload_with :require
    subload :G # => require 'a/g'
    subload :H # => require 'a/h'

    # Other features intended for library and framework developers are described
    # in the class documentation.

  end

REQUIREMENTS:

INSTALL:

LICENSE:

(The MIT License)

Copyright © 2010 James Tucker

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Files

Classes/Modules

Methods

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.