Sha256: 99de5216229e79d8048f9496a651b4a7f091c46e9b15d3378106e7bd1f1b83d6

Contents?: true

Size: 589 Bytes

Versions: 1

Compression:

Stored size: 589 Bytes

Contents

= Plugin Demonstrandum

To use the Plugin library first we need to require it.

  require 'plugin'

Now use +Plugin.find+ to seach for a file pattern of our
choosing within the +plugins+ loadpath.

  files = Plugin.find('example.rb')
  file  = files.first

The +find+ method returns full path names.

  File.expand_path(file).assert == file
  file.assert.ends_with?('plugins/example.rb')

As with any Ruby script we can require it.

  require file

Our example.rb script defines the global variable $proof.
We can see that it loaded just fine.

  $proof.assert == "plugin loading worked"

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
plugin-1.1 test/demos/usage.rdoc