Sha256: ce235dccf1fafb05534c3e6952c9606a63e1eb5cc32002c24642fe01b0bf6ca8

Contents?: true

Size: 992 Bytes

Versions: 1

Compression:

Stored size: 992 Bytes

Contents

= Library Instances

To demonstrate the Library instance, we first need to load the Library library ;)

  require 'roll/library'

A Library class can be initialized given the location of the "project".

  tryme10 = Roll::Library.new('../fixtures/tryme/1.0')
  tryme11 = Roll::Library.new('../fixtures/tryme/1.1')

With a library instance in hand we can query it for primary information, or
metadata, about itself.

  tryme10.name.assert == "tryme"
  tryme11.name.assert == "tryme"

  tryme10.version.to_s.assert == "1.0"
  tryme11.version.to_s.assert == "1.1"

Secondary and arbitrary information can be queried vie the #metadata method.

  tryme10.metadata.homepage.assert == "http://proutils.github.com/roll/"
  tryme11.metadata.homepage.assert == "http://proutils.github.com/roll/"

Of course, the most important function of a library is to load/require a file.

  tryme10.load('tryme.rb')
  $message.assert == "Try Me v1.0"

  tryme11.load('tryme.rb')
  $message.assert == "Try Me v1.1"

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
roll-1.1.0 test/demonstrations/01_library.rdoc