aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bundler/cli/config.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bundler/cli/config.rb')
-rw-r--r--lib/bundler/cli/config.rb25
1 files changed, 14 insertions, 11 deletions
diff --git a/lib/bundler/cli/config.rb b/lib/bundler/cli/config.rb
index 8d65e7c8..479e6f8a 100644
--- a/lib/bundler/cli/config.rb
+++ b/lib/bundler/cli/config.rb
@@ -46,26 +46,29 @@ module Bundler
return
end
+ new_value = args.join(" ")
locations = Bundler.settings.locations(name)
if scope == "global"
- if local = locations[:local]
- Bundler.ui.info "Your application has set #{name} to #{local.inspect}. This will override the " \
- "global value you are currently setting"
+ if locations[:local]
+ Bundler.ui.info "Your application has set #{name} to #{locations[:local].inspect}. " \
+ "This will override the global value you are currently setting"
end
- if env = locations[:env]
- Bundler.ui.info "You have a bundler environment variable for #{name} set to #{env.inspect}. " \
- "This will take precedence over the global value you are setting"
+ if locations[:env]
+ Bundler.ui.info "You have a bundler environment variable for #{name} set to " \
+ "#{locations[:env].inspect}. This will take precedence over the global value you are setting"
end
- if global = locations[:global] and global != locations[:global]
- Bundler.ui.info "You are replacing the current global value of #{name}, which is currently #{global.inspect}"
+ if locations[:global] && locations[:global] != new_value
+ Bundler.ui.info "You are replacing the current global value of #{name}, which is currently " \
+ "#{locations[:global].inspect}"
end
end
- if scope == "local" && local = locations[:local]
- Bundler.ui.info "You are replacing the current local value of #{name}, which is currently #{local.inspect}"
+ if scope == "local" && locations[:local] != new_value
+ Bundler.ui.info "You are replacing the current local value of #{name}, which is currently " \
+ "#{locations[:local].inspect}"
end
if name.match(/\Alocal\./)
@@ -73,7 +76,7 @@ module Bundler
self.args = [pathname.expand_path.to_s] if pathname.directory?
end
- Bundler.settings.send("set_#{scope}", name, args.join(" "))
+ Bundler.settings.send("set_#{scope}", name, new_value)
else
Bundler.ui.error "Invalid scope --#{scope} given. Please use --local or --global."
exit 1