Sha256: 06853c3f7ce62adadc8f254dde101df840842973591c0a727553e9167ea405cd

Contents?: true

Size: 588 Bytes

Versions: 1

Compression:

Stored size: 588 Bytes

Contents

require 'bundler'
require 'whimsy/asf/config'

#
# modify bundler to be aware of whimsy library overrides
#
module Bundler
  class Dsl
    bundler_gem = instance_method(:gem)
    libs = ASF::Config.get(:lib)

    define_method :gem do |name, *args|
      pname = name.gsub('-', '/')

      path = nil
      libs.each do |lib|
	 if File.exist?("#{lib}/#{pname}")
	   path = lib
	 end
      end

      if path
	args.push({}) unless args.last.is_a?(Hash)
	args.last[:path] = File.dirname(path)
      end

      bundler_gem.bind(self).(name, *args)
    end
  end
end

require 'bundler/setup'

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
whimsy-asf-0.0.69 lib/whimsy/asf/bundler.rb