Method: Library.activate

Defined in:
lib/library.rb

.activate(name, constraint = nil) {|library| ... } ⇒ Library

Activate a library. Same as #instance but will raise and error if the library is not found. This can also take a block to yield on the library.

Parameters:

  • name (String)

    Name of library.

  • constraint (String) (defaults to: nil)

    Valid version constraint.

Yields:

  • (library)

Returns:

  • (Library)

    The activated Library object.

Raises:



84
85
86
87
88
# File 'lib/library.rb', line 84

def self.activate(name, constraint=nil) #:yield:
  library = $LEDGER.activate(name, constraint)
  yield(library) if block_given?
  library
end