module Bixby::Script::Bundle

Public Instance Methods

use_bundle(name) click to toggle source

Load the libraries for the given bundle. Searches all available repositories.

# File lib/bixby-client/script/bundle.rb, line 8
def use_bundle(name)
  repos = Dir.glob(File.join(Bixby.repo_path, "*"))
  repos.each do |repo|
    next if not File.directory? repo

    lib = File.join(repo, name, "lib")
    $: << lib
    if File.directory? lib then
      Dir.glob(File.join(lib, "*.rb")).each{ |f| require f }
    end
  end
end