instiki/vendor/plugins/bundler/doc/bundler-1.0.7/rdoc/Bundler/Settings.html

967 lines
35 KiB
HTML
Raw Normal View History

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Class: Bundler::Settings</title>
<link rel="stylesheet" href="../rdoc.css" type="text/css" media="screen" />
<script src="../js/jquery.js" type="text/javascript"
charset="utf-8"></script>
<script src="../js/thickbox-compressed.js" type="text/javascript"
charset="utf-8"></script>
<script src="../js/quicksearch.js" type="text/javascript"
charset="utf-8"></script>
<script src="../js/darkfish.js" type="text/javascript"
charset="utf-8"></script>
</head>
<body class="class">
<div id="metadata">
<div id="home-metadata">
<div id="home-section" class="section">
<h3 class="section-header">
<a href="../index.html">Home</a>
<a href="../index.html#classes">Classes</a>
<a href="../index.html#methods">Methods</a>
</h3>
</div>
</div>
<div id="file-metadata">
<div id="file-list-section" class="section">
<h3 class="section-header">In Files</h3>
<div class="section-body">
<ul>
<li><a href="../lib/bundler/settings_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
class="thickbox" title="lib/bundler/settings.rb">lib/bundler/settings.rb</a></li>
</ul>
</div>
</div>
</div>
<div id="class-metadata">
<!-- Parent Class -->
<div id="parent-class-section" class="section">
<h3 class="section-header">Parent</h3>
<p class="link">Object</p>
</div>
<!-- Namespace Contents -->
<!-- Method Quickref -->
<div id="method-list-section" class="section">
<h3 class="section-header">Methods</h3>
<ul class="link-list">
<li><a href="#method-c-new">::new</a></li>
<li><a href="#method-i-%5B%5D">#[]</a></li>
<li><a href="#method-i-%5B%5D%3D">#[]=</a></li>
<li><a href="#method-i-all">#all</a></li>
<li><a href="#method-i-allow_sudo%3F">#allow_sudo?</a></li>
<li><a href="#method-i-delete">#delete</a></li>
<li><a href="#method-i-global_config_file">#global_config_file</a></li>
<li><a href="#method-i-key_for">#key_for</a></li>
<li><a href="#method-i-local_config_file">#local_config_file</a></li>
<li><a href="#method-i-locations">#locations</a></li>
<li><a href="#method-i-path">#path</a></li>
<li><a href="#method-i-pretty_values_for">#pretty_values_for</a></li>
<li><a href="#method-i-set_global">#set_global</a></li>
<li><a href="#method-i-set_key">#set_key</a></li>
<li><a href="#method-i-without">#without</a></li>
<li><a href="#method-i-without%3D">#without=</a></li>
</ul>
</div>
<!-- Included Modules -->
</div>
<div id="project-metadata">
<div id="fileindex-section" class="section project-section">
<h3 class="section-header">Files</h3>
<ul>
<li class="file"><a href="../lib/bundler/man/bundle.html">bundle</a></li>
<li class="file"><a href="../lib/bundler/man/bundle-config.html">bundle-config</a></li>
<li class="file"><a href="../lib/bundler/man/bundle-config_txt.html">bundle-config.txt</a></li>
<li class="file"><a href="../lib/bundler/man/bundle-exec.html">bundle-exec</a></li>
<li class="file"><a href="../lib/bundler/man/bundle-exec_txt.html">bundle-exec.txt</a></li>
<li class="file"><a href="../lib/bundler/man/bundle-install.html">bundle-install</a></li>
<li class="file"><a href="../lib/bundler/man/bundle-install_txt.html">bundle-install.txt</a></li>
<li class="file"><a href="../lib/bundler/man/bundle-package.html">bundle-package</a></li>
<li class="file"><a href="../lib/bundler/man/bundle-package_txt.html">bundle-package.txt</a></li>
<li class="file"><a href="../lib/bundler/man/bundle-update.html">bundle-update</a></li>
<li class="file"><a href="../lib/bundler/man/bundle-update_txt.html">bundle-update.txt</a></li>
<li class="file"><a href="../lib/bundler/man/bundle_txt.html">bundle.txt</a></li>
<li class="file"><a href="../lib/bundler/man/gemfile_5_txt.html">gemfile.5.txt</a></li>
<li class="file"><a href="../lib/bundler/templates/Gemfile.html">Gemfile</a></li>
</ul>
</div>
<div id="classindex-section" class="section project-section">
<h3 class="section-header">Class Index
<span class="search-toggle"><img src="../images/find.png"
height="16" width="16" alt="[+]"
title="show/hide quicksearch" /></span></h3>
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
<fieldset>
<legend>Quicksearch</legend>
<input type="text" name="quicksearch" value=""
class="quicksearch-field" />
</fieldset>
</form>
<ul class="link-list">
<li><a href="../Bundler.html">Bundler</a></li>
<li><a href="../Bundler/BundlerError.html">Bundler::BundlerError</a></li>
<li><a href="../Bundler/CLI.html">Bundler::CLI</a></li>
<li><a href="../Bundler/Definition.html">Bundler::Definition</a></li>
<li><a href="../Bundler/DepProxy.html">Bundler::DepProxy</a></li>
<li><a href="../Bundler/Dependency.html">Bundler::Dependency</a></li>
2010-12-07 04:11:19 +01:00
<li><a href="../Bundler/Deployment.html">Bundler::Deployment</a></li>
<li><a href="../Bundler/DeprecatedError.html">Bundler::DeprecatedError</a></li>
<li><a href="../Bundler/Dsl.html">Bundler::Dsl</a></li>
<li><a href="../Bundler/DslError.html">Bundler::DslError</a></li>
<li><a href="../Bundler/Environment.html">Bundler::Environment</a></li>
<li><a href="../Bundler/GemHelper.html">Bundler::GemHelper</a></li>
<li><a href="../Bundler/GemHelpers.html">Bundler::GemHelpers</a></li>
<li><a href="../Bundler/GemNotFound.html">Bundler::GemNotFound</a></li>
<li><a href="../Bundler/GemfileError.html">Bundler::GemfileError</a></li>
<li><a href="../Bundler/GemfileNotFound.html">Bundler::GemfileNotFound</a></li>
<li><a href="../Bundler/GemspecError.html">Bundler::GemspecError</a></li>
<li><a href="../Bundler/GitError.html">Bundler::GitError</a></li>
<li><a href="../Bundler/Graph.html">Bundler::Graph</a></li>
<li><a href="../Bundler/GraphNode.html">Bundler::GraphNode</a></li>
<li><a href="../Bundler/Index.html">Bundler::Index</a></li>
<li><a href="../Bundler/Installer.html">Bundler::Installer</a></li>
<li><a href="../Bundler/InvalidOption.html">Bundler::InvalidOption</a></li>
<li><a href="../Bundler/InvalidSpecSet.html">Bundler::InvalidSpecSet</a></li>
<li><a href="../Bundler/LazySpecification.html">Bundler::LazySpecification</a></li>
<li><a href="../Bundler/LockfileParser.html">Bundler::LockfileParser</a></li>
<li><a href="../Bundler/MatchPlatform.html">Bundler::MatchPlatform</a></li>
<li><a href="../Bundler/PathError.html">Bundler::PathError</a></li>
<li><a href="../Bundler/ProductionError.html">Bundler::ProductionError</a></li>
<li><a href="../Bundler/RemoteSpecification.html">Bundler::RemoteSpecification</a></li>
<li><a href="../Bundler/Resolver.html">Bundler::Resolver</a></li>
<li><a href="../Bundler/Resolver/SpecGroup.html">Bundler::Resolver::SpecGroup</a></li>
<li><a href="../Bundler/Runtime.html">Bundler::Runtime</a></li>
<li><a href="../Bundler/Settings.html">Bundler::Settings</a></li>
<li><a href="../Bundler/SharedHelpers.html">Bundler::SharedHelpers</a></li>
<li><a href="../Bundler/SharedHelpers/Gem.html">Bundler::SharedHelpers::Gem</a></li>
<li><a href="../Bundler/SharedHelpers/Gem/SourceIndex.html">Bundler::SharedHelpers::Gem::SourceIndex</a></li>
<li><a href="../Bundler/Source.html">Bundler::Source</a></li>
<li><a href="../Bundler/Source/Git.html">Bundler::Source::Git</a></li>
<li><a href="../Bundler/Source/Path.html">Bundler::Source::Path</a></li>
<li><a href="../Bundler/Source/Path/Installer.html">Bundler::Source::Path::Installer</a></li>
<li><a href="../Bundler/Source/Rubygems.html">Bundler::Source::Rubygems</a></li>
<li><a href="../Bundler/SpecSet.html">Bundler::SpecSet</a></li>
<li><a href="../Bundler/UI.html">Bundler::UI</a></li>
<li><a href="../Bundler/UI/RGProxy.html">Bundler::UI::RGProxy</a></li>
<li><a href="../Bundler/UI/Shell.html">Bundler::UI::Shell</a></li>
<li><a href="../Bundler/VersionConflict.html">Bundler::VersionConflict</a></li>
<li><a href="../Thor.html">Thor</a></li>
<li><a href="../Thor/Actions.html">Thor::Actions</a></li>
<li><a href="../Thor/Actions/ClassMethods.html">Thor::Actions::ClassMethods</a></li>
<li><a href="../Thor/Base.html">Thor::Base</a></li>
<li><a href="../Thor/Base/ClassMethods.html">Thor::Base::ClassMethods</a></li>
<li><a href="../Thor/DynamicTask.html">Thor::DynamicTask</a></li>
<li><a href="../Thor/Error.html">Thor::Error</a></li>
<li><a href="../Thor/HiddenTask.html">Thor::HiddenTask</a></li>
<li><a href="../Thor/Invocation.html">Thor::Invocation</a></li>
<li><a href="../Thor/Invocation/ClassMethods.html">Thor::Invocation::ClassMethods</a></li>
<li><a href="../Thor/InvocationError.html">Thor::InvocationError</a></li>
<li><a href="../Thor/MalformattedArgumentError.html">Thor::MalformattedArgumentError</a></li>
<li><a href="../Thor/RequiredArgumentMissingError.html">Thor::RequiredArgumentMissingError</a></li>
<li><a href="../Thor/Shell.html">Thor::Shell</a></li>
<li><a href="../Thor/Shell/Basic.html">Thor::Shell::Basic</a></li>
<li><a href="../Thor/Shell/Color.html">Thor::Shell::Color</a></li>
<li><a href="../Thor/Shell/HTML.html">Thor::Shell::HTML</a></li>
<li><a href="../Thor/Task.html">Thor::Task</a></li>
<li><a href="../Thor/UndefinedTaskError.html">Thor::UndefinedTaskError</a></li>
<li><a href="../Thor/UnknownArgumentError.html">Thor::UnknownArgumentError</a></li>
<li><a href="../Thor/Util.html">Thor::Util</a></li>
<li><a href="../Gem.html">Gem</a></li>
<li><a href="../Gem/Dependency.html">Gem::Dependency</a></li>
<li><a href="../Gem/Platform.html">Gem::Platform</a></li>
2010-12-07 04:11:19 +01:00
<li><a href="../Gem/Requirement.html">Gem::Requirement</a></li>
<li><a href="../Gem/Specification.html">Gem::Specification</a></li>
</ul>
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
</div>
</div>
</div>
<div id="documentation">
<h1 class="class">Bundler::Settings</h1>
<div id="description">
</div>
<!-- Constants -->
<!-- Attributes -->
<!-- Methods -->
<div id="public-class-method-details" class="method-section section">
<h3 class="section-header">Public Class Methods</h3>
<div id="new-method" class="method-detail ">
<a name="method-c-new"></a>
<div class="method-heading">
<span class="method-name">new</span><span
class="method-args">(root)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code"
id="new-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/settings.rb, line 3</span>
3: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">root</span>)
4: <span class="ruby-ivar">@root</span> = <span class="ruby-identifier">root</span>
5: <span class="ruby-ivar">@local_config</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">local_config_file</span>) <span class="ruby-operator">?</span> <span class="ruby-constant">YAML</span>.<span class="ruby-identifier">load_file</span>(<span class="ruby-identifier">local_config_file</span>) <span class="ruby-operator">:</span> {}
6: <span class="ruby-ivar">@global_config</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">global_config_file</span>) <span class="ruby-operator">?</span> <span class="ruby-constant">YAML</span>.<span class="ruby-identifier">load_file</span>(<span class="ruby-identifier">global_config_file</span>) <span class="ruby-operator">:</span> {}
7: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
</div>
<div id="public-instance-method-details" class="method-section section">
<h3 class="section-header">Public Instance Methods</h3>
<div id="--method" class="method-detail ">
<a name="method-i-%5B%5D"></a>
<div class="method-heading">
<span class="method-name">[]</span><span
class="method-args">(key)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code"
id="--source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/settings.rb, line 9</span>
9: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]</span>(<span class="ruby-identifier">key</span>)
10: <span class="ruby-identifier">key</span> = <span class="ruby-identifier">key_for</span>(<span class="ruby-identifier">key</span>)
11: <span class="ruby-ivar">@local_config</span>[<span class="ruby-identifier">key</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">ENV</span>[<span class="ruby-identifier">key</span>] <span class="ruby-operator">||</span> <span class="ruby-ivar">@global_config</span>[<span class="ruby-identifier">key</span>]
12: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="--method" class="method-detail ">
<a name="method-i-%5B%5D%3D"></a>
<div class="method-heading">
<span class="method-name">[]=</span><span
class="method-args">(key, value)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code"
id="--source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/settings.rb, line 14</span>
14: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]=</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>)
15: <span class="ruby-identifier">set_key</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>, <span class="ruby-ivar">@local_config</span>, <span class="ruby-identifier">local_config_file</span>)
16: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="all-method" class="method-detail ">
<a name="method-i-all"></a>
<div class="method-heading">
<span class="method-name">all</span><span
class="method-args">()</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code"
id="all-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/settings.rb, line 26</span>
26: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">all</span>
27: <span class="ruby-identifier">env_keys</span> = <span class="ruby-constant">ENV</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">select</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span><span class="ruby-operator">|</span> <span class="ruby-identifier">k</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/BUNDLE_.*/</span> }
28: <span class="ruby-identifier">keys</span> = <span class="ruby-ivar">@global_config</span>.<span class="ruby-identifier">keys</span> <span class="ruby-operator">|</span> <span class="ruby-ivar">@local_config</span>.<span class="ruby-identifier">keys</span> <span class="ruby-operator">|</span> <span class="ruby-identifier">env_keys</span>
29:
30: <span class="ruby-identifier">keys</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span><span class="ruby-operator">|</span>
31: <span class="ruby-identifier">key</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp re">/^BUNDLE_/</span>, <span class="ruby-value str">''</span>).<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/__/</span>, <span class="ruby-value str">&quot;.&quot;</span>).<span class="ruby-identifier">downcase</span>
32: <span class="ruby-keyword kw">end</span>
33: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="allow-sudo--method" class="method-detail ">
<a name="method-i-allow_sudo%3F"></a>
<div class="method-heading">
<span class="method-name">allow_sudo?</span><span
class="method-args">()</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code"
id="allow-sudo--source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/settings.rb, line 86</span>
86: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">allow_sudo?</span>
87: <span class="ruby-operator">!</span><span class="ruby-ivar">@local_config</span>.<span class="ruby-identifier">key?</span>(<span class="ruby-identifier">key_for</span>(<span class="ruby-value">:path</span>))
88: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="delete-method" class="method-detail ">
<a name="method-i-delete"></a>
<div class="method-heading">
<span class="method-name">delete</span><span
class="method-args">(key)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code"
id="delete-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/settings.rb, line 18</span>
18: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete</span>(<span class="ruby-identifier">key</span>)
19: <span class="ruby-ivar">@local_config</span>
20: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="locations-method" class="method-detail ">
<a name="method-i-locations"></a>
<div class="method-heading">
<span class="method-name">locations</span><span
class="method-args">(key)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code"
id="locations-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/settings.rb, line 35</span>
35: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">locations</span>(<span class="ruby-identifier">key</span>)
36: <span class="ruby-identifier">locations</span> = {}
37:
38: <span class="ruby-identifier">locations</span>[<span class="ruby-value">:local</span>] = <span class="ruby-ivar">@local_config</span>[<span class="ruby-identifier">key</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@local_config</span>.<span class="ruby-identifier">key?</span>(<span class="ruby-identifier">key</span>)
39: <span class="ruby-identifier">locations</span>[<span class="ruby-value">:env</span>] = <span class="ruby-constant">ENV</span>[<span class="ruby-identifier">key</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-constant">ENV</span>[<span class="ruby-identifier">key</span>]
40: <span class="ruby-identifier">locations</span>[<span class="ruby-value">:global</span>] = <span class="ruby-ivar">@global_config</span>[<span class="ruby-identifier">key</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@global_config</span>.<span class="ruby-identifier">key?</span>(<span class="ruby-identifier">key</span>)
41: <span class="ruby-identifier">locations</span>
42: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="path-method" class="method-detail ">
<a name="method-i-path"></a>
<div class="method-heading">
<span class="method-name">path</span><span
class="method-args">()</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<p>
@local_config[&#8220;BUNDLE_PATH&#8220;] should be prioritized over
ENV[&#8220;BUNDLE_PATH&#8220;]
</p>
<div class="method-source-code"
id="path-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/settings.rb, line 75</span>
75: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">path</span>
76: <span class="ruby-identifier">path</span> = <span class="ruby-constant">ENV</span>[<span class="ruby-identifier">key_for</span>(<span class="ruby-value">:path</span>)] <span class="ruby-operator">||</span> <span class="ruby-ivar">@global_config</span>[<span class="ruby-identifier">key_for</span>(<span class="ruby-value">:path</span>)]
77: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">path</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">path</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@local_config</span>.<span class="ruby-identifier">key?</span>(<span class="ruby-identifier">key_for</span>(<span class="ruby-value">:path</span>))
78:
79: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">path</span> = <span class="ruby-keyword kw">self</span>[<span class="ruby-value">:path</span>]
80: <span class="ruby-node">&quot;#{path}/#{Bundler.ruby_scope}&quot;</span>
81: <span class="ruby-keyword kw">else</span>
82: <span class="ruby-constant">Gem</span>.<span class="ruby-identifier">dir</span>
83: <span class="ruby-keyword kw">end</span>
84: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="pretty-values-for-method" class="method-detail ">
<a name="method-i-pretty_values_for"></a>
<div class="method-heading">
<span class="method-name">pretty_values_for</span><span
class="method-args">(exposed_key)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code"
id="pretty-values-for-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/settings.rb, line 44</span>
44: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pretty_values_for</span>(<span class="ruby-identifier">exposed_key</span>)
45: <span class="ruby-identifier">key</span> = <span class="ruby-identifier">key_for</span>(<span class="ruby-identifier">exposed_key</span>)
46:
47: <span class="ruby-identifier">locations</span> = []
48: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@local_config</span>.<span class="ruby-identifier">key?</span>(<span class="ruby-identifier">key</span>)
49: <span class="ruby-identifier">locations</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;Set for your local app (#{local_config_file}): #{@local_config[key].inspect}&quot;</span>
50: <span class="ruby-keyword kw">end</span>
51:
52: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">value</span> = <span class="ruby-constant">ENV</span>[<span class="ruby-identifier">key</span>]
2010-12-07 04:11:19 +01:00
53: <span class="ruby-identifier">locations</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;Set via #{key}: #{value.inspect}&quot;</span>
54: <span class="ruby-keyword kw">end</span>
55:
56: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@global_config</span>.<span class="ruby-identifier">key?</span>(<span class="ruby-identifier">key</span>)
57: <span class="ruby-identifier">locations</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;Set for the current user (#{global_config_file}): #{@global_config[key].inspect}&quot;</span>
58: <span class="ruby-keyword kw">end</span>
59:
60: <span class="ruby-keyword kw">return</span> [<span class="ruby-node">&quot;You have not configured a value for `#{exposed_key}`&quot;</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">locations</span>.<span class="ruby-identifier">empty?</span>
61: <span class="ruby-identifier">locations</span>
62: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="set-global-method" class="method-detail ">
<a name="method-i-set_global"></a>
<div class="method-heading">
<span class="method-name">set_global</span><span
class="method-args">(key, value)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code"
id="set-global-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/settings.rb, line 22</span>
22: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_global</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>)
23: <span class="ruby-identifier">set_key</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>, <span class="ruby-ivar">@global_config</span>, <span class="ruby-identifier">global_config_file</span>)
24: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="without-method" class="method-detail ">
<a name="method-i-without"></a>
<div class="method-heading">
<span class="method-name">without</span><span
class="method-args">()</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code"
id="without-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/settings.rb, line 70</span>
70: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">without</span>
71: <span class="ruby-keyword kw">self</span>[<span class="ruby-value">:without</span>] <span class="ruby-operator">?</span> <span class="ruby-keyword kw">self</span>[<span class="ruby-value">:without</span>].<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;:&quot;</span>).<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">w</span><span class="ruby-operator">|</span> <span class="ruby-identifier">w</span>.<span class="ruby-identifier">to_sym</span> } <span class="ruby-operator">:</span> []
72: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="without--method" class="method-detail ">
<a name="method-i-without%3D"></a>
<div class="method-heading">
<span class="method-name">without=</span><span
class="method-args">(array)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code"
id="without--source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/settings.rb, line 64</span>
64: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">without=</span>(<span class="ruby-identifier">array</span>)
2010-12-07 04:11:19 +01:00
65: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">array</span>.<span class="ruby-identifier">empty?</span>
66: <span class="ruby-keyword kw">self</span>[<span class="ruby-value">:without</span>] = <span class="ruby-identifier">array</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;:&quot;</span>)
67: <span class="ruby-keyword kw">end</span>
68: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
</div>
<div id="private-instance-method-details" class="method-section section">
<h3 class="section-header">Private Instance Methods</h3>
<div id="global-config-file-method" class="method-detail ">
<a name="method-i-global_config_file"></a>
<div class="method-heading">
<span class="method-name">global_config_file</span><span
class="method-args">()</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code"
id="global-config-file-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/settings.rb, line 108</span>
108: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">global_config_file</span>
109: <span class="ruby-identifier">file</span> = <span class="ruby-constant">ENV</span>[<span class="ruby-value str">&quot;BUNDLE_CONFIG&quot;</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">Gem</span>.<span class="ruby-identifier">user_home</span>, <span class="ruby-value str">&quot;.bundle/config&quot;</span>)
110: <span class="ruby-constant">Pathname</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">file</span>)
111: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="key-for-method" class="method-detail ">
<a name="method-i-key_for"></a>
<div class="method-heading">
<span class="method-name">key_for</span><span
class="method-args">(key)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code"
id="key-for-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/settings.rb, line 91</span>
91: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">key_for</span>(<span class="ruby-identifier">key</span>)
92: <span class="ruby-identifier">key</span> = <span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-value str">&quot;.&quot;</span>, <span class="ruby-value str">&quot;__&quot;</span>).<span class="ruby-identifier">upcase</span>
93: <span class="ruby-node">&quot;BUNDLE_#{key}&quot;</span>
94: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="local-config-file-method" class="method-detail ">
<a name="method-i-local_config_file"></a>
<div class="method-heading">
<span class="method-name">local_config_file</span><span
class="method-args">()</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code"
id="local-config-file-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/settings.rb, line 113</span>
113: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">local_config_file</span>
114: <span class="ruby-constant">Pathname</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">&quot;#{@root}/config&quot;</span>)
115: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="set-key-method" class="method-detail ">
<a name="method-i-set_key"></a>
<div class="method-heading">
<span class="method-name">set_key</span><span
class="method-args">(key, value, hash, file)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code"
id="set-key-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/settings.rb, line 96</span>
96: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_key</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>, <span class="ruby-identifier">hash</span>, <span class="ruby-identifier">file</span>)
97: <span class="ruby-identifier">key</span> = <span class="ruby-identifier">key_for</span>(<span class="ruby-identifier">key</span>)
98:
99: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">hash</span>[<span class="ruby-identifier">key</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">value</span>
100: <span class="ruby-identifier">hash</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">value</span>
101: <span class="ruby-identifier">hash</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">key</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span>
102: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>(<span class="ruby-identifier">file</span>.<span class="ruby-identifier">dirname</span>)
103: <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">file</span>, <span class="ruby-value str">&quot;w&quot;</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">hash</span>.<span class="ruby-identifier">to_yaml</span> }
104: <span class="ruby-keyword kw">end</span>
105: <span class="ruby-identifier">value</span>
106: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
</div>
</div>
<div id="rdoc-debugging-section-dump" class="debugging-section">
<p>Disabled; run with --debug to generate this.</p>
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
Rdoc Generator</a> 1.1.6</small>.</p>
</div>
</body>
</html>