instiki/vendor/plugins/bundler/doc/bundler-1.0.15/rdoc/Bundler/CLI.html

1418 lines
84 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::CLI</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/cli_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
class="thickbox" title="lib/bundler/cli.rb">lib/bundler/cli.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"><a href="../Thor.html">Thor</a></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-c-source_root">::source_root</a></li>
<li><a href="#method-i-cache">#cache</a></li>
<li><a href="#method-i-check">#check</a></li>
<li><a href="#method-i-config">#config</a></li>
<li><a href="#method-i-console">#console</a></li>
<li><a href="#method-i-exec">#exec</a></li>
<li><a href="#method-i-gem">#gem</a></li>
<li><a href="#method-i-have_groff%3F">#have_groff?</a></li>
<li><a href="#method-i-help">#help</a></li>
<li><a href="#method-i-init">#init</a></li>
<li><a href="#method-i-install">#install</a></li>
<li><a href="#method-i-locate_gem">#locate_gem</a></li>
<li><a href="#method-i-lock">#lock</a></li>
<li><a href="#method-i-open">#open</a></li>
<li><a href="#method-i-package">#package</a></li>
<li><a href="#method-i-show">#show</a></li>
<li><a href="#method-i-unlock">#unlock</a></li>
<li><a href="#method-i-update">#update</a></li>
<li><a href="#method-i-version">#version</a></li>
<li><a href="#method-i-viz">#viz</a></li>
</ul>
</div>
<!-- Included Modules -->
<div id="includes-section" class="section">
<h3 class="section-header">Included Modules</h3>
<ul class="link-list">
<li><a class="include" href="../Thor/Actions.html">Thor::Actions</a></li>
</ul>
</div>
</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-benchmark.html">bundle-benchmark</a></li>
<li class="file"><a href="../lib/bundler/man/bundle-benchmark_txt.html">bundle-benchmark.txt</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/RubygemsIntegration.html">Bundler::RubygemsIntegration</a></li>
<li><a href="../Bundler/RubygemsIntegration/AlmostModern.html">Bundler::RubygemsIntegration::AlmostModern</a></li>
<li><a href="../Bundler/RubygemsIntegration/Deprecate.html">Bundler::RubygemsIntegration::Deprecate</a></li>
<li><a href="../Bundler/RubygemsIntegration/Gem.html">Bundler::RubygemsIntegration::Gem</a></li>
<li><a href="../Bundler/RubygemsIntegration/Gem/SourceIndex.html">Bundler::RubygemsIntegration::Gem::SourceIndex</a></li>
<li><a href="../Bundler/RubygemsIntegration/Legacy.html">Bundler::RubygemsIntegration::Legacy</a></li>
<li><a href="../Bundler/RubygemsIntegration/Modern.html">Bundler::RubygemsIntegration::Modern</a></li>
<li><a href="../Bundler/RubygemsIntegration/Transitional.html">Bundler::RubygemsIntegration::Transitional</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/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::CLI</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">(*)</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/cli.rb, line 11</span>
11: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(*)
12: <span class="ruby-keyword kw">super</span>
13: <span class="ruby-identifier">the_shell</span> = (<span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;no-color&quot;</span>] <span class="ruby-operator">?</span> <span class="ruby-constant">Thor</span><span class="ruby-operator">::</span><span class="ruby-constant">Shell</span><span class="ruby-operator">::</span><span class="ruby-constant">Basic</span>.<span class="ruby-identifier">new</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">shell</span>)
14: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span> = <span class="ruby-constant">UI</span><span class="ruby-operator">::</span><span class="ruby-constant">Shell</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">the_shell</span>)
15: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">debug!</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;verbose&quot;</span>]
16: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">rubygems</span>.<span class="ruby-identifier">ui</span> = <span class="ruby-constant">UI</span><span class="ruby-operator">::</span><span class="ruby-constant">RGProxy</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>)
17: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="source-root-method" class="method-detail ">
<a name="method-c-source_root"></a>
<div class="method-heading">
<span class="method-name">source_root</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="source-root-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/cli.rb, line 501</span>
501: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">source_root</span>
502: <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-keyword kw">__FILE__</span>), <span class="ruby-value str">'templates'</span>))
503: <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="cache-method" class="method-detail ">
<a name="method-i-cache"></a>
<div class="method-heading">
<span class="method-name">cache</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="cache-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/cli.rb, line 307</span>
307: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cache</span>
308: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">definition</span>.<span class="ruby-identifier">resolve_with_cache!</span>
309: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">load</span>.<span class="ruby-identifier">cache</span>
310: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>[<span class="ruby-value">:no_prune</span>] = <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;no-prune&quot;</span>]
311: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">load</span>.<span class="ruby-identifier">lock</span>
312: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">GemNotFound</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
313: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">error</span>(<span class="ruby-identifier">e</span>.<span class="ruby-identifier">message</span>)
314: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Run `bundle install` to install missing gems.&quot;</span>
315: <span class="ruby-identifier">exit</span> <span class="ruby-value">128</span>
316: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="check-method" class="method-detail ">
<a name="method-i-check"></a>
<div class="method-heading">
<span class="method-name">check</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="check-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/cli.rb, line 97</span>
97: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">check</span>
98: <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'BUNDLE_GEMFILE'</span>] = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">options</span>[<span class="ruby-value">:gemfile</span>]) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-value">:gemfile</span>]
99: <span class="ruby-keyword kw">begin</span>
100: <span class="ruby-identifier">not_installed</span> = <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">definition</span>.<span class="ruby-identifier">missing_specs</span>
101: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">GemNotFound</span>, <span class="ruby-constant">VersionConflict</span>
102: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">error</span> <span class="ruby-value str">&quot;Your Gemfile's dependencies could not be satisfied&quot;</span>
103: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Install missing gems with `bundle install`&quot;</span>
104: <span class="ruby-identifier">exit</span> <span class="ruby-value">1</span>
105: <span class="ruby-keyword kw">end</span>
106:
107: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">not_installed</span>.<span class="ruby-identifier">any?</span>
108: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">error</span> <span class="ruby-value str">&quot;The following gems are missing&quot;</span>
109: <span class="ruby-identifier">not_installed</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">error</span> <span class="ruby-node">&quot; * #{s.name} (#{s.version})&quot;</span> }
110: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Install missing gems with `bundle install`&quot;</span>
111: <span class="ruby-identifier">exit</span> <span class="ruby-value">1</span>
112: <span class="ruby-keyword kw">else</span>
113: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">load</span>.<span class="ruby-identifier">lock</span>
114: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">info</span> <span class="ruby-value str">&quot;The Gemfile's dependencies are satisfied&quot;</span>
115: <span class="ruby-keyword kw">end</span>
116: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="config-method" class="method-detail ">
<a name="method-i-config"></a>
<div class="method-heading">
<span class="method-name">config</span><span
class="method-args">(name = nil, *args)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code"
id="config-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/cli.rb, line 369</span>
369: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">config</span>(<span class="ruby-identifier">name</span> = <span class="ruby-keyword kw">nil</span>, *<span class="ruby-identifier">args</span>)
370: <span class="ruby-identifier">values</span> = <span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">dup</span>
371: <span class="ruby-identifier">values</span>.<span class="ruby-identifier">shift</span> <span class="ruby-comment cmt"># remove config</span>
372: <span class="ruby-identifier">values</span>.<span class="ruby-identifier">shift</span> <span class="ruby-comment cmt"># remove the name</span>
373:
374: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">name</span>
375: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">confirm</span> <span class="ruby-value str">&quot;Settings are listed in order of priority. The top value will be used.\n&quot;</span>
376:
377: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>.<span class="ruby-identifier">all</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">setting</span><span class="ruby-operator">|</span>
378: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">confirm</span> <span class="ruby-node">&quot;#{setting}&quot;</span>
379: <span class="ruby-identifier">with_padding</span> <span class="ruby-keyword kw">do</span>
380: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>.<span class="ruby-identifier">pretty_values_for</span>(<span class="ruby-identifier">setting</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span>
381: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">info</span> <span class="ruby-identifier">line</span>
382: <span class="ruby-keyword kw">end</span>
383: <span class="ruby-keyword kw">end</span>
384: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">confirm</span> <span class="ruby-value str">&quot;&quot;</span>
385: <span class="ruby-keyword kw">end</span>
386: <span class="ruby-keyword kw">return</span>
387: <span class="ruby-keyword kw">end</span>
388:
389: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">values</span>.<span class="ruby-identifier">empty?</span>
390: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">confirm</span> <span class="ruby-node">&quot;Settings for `#{name}` in order of priority. The top value will be used&quot;</span>
391: <span class="ruby-identifier">with_padding</span> <span class="ruby-keyword kw">do</span>
392: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>.<span class="ruby-identifier">pretty_values_for</span>(<span class="ruby-identifier">name</span>).<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">info</span> <span class="ruby-identifier">line</span> }
393: <span class="ruby-keyword kw">end</span>
394: <span class="ruby-keyword kw">else</span>
395: <span class="ruby-identifier">locations</span> = <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>.<span class="ruby-identifier">locations</span>(<span class="ruby-identifier">name</span>)
396:
397: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">local</span> = <span class="ruby-identifier">locations</span>[<span class="ruby-value">:local</span>]
398: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">info</span> <span class="ruby-node">&quot;Your application has set #{name} to #{local.inspect}. This will override the &quot;</span> <span class="ruby-value str">&quot;system value you are currently setting&quot;</span>
399: <span class="ruby-keyword kw">end</span>
400:
401: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">global</span> = <span class="ruby-identifier">locations</span>[<span class="ruby-value">:global</span>]
402: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">info</span> <span class="ruby-node">&quot;You are replacing the current system value of #{name}, which is currently #{global}&quot;</span>
403: <span class="ruby-keyword kw">end</span>
404:
405: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">env</span> = <span class="ruby-identifier">locations</span>[<span class="ruby-value">:env</span>]
406: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">info</span> <span class="ruby-node">&quot;You have set a bundler environment variable for #{env}. This will take precedence &quot;</span> <span class="ruby-value str">&quot;over the system value you are setting&quot;</span>
407: <span class="ruby-keyword kw">end</span>
408:
409: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>.<span class="ruby-identifier">set_global</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">values</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot; &quot;</span>))
410: <span class="ruby-keyword kw">end</span>
411: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="console-method" class="method-detail ">
<a name="method-i-console"></a>
<div class="method-heading">
<span class="method-name">console</span><span
class="method-args">(group = nil)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code"
id="console-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/cli.rb, line 431</span>
431: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">console</span>(<span class="ruby-identifier">group</span> = <span class="ruby-keyword kw">nil</span>)
432: <span class="ruby-identifier">group</span> <span class="ruby-operator">?</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">require</span>(<span class="ruby-value">:default</span>, *(<span class="ruby-identifier">group</span>.<span class="ruby-identifier">split</span>.<span class="ruby-identifier">map!</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">g</span><span class="ruby-operator">|</span> <span class="ruby-identifier">g</span>.<span class="ruby-identifier">to_sym</span> })) <span class="ruby-operator">:</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">require</span>
433: <span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">clear</span>
434:
435: <span class="ruby-identifier">require</span> <span class="ruby-value str">'irb'</span>
436: <span class="ruby-constant">IRB</span>.<span class="ruby-identifier">start</span>
437: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="exec-method" class="method-detail ">
<a name="method-i-exec"></a>
<div class="method-heading">
<span class="method-name">exec</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="exec-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/cli.rb, line 339</span>
339: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">exec</span>(*)
340: <span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value str">&quot;exec&quot;</span>)
341:
342: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">setup</span>
343:
344: <span class="ruby-keyword kw">begin</span>
345: <span class="ruby-comment cmt"># Run</span>
346: <span class="ruby-constant">Kernel</span>.<span class="ruby-identifier">exec</span>(*<span class="ruby-constant">ARGV</span>)
347: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">EACCES</span>
348: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">error</span> <span class="ruby-node">&quot;bundler: not executable: #{ARGV.first}&quot;</span>
349: <span class="ruby-identifier">exit</span> <span class="ruby-value">126</span>
350: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">ENOENT</span>
351: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">error</span> <span class="ruby-node">&quot;bundler: command not found: #{ARGV.first}&quot;</span>
352: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Install missing gem binaries with `bundle install`&quot;</span>
353: <span class="ruby-identifier">exit</span> <span class="ruby-value">127</span>
354: <span class="ruby-keyword kw">end</span>
355: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="gem-method" class="method-detail ">
<a name="method-i-gem"></a>
<div class="method-heading">
<span class="method-name">gem</span><span
class="method-args">(name)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code"
id="gem-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/cli.rb, line 477</span>
477: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">gem</span>(<span class="ruby-identifier">name</span>)
478: <span class="ruby-identifier">target</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">Dir</span>.<span class="ruby-identifier">pwd</span>, <span class="ruby-identifier">name</span>)
479: <span class="ruby-identifier">constant_name</span> = <span class="ruby-identifier">name</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">'_'</span>).<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span> <span class="ruby-identifier">p</span>.<span class="ruby-identifier">capitalize</span>}.<span class="ruby-identifier">join</span>
480: <span class="ruby-identifier">constant_name</span> = <span class="ruby-identifier">constant_name</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">'-'</span>).<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">q</span><span class="ruby-operator">|</span> <span class="ruby-identifier">q</span>.<span class="ruby-identifier">capitalize</span>}.<span class="ruby-identifier">join</span>(<span class="ruby-value str">'::'</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">constant_name</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/-/</span>
481: <span class="ruby-identifier">constant_array</span> = <span class="ruby-identifier">constant_name</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">'::'</span>)
482: <span class="ruby-identifier">git_author_name</span> = <span class="ruby-value">`git config user.name`</span>.<span class="ruby-identifier">chomp</span>
483: <span class="ruby-identifier">git_author_email</span> = <span class="ruby-value">`git config user.email`</span>.<span class="ruby-identifier">chomp</span>
484: <span class="ruby-identifier">author_name</span> = <span class="ruby-identifier">git_author_name</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">?</span> <span class="ruby-value str">&quot;TODO: Write your name&quot;</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">git_author_name</span>
485: <span class="ruby-identifier">author_email</span> = <span class="ruby-identifier">git_author_email</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">?</span> <span class="ruby-value str">&quot;TODO: Write your email address&quot;</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">git_author_email</span>
486: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">target</span>, <span class="ruby-value str">'lib'</span>, <span class="ruby-identifier">name</span>))
487: <span class="ruby-identifier">opts</span> = {<span class="ruby-value">:name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">name</span>, <span class="ruby-value">:constant_name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">constant_name</span>, <span class="ruby-value">:constant_array</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">constant_array</span>, <span class="ruby-value">:author_name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">author_name</span>, <span class="ruby-value">:author_email</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">author_email</span>}
488: <span class="ruby-identifier">template</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;newgem/Gemfile.tt&quot;</span>), <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">target</span>, <span class="ruby-value str">&quot;Gemfile&quot;</span>), <span class="ruby-identifier">opts</span>)
489: <span class="ruby-identifier">template</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;newgem/Rakefile.tt&quot;</span>), <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">target</span>, <span class="ruby-value str">&quot;Rakefile&quot;</span>), <span class="ruby-identifier">opts</span>)
490: <span class="ruby-identifier">template</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;newgem/gitignore.tt&quot;</span>), <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">target</span>, <span class="ruby-value str">&quot;.gitignore&quot;</span>), <span class="ruby-identifier">opts</span>)
491: <span class="ruby-identifier">template</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;newgem/newgem.gemspec.tt&quot;</span>), <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">target</span>, <span class="ruby-node">&quot;#{name}.gemspec&quot;</span>), <span class="ruby-identifier">opts</span>)
492: <span class="ruby-identifier">template</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;newgem/lib/newgem.rb.tt&quot;</span>), <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">target</span>, <span class="ruby-node">&quot;lib/#{name}.rb&quot;</span>), <span class="ruby-identifier">opts</span>)
493: <span class="ruby-identifier">template</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;newgem/lib/newgem/version.rb.tt&quot;</span>), <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">target</span>, <span class="ruby-node">&quot;lib/#{name}/version.rb&quot;</span>), <span class="ruby-identifier">opts</span>)
494: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-value">:bin</span>]
495: <span class="ruby-identifier">template</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;newgem/bin/newgem.tt&quot;</span>), <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">target</span>, <span class="ruby-value str">'bin'</span>, <span class="ruby-identifier">name</span>), <span class="ruby-identifier">opts</span>)
496: <span class="ruby-keyword kw">end</span>
497: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">info</span> <span class="ruby-node">&quot;Initializating git repo in #{target}&quot;</span>
498: <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">chdir</span>(<span class="ruby-identifier">target</span>) { <span class="ruby-value">`git init`</span>; <span class="ruby-value">`git add .`</span> }
499: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="help-method" class="method-detail ">
<a name="method-i-help"></a>
<div class="method-heading">
<span class="method-name">help</span><span
class="method-args">(cli = nil)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code"
id="help-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/cli.rb, line 25</span>
25: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">help</span>(<span class="ruby-identifier">cli</span> = <span class="ruby-keyword kw">nil</span>)
26: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">cli</span>
27: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;gemfile&quot;</span> <span class="ruby-keyword kw">then</span> <span class="ruby-identifier">command</span> = <span class="ruby-value str">&quot;gemfile.5&quot;</span>
28: <span class="ruby-keyword kw">when</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">then</span> <span class="ruby-identifier">command</span> = <span class="ruby-value str">&quot;bundle&quot;</span>
29: <span class="ruby-keyword kw">else</span> <span class="ruby-identifier">command</span> = <span class="ruby-node">&quot;bundle-#{cli}&quot;</span>
30: <span class="ruby-keyword kw">end</span>
31:
32: <span class="ruby-identifier">manpages</span> = <span class="ruby-node">%(
33: bundle
34: bundle-config
35: bundle-exec
36: bundle-install
37: bundle-package
38: bundle-update
39: gemfile.5)</span>
40:
41: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">manpages</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">command</span>)
42: <span class="ruby-identifier">root</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-value str">&quot;../man&quot;</span>, <span class="ruby-keyword kw">__FILE__</span>)
43:
44: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">have_groff?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">root</span> <span class="ruby-operator">!~</span> <span class="ruby-regexp re">%{^file:/.+!/META-INF/jruby.home/.+}</span>
45: <span class="ruby-identifier">groff</span> = <span class="ruby-value str">&quot;groff -Wall -mtty-char -mandoc -Tascii&quot;</span>
46: <span class="ruby-identifier">pager</span> = <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'MANPAGER'</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'PAGER'</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">'less -R'</span>
47:
48: <span class="ruby-constant">Kernel</span>.<span class="ruby-identifier">exec</span> <span class="ruby-node">&quot;#{groff} #{root}/#{command} | #{pager}&quot;</span>
49: <span class="ruby-keyword kw">else</span>
50: <span class="ruby-identifier">puts</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-node">&quot;#{root}/#{command}.txt&quot;</span>)
51: <span class="ruby-keyword kw">end</span>
52: <span class="ruby-keyword kw">else</span>
53: <span class="ruby-keyword kw">super</span>
54: <span class="ruby-keyword kw">end</span>
55: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="init-method" class="method-detail ">
<a name="method-i-init"></a>
<div class="method-heading">
<span class="method-name">init</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="init-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/cli.rb, line 64</span>
64: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">init</span>
65: <span class="ruby-identifier">opts</span> = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">dup</span>
66: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-value str">&quot;Gemfile&quot;</span>)
67: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">error</span> <span class="ruby-node">&quot;Gemfile already exists at #{Dir.pwd}/Gemfile&quot;</span>
68: <span class="ruby-identifier">exit</span> <span class="ruby-value">1</span>
69: <span class="ruby-keyword kw">end</span>
70:
71: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">opts</span>[<span class="ruby-value">:gemspec</span>]
72: <span class="ruby-identifier">gemspec</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">opts</span>[<span class="ruby-value">:gemspec</span>])
73: <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">gemspec</span>)
74: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">error</span> <span class="ruby-node">&quot;Gem specification #{gemspec} doesn't exist&quot;</span>
75: <span class="ruby-identifier">exit</span> <span class="ruby-value">1</span>
76: <span class="ruby-keyword kw">end</span>
77: <span class="ruby-identifier">spec</span> = <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Specification</span>.<span class="ruby-identifier">load</span>(<span class="ruby-identifier">gemspec</span>)
78: <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Writing new Gemfile to #{Dir.pwd}/Gemfile&quot;</span>
79: <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-value str">'Gemfile'</span>, <span class="ruby-value str">'wb'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
80: <span class="ruby-identifier">file</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;# Generated from #{gemspec}\n&quot;</span>
81: <span class="ruby-identifier">file</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">to_gemfile</span>
82: <span class="ruby-keyword kw">end</span>
83: <span class="ruby-keyword kw">else</span>
84: <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Writing new Gemfile to #{Dir.pwd}/Gemfile&quot;</span>
85: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">cp</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-value str">'../templates/Gemfile'</span>, <span class="ruby-keyword kw">__FILE__</span>), <span class="ruby-value str">'Gemfile'</span>)
86: <span class="ruby-keyword kw">end</span>
87: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="install-method" class="method-detail ">
<a name="method-i-install"></a>
<div class="method-heading">
<span class="method-name">install</span><span
class="method-args">(path = nil)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code"
id="install-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/cli.rb, line 153</span>
153: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">install</span>(<span class="ruby-identifier">path</span> = <span class="ruby-keyword kw">nil</span>)
154: <span class="ruby-identifier">opts</span> = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">dup</span>
155: <span class="ruby-identifier">opts</span>[<span class="ruby-value">:without</span>] <span class="ruby-operator">||=</span> []
156: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">opts</span>[<span class="ruby-value">:without</span>].<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
157: <span class="ruby-identifier">opts</span>[<span class="ruby-value">:without</span>].<span class="ruby-identifier">map!</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">g</span><span class="ruby-operator">|</span> <span class="ruby-identifier">g</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot; &quot;</span>) }
158: <span class="ruby-identifier">opts</span>[<span class="ruby-value">:without</span>].<span class="ruby-identifier">flatten!</span>
159: <span class="ruby-keyword kw">end</span>
160: <span class="ruby-identifier">opts</span>[<span class="ruby-value">:without</span>].<span class="ruby-identifier">map!</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">g</span><span class="ruby-operator">|</span> <span class="ruby-identifier">g</span>.<span class="ruby-identifier">to_sym</span> }
161:
162: <span class="ruby-comment cmt"># Can't use Bundler.settings for this because settings needs gemfile.dirname</span>
163: <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'BUNDLE_GEMFILE'</span>] = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">opts</span>[<span class="ruby-value">:gemfile</span>]) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">opts</span>[<span class="ruby-value">:gemfile</span>]
164: <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'RB_USER_INSTALL'</span>] = <span class="ruby-value str">'1'</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">FREEBSD</span>
2010-12-07 04:11:19 +01:00
165:
166: <span class="ruby-comment cmt"># Just disable color in deployment mode</span>
167: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">shell</span> = <span class="ruby-constant">Thor</span><span class="ruby-operator">::</span><span class="ruby-constant">Shell</span><span class="ruby-operator">::</span><span class="ruby-constant">Basic</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">opts</span>[<span class="ruby-value">:deployment</span>]
168:
169: <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">path</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">opts</span>[<span class="ruby-value">:path</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">opts</span>[<span class="ruby-value">:deployment</span>]) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">opts</span>[<span class="ruby-value">:system</span>]
170: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">error</span> <span class="ruby-value str">&quot;You have specified both a path to install your gems to, \n&quot;</span> <span class="ruby-value str">&quot;as well as --system. Please choose.&quot;</span>
171: <span class="ruby-identifier">exit</span> <span class="ruby-value">1</span>
172: <span class="ruby-keyword kw">end</span>
173:
174: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">path</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">opts</span>[<span class="ruby-value">:path</span>]
175: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">error</span> <span class="ruby-node">&quot;You have specified a path via `bundle install #{path}` as well as\n&quot;</span> <span class="ruby-node">&quot;by `bundle install --path #{options[:path]}`. These options are\n&quot;</span> <span class="ruby-value str">&quot;equivalent, so please use one or the other.&quot;</span>
176: <span class="ruby-identifier">exit</span> <span class="ruby-value">1</span>
177: <span class="ruby-keyword kw">end</span>
178:
179: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">opts</span>[<span class="ruby-value str">&quot;disable-shared-gems&quot;</span>]
180: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">error</span> <span class="ruby-value str">&quot;The disable-shared-gem option is no longer available.\n\n&quot;</span> <span class="ruby-value str">&quot;Instead, use `bundle install` to install to your system,\n&quot;</span> <span class="ruby-value str">&quot;or `bundle install --path path/to/gems` to install to an isolated\n&quot;</span> <span class="ruby-value str">&quot;location. Bundler will resolve relative paths relative to\n&quot;</span> <span class="ruby-value str">&quot;your `Gemfile`.&quot;</span>
181: <span class="ruby-identifier">exit</span> <span class="ruby-value">1</span>
182: <span class="ruby-keyword kw">end</span>
183:
184: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">opts</span>[<span class="ruby-value">:deployment</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">opts</span>[<span class="ruby-value">:frozen</span>]
185: <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">default_lockfile</span>.<span class="ruby-identifier">exist?</span>
186: <span class="ruby-identifier">flag</span> = <span class="ruby-identifier">opts</span>[<span class="ruby-value">:deployment</span>] <span class="ruby-operator">?</span> <span class="ruby-value str">'--deployment'</span> <span class="ruby-operator">:</span> <span class="ruby-value str">'--frozen'</span>
187: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ProductionError</span>, <span class="ruby-node">&quot;The #{flag} flag requires a Gemfile.lock. Please make &quot;</span> <span class="ruby-value str">&quot;sure you have checked your Gemfile.lock into version control &quot;</span> <span class="ruby-value str">&quot;before deploying.&quot;</span>
188: <span class="ruby-keyword kw">end</span>
189:
190: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">root</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;vendor/cache&quot;</span>).<span class="ruby-identifier">exist?</span>
191: <span class="ruby-identifier">opts</span>[<span class="ruby-value">:local</span>] = <span class="ruby-keyword kw">true</span>
192: <span class="ruby-keyword kw">end</span>
193:
194: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>[<span class="ruby-value">:frozen</span>] = <span class="ruby-value str">'1'</span>
195: <span class="ruby-keyword kw">end</span>
196:
197: <span class="ruby-comment cmt"># When install is called with --no-deployment, disable deployment mode</span>
198: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">opts</span>[<span class="ruby-value">:deployment</span>] <span class="ruby-operator">==</span> <span class="ruby-keyword kw">false</span>
199: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value">:frozen</span>)
200: <span class="ruby-identifier">opts</span>[<span class="ruby-value">:system</span>] = <span class="ruby-keyword kw">true</span>
201: <span class="ruby-keyword kw">end</span>
202:
203: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>[<span class="ruby-value">:path</span>] = <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">opts</span>[<span class="ruby-value">:system</span>]
204: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>[<span class="ruby-value">:path</span>] = <span class="ruby-value str">&quot;vendor/bundle&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">opts</span>[<span class="ruby-value">:deployment</span>]
205: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>[<span class="ruby-value">:path</span>] = <span class="ruby-identifier">path</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">path</span>
206: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>[<span class="ruby-value">:path</span>] = <span class="ruby-identifier">opts</span>[<span class="ruby-value">:path</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">opts</span>[<span class="ruby-value">:path</span>]
207: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>[<span class="ruby-value">:bin</span>] = <span class="ruby-identifier">opts</span>[<span class="ruby-value str">&quot;binstubs&quot;</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">opts</span>[<span class="ruby-value">:binstubs</span>]
208: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>[<span class="ruby-value">:no_prune</span>] = <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">opts</span>[<span class="ruby-value str">&quot;no-prune&quot;</span>]
209: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>[<span class="ruby-value">:disable_shared_gems</span>] = <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>[<span class="ruby-value">:path</span>] <span class="ruby-operator">?</span> <span class="ruby-value str">'1'</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">nil</span>
210: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>.<span class="ruby-identifier">without</span> = <span class="ruby-identifier">opts</span>[<span class="ruby-value">:without</span>] <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">opts</span>[<span class="ruby-value">:without</span>].<span class="ruby-identifier">empty?</span>
211: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">be_quiet!</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">opts</span>[<span class="ruby-value">:quiet</span>]
212:
213: <span class="ruby-constant">Installer</span>.<span class="ruby-identifier">install</span>(<span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">root</span>, <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">definition</span>, <span class="ruby-identifier">opts</span>)
214: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">load</span>.<span class="ruby-identifier">cache</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">root</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;vendor/cache&quot;</span>).<span class="ruby-identifier">exist?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">options</span>[<span class="ruby-value str">&quot;no-cache&quot;</span>]
215:
216: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>[<span class="ruby-value">:path</span>]
217: <span class="ruby-identifier">relative_path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>[<span class="ruby-value">:path</span>]).<span class="ruby-identifier">sub</span>(<span class="ruby-node">/^#{File.expand_path('.')}/</span>, <span class="ruby-value str">'.'</span>)
218: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">confirm</span> <span class="ruby-value str">&quot;Your bundle is complete! &quot;</span> <span class="ruby-operator">+</span>
219: <span class="ruby-node">&quot;It was installed into #{relative_path}&quot;</span>
220: <span class="ruby-keyword kw">else</span>
2010-12-07 04:11:19 +01:00
221: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">confirm</span> <span class="ruby-value str">&quot;Your bundle is complete! &quot;</span> <span class="ruby-operator">+</span>
222: <span class="ruby-value str">&quot;Use `bundle show [gemname]` to see where a bundled gem is installed.&quot;</span>
223: <span class="ruby-keyword kw">end</span>
224:
225: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">path</span>
226: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;The path argument to `bundle install` is deprecated. &quot;</span> <span class="ruby-operator">+</span>
227: <span class="ruby-value str">&quot;It will be removed in version 1.1. &quot;</span> <span class="ruby-operator">+</span>
228: <span class="ruby-node">&quot;Please use `bundle install --path #{path}` instead.&quot;</span>
229: <span class="ruby-keyword kw">end</span>
230: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">GemNotFound</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
231: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">opts</span>[<span class="ruby-value">:local</span>] <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">app_cache</span>.<span class="ruby-identifier">exist?</span>
232: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Some gems seem to be missing from your vendor/cache directory.&quot;</span>
233: <span class="ruby-keyword kw">end</span>
234:
235: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">definition</span>.<span class="ruby-identifier">no_sources?</span>
236: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Your Gemfile doesn't have any sources. You can add one with a line like 'source :rubygems'&quot;</span>
237: <span class="ruby-keyword kw">end</span>
238: <span class="ruby-identifier">raise</span> <span class="ruby-identifier">e</span>
239: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="lock-method" class="method-detail ">
<a name="method-i-lock"></a>
<div class="method-heading">
<span class="method-name">lock</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="lock-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/cli.rb, line 277</span>
277: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">lock</span>
278: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Lock is deprecated. Your bundle is now locked whenever you run `bundle install`.&quot;</span>
279: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="open-method" class="method-detail ">
<a name="method-i-open"></a>
<div class="method-heading">
<span class="method-name">open</span><span
class="method-args">(name)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code"
id="open-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/cli.rb, line 416</span>
416: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">open</span>(<span class="ruby-identifier">name</span>)
417: <span class="ruby-identifier">editor</span> = [<span class="ruby-constant">ENV</span>[<span class="ruby-value str">'BUNDLER_EDITOR'</span>], <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'VISUAL'</span>], <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'EDITOR'</span>]].<span class="ruby-identifier">find</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-operator">!</span><span class="ruby-identifier">e</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">e</span>.<span class="ruby-identifier">empty?</span> }
418: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">editor</span>
419: <span class="ruby-identifier">gem_path</span> = <span class="ruby-identifier">locate_gem</span>(<span class="ruby-identifier">name</span>)
420: <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">chdir</span>(<span class="ruby-identifier">gem_path</span>) <span class="ruby-keyword kw">do</span>
421: <span class="ruby-identifier">command</span> = <span class="ruby-node">&quot;#{editor} #{gem_path}&quot;</span>
422: <span class="ruby-identifier">success</span> = <span class="ruby-identifier">system</span>(<span class="ruby-identifier">command</span>)
423: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">info</span> <span class="ruby-node">&quot;Could not run '#{command}'&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">success</span>
424: <span class="ruby-keyword kw">end</span>
425: <span class="ruby-keyword kw">else</span>
426: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">info</span>(<span class="ruby-value str">&quot;To open a bundled gem, set $EDITOR or $BUNDLER_EDITOR&quot;</span>)
427: <span class="ruby-keyword kw">end</span>
428: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="package-method" class="method-detail ">
<a name="method-i-package"></a>
<div class="method-heading">
<span class="method-name">package</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="package-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/cli.rb, line 326</span>
326: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">package</span>
327: <span class="ruby-identifier">install</span>
328: <span class="ruby-comment cmt"># TODO: move cache contents here now that all bundles are locked</span>
329: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">load</span>.<span class="ruby-identifier">cache</span>
330: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="show-method" class="method-detail ">
<a name="method-i-show"></a>
<div class="method-heading">
<span class="method-name">show</span><span
class="method-args">(gem_name = nil)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code"
id="show-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/cli.rb, line 291</span>
291: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">show</span>(<span class="ruby-identifier">gem_name</span> = <span class="ruby-keyword kw">nil</span>)
292: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">load</span>.<span class="ruby-identifier">lock</span>
293:
294: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">gem_name</span>
295: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">info</span> <span class="ruby-identifier">locate_gem</span>(<span class="ruby-identifier">gem_name</span>)
296: <span class="ruby-keyword kw">else</span>
297: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">info</span> <span class="ruby-value str">&quot;Gems included by the bundle:&quot;</span>
298: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">load</span>.<span class="ruby-identifier">specs</span>.<span class="ruby-identifier">sort_by</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">name</span> }.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span>
299: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">info</span> <span class="ruby-node">&quot; * #{s.name} (#{s.version}#{s.git_version})&quot;</span>
300: <span class="ruby-keyword kw">end</span>
301: <span class="ruby-keyword kw">end</span>
302: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="unlock-method" class="method-detail ">
<a name="method-i-unlock"></a>
<div class="method-heading">
<span class="method-name">unlock</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="unlock-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/cli.rb, line 282</span>
282: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unlock</span>
283: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Unlock is deprecated. To update to newer gem versions, use `bundle update`.&quot;</span>
284: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="update-method" class="method-detail ">
<a name="method-i-update"></a>
<div class="method-heading">
<span class="method-name">update</span><span
class="method-args">(*gems)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code"
id="update-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/cli.rb, line 259</span>
259: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">update</span>(*<span class="ruby-identifier">gems</span>)
260: <span class="ruby-identifier">sources</span> = <span class="ruby-constant">Array</span>(<span class="ruby-identifier">options</span>[<span class="ruby-value">:source</span>])
261:
262: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">gems</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">sources</span>.<span class="ruby-identifier">empty?</span>
263: <span class="ruby-comment cmt"># We're doing a full update</span>
264: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">definition</span>(<span class="ruby-keyword kw">true</span>)
265: <span class="ruby-keyword kw">else</span>
266: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">definition</span>(<span class="ruby-value">:gems</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">gems</span>, <span class="ruby-value">:sources</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">sources</span>)
267: <span class="ruby-keyword kw">end</span>
268:
269: <span class="ruby-identifier">opts</span> = {<span class="ruby-value str">&quot;update&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>, <span class="ruby-value str">&quot;local&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">options</span>[<span class="ruby-value">:local</span>]}
270: <span class="ruby-constant">Installer</span>.<span class="ruby-identifier">install</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">root</span>, <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">definition</span>, <span class="ruby-identifier">opts</span>
271: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">load</span>.<span class="ruby-identifier">cache</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">root</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;vendor/cache&quot;</span>).<span class="ruby-identifier">exist?</span>
272: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">confirm</span> <span class="ruby-value str">&quot;Your bundle is updated! &quot;</span> <span class="ruby-operator">+</span>
273: <span class="ruby-value str">&quot;Use `bundle show [gemname]` to see where a bundled gem is installed.&quot;</span>
274: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="version-method" class="method-detail ">
<a name="method-i-version"></a>
<div class="method-heading">
<span class="method-name">version</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="version-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/cli.rb, line 440</span>
440: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">version</span>
441: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">info</span> <span class="ruby-node">&quot;Bundler version #{Bundler::VERSION}&quot;</span>
442: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="viz-method" class="method-detail ">
<a name="method-i-viz"></a>
<div class="method-heading">
<span class="method-name">viz</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="viz-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/cli.rb, line 454</span>
454: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">viz</span>
455: <span class="ruby-identifier">output_file</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">options</span>[<span class="ruby-value">:file</span>])
456: <span class="ruby-identifier">graph</span> = <span class="ruby-constant">Graph</span>.<span class="ruby-identifier">new</span>( <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">load</span> )
457:
458: <span class="ruby-keyword kw">begin</span>
459: <span class="ruby-identifier">graph</span>.<span class="ruby-identifier">viz</span>(<span class="ruby-identifier">output_file</span>, <span class="ruby-identifier">options</span>[<span class="ruby-value">:version</span>], <span class="ruby-identifier">options</span>[<span class="ruby-value">:requirements</span>])
460: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">info</span> <span class="ruby-identifier">output_file</span>
461: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">LoadError</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
462: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">error</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">inspect</span>
463: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;Make sure you have the graphviz ruby gem. You can install it with:&quot;</span>
464: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;`gem install ruby-graphviz`&quot;</span>
465: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">StandardError</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
466: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">message</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/GraphViz not installed or dot not in PATH/</span>
467: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">error</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">message</span>
468: <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">warn</span> <span class="ruby-value str">&quot;The ruby graphviz gem requires GraphViz to be installed&quot;</span>
469: <span class="ruby-keyword kw">else</span>
470: <span class="ruby-identifier">raise</span>
471: <span class="ruby-keyword kw">end</span>
472: <span class="ruby-keyword kw">end</span>
473: <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="have-groff--method" class="method-detail ">
<a name="method-i-have_groff%3F"></a>
<div class="method-heading">
<span class="method-name">have_groff?</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="have-groff--source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/cli.rb, line 507</span>
507: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">have_groff?</span>
508: <span class="ruby-operator">!</span>(<span class="ruby-value">`which groff`</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-value str">''</span>).<span class="ruby-identifier">empty?</span>
509: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="locate-gem-method" class="method-detail ">
<a name="method-i-locate_gem"></a>
<div class="method-heading">
<span class="method-name">locate_gem</span><span
class="method-args">(name)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code"
id="locate-gem-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/cli.rb, line 511</span>
511: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">locate_gem</span>(<span class="ruby-identifier">name</span>)
512: <span class="ruby-identifier">spec</span> = <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">load</span>.<span class="ruby-identifier">specs</span>.<span class="ruby-identifier">find</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">name</span> }
513: <span class="ruby-identifier">raise</span> <span class="ruby-constant">GemNotFound</span>, <span class="ruby-node">&quot;Could not find gem '#{name}' in the current bundle.&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">spec</span>
514: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">name</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'bundler'</span>
515: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-value str">'../../../'</span>, <span class="ruby-keyword kw">__FILE__</span>)
516: <span class="ruby-keyword kw">end</span>
517: <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">full_gem_path</span>
518: <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>