Sha256: ed1e93ef5f95a7e3c6bbca05e90ae8bd267364033ebebe4e9101df3258657eb1

Contents?: true

Size: 710 Bytes

Versions: 4

Compression:

Stored size: 710 Bytes

Contents

module Bixby
  module Script
    module Bundle

      # Load the libraries for the given bundle. Searches all available
      # repositories.
      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

    end # Bundle
  end # Script
end # Bixby

module Bixby
  # Bixby.use_bundle
  extend Bixby::Script::Bundle
end

class Object
  # naked use_bundle "foo" in scripts
  include Bixby::Script::Bundle
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
bixby-client-0.5.3 lib/bixby-client/script/bundle.rb
bixby-client-0.5.2 lib/bixby-client/script/bundle.rb
bixby-client-0.5.1 lib/bixby-client/script/bundle.rb
bixby-client-0.5.0 lib/bixby-client/script/bundle.rb