提交 018ba277 编写于 作者: J Jeremy Kemper

Skip addition to load path if an externally-provided lib is already in place....

Skip addition to load path if an externally-provided lib is already in place. Just to keep the path shorter.
上级 0bd6e933
......@@ -4,7 +4,10 @@
gem lib, "~> #{version}"
# Use the vendored lib if the gem's missing or we aren't using RubyGems.
rescue LoadError, NoMethodError
# Push, not unshift, so the vendored lib is lowest priority.
$LOAD_PATH << File.expand_path("#{File.dirname(__FILE__)}/vendor/#{lib}-#{version}/lib")
# Skip if there's already a vendored lib already provided.
if $LOAD_PATH.grep(Regexp.new(lib)).empty?
# Push, not unshift, so the vendored lib is lowest priority.
$LOAD_PATH << File.expand_path("#{File.dirname(__FILE__)}/vendor/#{lib}-#{version}/lib")
end
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册