Class: Bundler::Settings::Path
- Inherits:
-
Struct
- Object
- Struct
- Bundler::Settings::Path
- Defined in:
- lib/bundler/settings.rb
Instance Attribute Summary collapse
-
#append_ruby_scope ⇒ Object
Returns the value of attribute append_ruby_scope.
-
#default_install_uses_path ⇒ Object
Returns the value of attribute default_install_uses_path.
-
#explicit_path ⇒ Object
Returns the value of attribute explicit_path.
-
#system_path ⇒ Object
Returns the value of attribute system_path.
Instance Method Summary collapse
Instance Attribute Details
#append_ruby_scope ⇒ Object
Returns the value of attribute append_ruby_scope
229 230 231 |
# File 'lib/bundler/settings.rb', line 229 def append_ruby_scope @append_ruby_scope end |
#default_install_uses_path ⇒ Object
Returns the value of attribute default_install_uses_path
229 230 231 |
# File 'lib/bundler/settings.rb', line 229 def default_install_uses_path @default_install_uses_path end |
#explicit_path ⇒ Object
Returns the value of attribute explicit_path
229 230 231 |
# File 'lib/bundler/settings.rb', line 229 def explicit_path @explicit_path end |
#system_path ⇒ Object
Returns the value of attribute system_path
229 230 231 |
# File 'lib/bundler/settings.rb', line 229 def system_path @system_path end |
Instance Method Details
#base_path ⇒ Object
242 243 244 245 246 247 |
# File 'lib/bundler/settings.rb', line 242 def base_path path = explicit_path path ||= ".bundle" unless use_system_gems? path ||= Bundler.rubygems.gem_dir path end |
#path ⇒ Object
230 231 232 233 234 |
# File 'lib/bundler/settings.rb', line 230 def path path = base_path path = File.join(path, Bundler.ruby_scope) if append_ruby_scope && !use_system_gems? path end |
#use_system_gems? ⇒ Boolean
236 237 238 239 240 |
# File 'lib/bundler/settings.rb', line 236 def use_system_gems? return true if system_path return false if explicit_path !default_install_uses_path end |
#validate! ⇒ Object
249 250 251 252 253 254 255 256 257 258 259 |
# File 'lib/bundler/settings.rb', line 249 def validate! return unless explicit_path && system_path path = Bundler.settings.pretty_values_for(:path) path.unshift(nil, "path:") unless path.empty? system_path = Bundler.settings.pretty_values_for("path.system") system_path.unshift(nil, "path.system:") unless system_path.empty? disable_shared_gems = Bundler.settings.pretty_values_for(:disable_shared_gems) disable_shared_gems.unshift(nil, "disable_shared_gems:") unless disable_shared_gems.empty? raise InvalidOption, "Using a custom path while using system gems is unsupported.\n#{path.join("\n")}\n#{system_path.join("\n")}\n#{disable_shared_gems.join("\n")}" end |