Sha256: 57e7966fde5f61d995a2b4b62ad50e62ff1c8893b78c46af9abbbec283b1a1ab

Contents?: true

Size: 1.33 KB

Versions: 1

Compression:

Stored size: 1.33 KB

Contents

= Bezel

First Bezel must be loaded. This has been done via the applique.
It will also load RubyGems as Bezel currently uses the +Gem.path+ 
to locate Ruby libraries. We also use a dummy Gem location for
this example (see +fixtures+).

Now we can try it out. The dummy gem location houses two libraries
of the same name but different versions.

  module Example1
    TryMe = lib('tryme', '1.0')
  end

TryMe has a class method called #report and we should see that
it works as expected.

  Example1::TryMe.report.assert == "You are using version 1.0!"

It also imports a method called #extra from a seperate file.

  Example1::TryMe.extra.assert == "Something extra from version 1.0!"

Now we should be able to do the same for TryMe v1.1 without any
issues of interference between the two versions.

  module Example2
    TryMe = lib('tryme', '1.1')
  end

Again we should see that the #report method works as expected, but this
time reported form the new version.

  Example2::TryMe.report.assert == "You are using version 1.1!"

And that it also imports a method called #extra from a seperate file.

  Example2::TryMe.extra.assert == "Something extra from version 1.1!"

Just to be sure, let try v1.0 again.

  Example1::TryMe.report.assert == "You are using version 1.0!"
  Example1::TryMe.extra.assert == "Something extra from version 1.0!"

That's all folks!

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bezel-0.2.0 demo/01_example.rdoc