Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

rubygems mirror obey bundler config

  • Loading branch information...
commit 82374aca1fe844e92c55d05b62c3831d9749190a 1 parent d938938
@mkristian authored
Showing with 17 additions and 6 deletions.
  1. +17 −6 bin/jbundle
View
23 bin/jbundle
@@ -20,12 +20,22 @@ else
require 'jbundler/config'
config = JBundler::Config.new
begin
- if config.rubygems_mirror
- ENV['BUNDLE_MIRROR__HTTP://RUBYGEMS.ORG'] = config.rubygems_mirror
- ENV['BUNDLE_MIRROR__HTTPS://RUBYGEMS.ORG'] = config.rubygems_mirror
-
+ require 'yaml'
+ bundle_config = YAML.load_file( File.join( ENV['HOME'],
+ '.bundle',
+ 'config' ) )
+ mirrors = bundle_config.select { |k,v| nil != (k =~ /BUNDLE_MIRROR__/) }
+ if config.rubygems_mirror || mirrors.size > 0
+ mirrors.each do |k,v|
+ ENV[ k ] = v
+ end
+ if config.rubygems_mirror
+ ENV['BUNDLE_MIRROR__HTTP://RUBYGEMS.ORG'] = config.rubygems_mirror
+ ENV['BUNDLE_MIRROR__HTTPS://RUBYGEMS.ORG'] = config.rubygems_mirror
+ end
+
begin
- load Gem.bin_path('nexuss', 'nbundle')
+ load Gem.bin_path('nexus', 'nbundle')
rescue Gem::GemNotFoundException
warn ''
warn 'to use a rubygems mirror you need to install the nexus gem'
@@ -33,8 +43,9 @@ else
warn ''
warn 'rubygems mirror ignored !'
end
+ else
+ load Gem.bin_path('bundler', 'bundle')
end
- load Gem.bin_path('bundler', 'bundle')
rescue Exception
if ARGV[0] == 'console'
ARGV.shift
Please sign in to comment.
Something went wrong with that request. Please try again.