summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgeemus <geemus@gmail.com>2012-03-06 15:57:41 -0800
committergeemus <geemus@gmail.com>2012-03-06 15:57:41 -0800
commit047444cf3b841a9aef0696565781fe0bf1b38c1d (patch)
treefd4cfbb532c5c54cde1071af6b07fd6ed0d19c2b
parent5245b3419e3827d536f1ba2d81ad2ee15ce8c8bf (diff)
downloadbundler-047444cf3b841a9aef0696565781fe0bf1b38c1d.tar.gz
prevent duplicate sources
-rw-r--r--lib/bundler/dsl.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/bundler/dsl.rb b/lib/bundler/dsl.rb
index 7bf03cfd8c..f62cf03ee9 100644
--- a/lib/bundler/dsl.rb
+++ b/lib/bundler/dsl.rb
@@ -104,7 +104,11 @@ module Bundler
return
else
@source = source
- options[:prepend] ? @sources.unshift(@source) : @sources << @source
+ if options[:prepend]
+ @sources = [@source] | @sources
+ else
+ @sources = @sources | [@source]
+ end
yield if block_given?
return @source