instiki/vendor/plugins/bundler/doc/bundler-1.0.0/rdoc/Bundler/Definition.html
Jacques Distler 4bf2e0d944 Bundler
Remove the vendored sqlite3-ruby.
Instead, add support for Bundler
(which is vendored).

Before running the new Instiki,
do a 

   ruby bundle

which will install all of the needed gems
locally. (If you need to, tweak the contents
of Gemfile.)
2010-09-24 22:36:30 -05:00

1724 lines
87 KiB
HTML

<?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::Definition</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/definition_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
class="thickbox" title="lib/bundler/definition.rb">lib/bundler/definition.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-build">::build</a></li>
<li><a href="#method-c-new">::new</a></li>
<li><a href="#method-i-converge_dependencies">#converge_dependencies</a></li>
<li><a href="#method-i-converge_locked_specs">#converge_locked_specs</a></li>
<li><a href="#method-i-converge_sources">#converge_sources</a></li>
<li><a href="#method-i-current_dependencies">#current_dependencies</a></li>
<li><a href="#method-i-ensure_equivalent_gemfile_and_lockfile">#ensure_equivalent_gemfile_and_lockfile</a></li>
<li><a href="#method-i-expand_dependencies">#expand_dependencies</a></li>
<li><a href="#method-i-expanded_dependencies">#expanded_dependencies</a></li>
<li><a href="#method-i-groups">#groups</a></li>
<li><a href="#method-i-in_locked_deps%3F">#in_locked_deps?</a></li>
<li><a href="#method-i-index">#index</a></li>
<li><a href="#method-i-lock">#lock</a></li>
<li><a href="#method-i-missing_specs">#missing_specs</a></li>
<li><a href="#method-i-new_platform%3F">#new_platform?</a></li>
<li><a href="#method-i-new_specs">#new_specs</a></li>
<li><a href="#method-i-no_sources%3F">#no_sources?</a></li>
<li><a href="#method-i-pretty_dep">#pretty_dep</a></li>
<li><a href="#method-i-removed_specs">#removed_specs</a></li>
<li><a href="#method-i-requested_dependencies">#requested_dependencies</a></li>
<li><a href="#method-i-requested_specs">#requested_specs</a></li>
<li><a href="#method-i-resolve">#resolve</a></li>
<li><a href="#method-i-resolve_remotely%21">#resolve_remotely!</a></li>
<li><a href="#method-i-resolve_with_cache%21">#resolve_with_cache!</a></li>
<li><a href="#method-i-satisfies_locked_spec%3F">#satisfies_locked_spec?</a></li>
<li><a href="#method-i-sorted_sources">#sorted_sources</a></li>
<li><a href="#method-i-specs">#specs</a></li>
<li><a href="#method-i-specs_for">#specs_for</a></li>
<li><a href="#method-i-to_lock">#to_lock</a></li>
</ul>
</div>
<!-- Included Modules -->
<div id="includes-section" class="section">
<h3 class="section-header">Included Modules</h3>
<ul class="link-list">
<li><span class="include">GemHelpers</span></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-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>
<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>
<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::Definition</h1>
<div id="description">
</div>
<!-- Constants -->
<!-- Attributes -->
<div id="attribute-method-details" class="method-section section">
<h3 class="section-header">Attributes</h3>
<div id="dependencies-attribute-method" class="method-detail">
<a name="dependencies"></a>
<div class="method-heading attribute-method-heading">
<span class="method-name">dependencies</span><span
class="attribute-access-type">[R]</span>
</div>
<div class="method-description">
</div>
</div>
<div id="platforms-attribute-method" class="method-detail">
<a name="platforms"></a>
<div class="method-heading attribute-method-heading">
<span class="method-name">platforms</span><span
class="attribute-access-type">[R]</span>
</div>
<div class="method-description">
</div>
</div>
<div id="sources-attribute-method" class="method-detail">
<a name="sources"></a>
<div class="method-heading attribute-method-heading">
<span class="method-name">sources</span><span
class="attribute-access-type">[R]</span>
</div>
<div class="method-description">
</div>
</div>
</div>
<!-- Methods -->
<div id="public-class-method-details" class="method-section section">
<h3 class="section-header">Public Class Methods</h3>
<div id="build-method" class="method-detail ">
<a name="method-c-build"></a>
<div class="method-heading">
<span class="method-name">build</span><span
class="method-args">(gemfile, lockfile, unlock)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code"
id="build-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 9</span>
9: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">build</span>(<span class="ruby-identifier">gemfile</span>, <span class="ruby-identifier">lockfile</span>, <span class="ruby-identifier">unlock</span>)
10: <span class="ruby-identifier">unlock</span> <span class="ruby-operator">||=</span> {}
11: <span class="ruby-identifier">gemfile</span> = <span class="ruby-constant">Pathname</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">gemfile</span>).<span class="ruby-identifier">expand_path</span>
12:
13: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">gemfile</span>.<span class="ruby-identifier">file?</span>
14: <span class="ruby-identifier">raise</span> <span class="ruby-constant">GemfileNotFound</span>, <span class="ruby-node">&quot;#{gemfile} not found&quot;</span>
15: <span class="ruby-keyword kw">end</span>
16:
17: <span class="ruby-comment cmt"># TODO: move this back into DSL</span>
18: <span class="ruby-identifier">builder</span> = <span class="ruby-constant">Dsl</span>.<span class="ruby-identifier">new</span>
19: <span class="ruby-identifier">builder</span>.<span class="ruby-identifier">instance_eval</span>(<span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">read_file</span>(<span class="ruby-identifier">gemfile</span>.<span class="ruby-identifier">to_s</span>), <span class="ruby-identifier">gemfile</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-value">1</span>)
20: <span class="ruby-identifier">builder</span>.<span class="ruby-identifier">to_definition</span>(<span class="ruby-identifier">lockfile</span>, <span class="ruby-identifier">unlock</span>)
21: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<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">(lockfile, dependencies, sources, unlock)</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/definition.rb, line 35</span>
35: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">lockfile</span>, <span class="ruby-identifier">dependencies</span>, <span class="ruby-identifier">sources</span>, <span class="ruby-identifier">unlock</span>)
36: <span class="ruby-ivar">@dependencies</span>, <span class="ruby-ivar">@sources</span>, <span class="ruby-ivar">@unlock</span> = <span class="ruby-identifier">dependencies</span>, <span class="ruby-identifier">sources</span>, <span class="ruby-identifier">unlock</span>
37: <span class="ruby-ivar">@remote</span> = <span class="ruby-keyword kw">false</span>
38: <span class="ruby-ivar">@specs</span> = <span class="ruby-keyword kw">nil</span>
39: <span class="ruby-ivar">@lockfile_contents</span> = <span class="ruby-value str">&quot;&quot;</span>
40:
41: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">lockfile</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-identifier">lockfile</span>)
42: <span class="ruby-ivar">@lockfile_contents</span> = <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">read_file</span>(<span class="ruby-identifier">lockfile</span>)
43: <span class="ruby-identifier">locked</span> = <span class="ruby-constant">LockfileParser</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@lockfile_contents</span>)
44: <span class="ruby-ivar">@platforms</span> = <span class="ruby-identifier">locked</span>.<span class="ruby-identifier">platforms</span>
45:
46: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">unlock</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">true</span>
47: <span class="ruby-ivar">@locked_deps</span> = <span class="ruby-identifier">locked</span>.<span class="ruby-identifier">dependencies</span>
48: <span class="ruby-ivar">@locked_specs</span> = <span class="ruby-constant">SpecSet</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">locked</span>.<span class="ruby-identifier">specs</span>)
49: <span class="ruby-ivar">@locked_sources</span> = <span class="ruby-identifier">locked</span>.<span class="ruby-identifier">sources</span>
50: <span class="ruby-keyword kw">else</span>
51: <span class="ruby-ivar">@unlock</span> = {}
52: <span class="ruby-ivar">@locked_deps</span> = []
53: <span class="ruby-ivar">@locked_specs</span> = <span class="ruby-constant">SpecSet</span>.<span class="ruby-identifier">new</span>([])
54: <span class="ruby-ivar">@locked_sources</span> = []
55: <span class="ruby-keyword kw">end</span>
56: <span class="ruby-keyword kw">else</span>
57: <span class="ruby-ivar">@unlock</span> = {}
58: <span class="ruby-ivar">@platforms</span> = []
59: <span class="ruby-ivar">@locked_deps</span> = []
60: <span class="ruby-ivar">@locked_specs</span> = <span class="ruby-constant">SpecSet</span>.<span class="ruby-identifier">new</span>([])
61: <span class="ruby-ivar">@locked_sources</span> = []
62: <span class="ruby-keyword kw">end</span>
63:
64: <span class="ruby-ivar">@unlock</span>[<span class="ruby-value">:gems</span>] <span class="ruby-operator">||=</span> []
65: <span class="ruby-ivar">@unlock</span>[<span class="ruby-value">:sources</span>] <span class="ruby-operator">||=</span> []
66:
67: <span class="ruby-identifier">current_platform</span> = <span class="ruby-constant">Gem</span>.<span class="ruby-identifier">platforms</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">generic</span>(<span class="ruby-identifier">p</span>) }.<span class="ruby-identifier">compact</span>.<span class="ruby-identifier">last</span>
68: <span class="ruby-ivar">@new_platform</span> = <span class="ruby-operator">!</span><span class="ruby-ivar">@platforms</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">current_platform</span>)
69: <span class="ruby-ivar">@platforms</span> <span class="ruby-operator">|=</span> [<span class="ruby-identifier">current_platform</span>]
70:
71: <span class="ruby-identifier">eager_unlock</span> = <span class="ruby-identifier">expand_dependencies</span>(<span class="ruby-ivar">@unlock</span>[<span class="ruby-value">:gems</span>])
72: <span class="ruby-ivar">@unlock</span>[<span class="ruby-value">:gems</span>] = <span class="ruby-ivar">@locked_specs</span>.<span class="ruby-identifier">for</span>(<span class="ruby-identifier">eager_unlock</span>).<span class="ruby-identifier">map</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> }
73:
74: <span class="ruby-identifier">converge_sources</span>
75: <span class="ruby-identifier">converge_dependencies</span>
76: <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="current-dependencies-method" class="method-detail ">
<a name="method-i-current_dependencies"></a>
<div class="method-heading">
<span class="method-name">current_dependencies</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="current-dependencies-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 130</span>
130: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">current_dependencies</span>
131: <span class="ruby-identifier">dependencies</span>.<span class="ruby-identifier">reject</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">d</span><span class="ruby-operator">|</span> <span class="ruby-operator">!</span><span class="ruby-identifier">d</span>.<span class="ruby-identifier">should_include?</span> }
132: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="ensure-equivalent-gemfile-and-lockfile-method" class="method-detail ">
<a name="method-i-ensure_equivalent_gemfile_and_lockfile"></a>
<div class="method-heading">
<span class="method-name">ensure_equivalent_gemfile_and_lockfile</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="ensure-equivalent-gemfile-and-lockfile-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 230</span>
230: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ensure_equivalent_gemfile_and_lockfile</span>
231: <span class="ruby-identifier">changes</span> = <span class="ruby-keyword kw">false</span>
232:
233: <span class="ruby-identifier">msg</span> = <span class="ruby-value str">&quot;You have modified your Gemfile in development but did not check\n&quot;</span> <span class="ruby-value str">&quot;the resulting snapshot (Gemfile.lock) into version control&quot;</span>
234:
235: <span class="ruby-identifier">added</span> = []
236: <span class="ruby-identifier">deleted</span> = []
237: <span class="ruby-identifier">changed</span> = []
238:
239: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@locked_sources</span> <span class="ruby-operator">!=</span> <span class="ruby-ivar">@sources</span>
240: <span class="ruby-identifier">new_sources</span> = <span class="ruby-ivar">@sources</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@locked_sources</span>
241: <span class="ruby-identifier">deleted_sources</span> = <span class="ruby-ivar">@locked_sources</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@sources</span>
242:
243: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">new_sources</span>.<span class="ruby-identifier">any?</span>
244: <span class="ruby-identifier">added</span>.<span class="ruby-identifier">concat</span> <span class="ruby-identifier">new_sources</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">source</span><span class="ruby-operator">|</span> <span class="ruby-node">&quot;* source: #{source}&quot;</span> }
245: <span class="ruby-keyword kw">end</span>
246:
247: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">deleted_sources</span>.<span class="ruby-identifier">any?</span>
248: <span class="ruby-identifier">deleted</span>.<span class="ruby-identifier">concat</span> <span class="ruby-identifier">deleted_sources</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">source</span><span class="ruby-operator">|</span> <span class="ruby-node">&quot;* source: #{source}&quot;</span> }
249: <span class="ruby-keyword kw">end</span>
250:
251: <span class="ruby-identifier">changes</span> = <span class="ruby-keyword kw">true</span>
252: <span class="ruby-keyword kw">end</span>
253:
254: <span class="ruby-identifier">both_sources</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">h</span>,<span class="ruby-identifier">k</span><span class="ruby-operator">|</span> <span class="ruby-identifier">h</span>[<span class="ruby-identifier">k</span>] = [<span class="ruby-value str">&quot;no specified source&quot;</span>, <span class="ruby-value str">&quot;no specified source&quot;</span>] }
255: <span class="ruby-ivar">@dependencies</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">d</span><span class="ruby-operator">|</span> <span class="ruby-identifier">both_sources</span>[<span class="ruby-identifier">d</span>.<span class="ruby-identifier">name</span>][<span class="ruby-value">0</span>] = <span class="ruby-identifier">d</span>.<span class="ruby-identifier">source</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">d</span>.<span class="ruby-identifier">source</span> }
256: <span class="ruby-ivar">@locked_deps</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">d</span><span class="ruby-operator">|</span> <span class="ruby-identifier">both_sources</span>[<span class="ruby-identifier">d</span>.<span class="ruby-identifier">name</span>][<span class="ruby-value">1</span>] = <span class="ruby-identifier">d</span>.<span class="ruby-identifier">source</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">d</span>.<span class="ruby-identifier">source</span> }
257: <span class="ruby-identifier">both_sources</span>.<span class="ruby-identifier">delete_if</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">v</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">v</span>[<span class="ruby-value">1</span>] }
258:
259: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@dependencies</span> <span class="ruby-operator">!=</span> <span class="ruby-ivar">@locked_deps</span>
260: <span class="ruby-identifier">new_deps</span> = <span class="ruby-ivar">@dependencies</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@locked_deps</span>
261: <span class="ruby-identifier">deleted_deps</span> = <span class="ruby-ivar">@locked_deps</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@dependencies</span>
262:
263: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">new_deps</span>.<span class="ruby-identifier">any?</span>
264: <span class="ruby-identifier">added</span>.<span class="ruby-identifier">concat</span> <span class="ruby-identifier">new_deps</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">d</span><span class="ruby-operator">|</span> <span class="ruby-node">&quot;* #{pretty_dep(d)}&quot;</span> }
265: <span class="ruby-keyword kw">end</span>
266:
267: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">deleted_deps</span>.<span class="ruby-identifier">any?</span>
268: <span class="ruby-identifier">deleted</span>.<span class="ruby-identifier">concat</span> <span class="ruby-identifier">deleted_deps</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">d</span><span class="ruby-operator">|</span> <span class="ruby-node">&quot;* #{pretty_dep(d)}&quot;</span> }
269: <span class="ruby-keyword kw">end</span>
270:
271: <span class="ruby-identifier">both_sources</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span>, <span class="ruby-identifier">sources</span><span class="ruby-operator">|</span>
272: <span class="ruby-identifier">changed</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;* #{name} from `#{sources[0]}` to `#{sources[1]}`&quot;</span>
273: <span class="ruby-keyword kw">end</span>
274:
275: <span class="ruby-identifier">changes</span> = <span class="ruby-keyword kw">true</span>
276: <span class="ruby-keyword kw">end</span>
277:
278: <span class="ruby-identifier">msg</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;\n\nYou have added to the Gemfile:\n&quot;</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">added</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;\n&quot;</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">added</span>.<span class="ruby-identifier">any?</span>
279: <span class="ruby-identifier">msg</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;\n\nYou have deleted from the Gemfile:\n&quot;</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">deleted</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;\n&quot;</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">deleted</span>.<span class="ruby-identifier">any?</span>
280: <span class="ruby-identifier">msg</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;\n\nYou have changed in the Gemfile:\n&quot;</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">changed</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;\n&quot;</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">changed</span>.<span class="ruby-identifier">any?</span>
281:
282: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ProductionError</span>, <span class="ruby-identifier">msg</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">added</span>.<span class="ruby-identifier">any?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">deleted</span>.<span class="ruby-identifier">any?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">changed</span>.<span class="ruby-identifier">any?</span>
283: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="groups-method" class="method-detail ">
<a name="method-i-groups"></a>
<div class="method-heading">
<span class="method-name">groups</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="groups-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 170</span>
170: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">groups</span>
171: <span class="ruby-identifier">dependencies</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">d</span><span class="ruby-operator">|</span> <span class="ruby-identifier">d</span>.<span class="ruby-identifier">groups</span> }.<span class="ruby-identifier">flatten</span>.<span class="ruby-identifier">uniq</span>
172: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="index-method" class="method-detail ">
<a name="method-i-index"></a>
<div class="method-heading">
<span class="method-name">index</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="index-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 158</span>
158: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">index</span>
159: <span class="ruby-ivar">@index</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Index</span>.<span class="ruby-identifier">build</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">idx</span><span class="ruby-operator">|</span>
160: <span class="ruby-ivar">@sources</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>
161: <span class="ruby-identifier">idx</span>.<span class="ruby-identifier">use</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">specs</span>
162: <span class="ruby-keyword kw">end</span>
163: <span class="ruby-keyword kw">end</span>
164: <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">(file)</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/definition.rb, line 174</span>
174: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">lock</span>(<span class="ruby-identifier">file</span>)
175: <span class="ruby-identifier">contents</span> = <span class="ruby-identifier">to_lock</span>
176:
177: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@lockfile_contents</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">contents</span>
178:
179: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>[<span class="ruby-value">:frozen</span>]
180: <span class="ruby-comment cmt"># TODO: Warn here if we got here.</span>
181: <span class="ruby-keyword kw">return</span>
182: <span class="ruby-keyword kw">end</span>
183:
184: <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">file</span>, <span class="ruby-value str">'wb'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
185: <span class="ruby-identifier">f</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">contents</span>
186: <span class="ruby-keyword kw">end</span>
187: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="missing-specs-method" class="method-detail ">
<a name="method-i-missing_specs"></a>
<div class="method-heading">
<span class="method-name">missing_specs</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="missing-specs-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 116</span>
116: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">missing_specs</span>
117: <span class="ruby-identifier">missing</span> = []
118: <span class="ruby-identifier">resolve</span>.<span class="ruby-identifier">materialize</span>(<span class="ruby-identifier">requested_dependencies</span>, <span class="ruby-identifier">missing</span>)
119: <span class="ruby-identifier">missing</span>
120: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="new-platform--method" class="method-detail ">
<a name="method-i-new_platform%3F"></a>
<div class="method-heading">
<span class="method-name">new_platform?</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-platform--source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 112</span>
112: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">new_platform?</span>
113: <span class="ruby-ivar">@new_platform</span>
114: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="new-specs-method" class="method-detail ">
<a name="method-i-new_specs"></a>
<div class="method-heading">
<span class="method-name">new_specs</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-specs-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 104</span>
104: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">new_specs</span>
105: <span class="ruby-identifier">specs</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@locked_specs</span>
106: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="no-sources--method" class="method-detail ">
<a name="method-i-no_sources%3F"></a>
<div class="method-heading">
<span class="method-name">no_sources?</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="no-sources--source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 166</span>
166: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">no_sources?</span>
167: <span class="ruby-ivar">@sources</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@sources</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">remotes</span>.<span class="ruby-identifier">empty?</span>
168: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="removed-specs-method" class="method-detail ">
<a name="method-i-removed_specs"></a>
<div class="method-heading">
<span class="method-name">removed_specs</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="removed-specs-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 108</span>
108: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">removed_specs</span>
109: <span class="ruby-ivar">@locked_specs</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">specs</span>
110: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="requested-specs-method" class="method-detail ">
<a name="method-i-requested_specs"></a>
<div class="method-heading">
<span class="method-name">requested_specs</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="requested-specs-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 122</span>
122: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">requested_specs</span>
123: <span class="ruby-ivar">@requested_specs</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword kw">begin</span>
124: <span class="ruby-identifier">groups</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">groups</span> <span class="ruby-operator">-</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>.<span class="ruby-identifier">without</span>
125: <span class="ruby-identifier">groups</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> }
126: <span class="ruby-identifier">specs_for</span>(<span class="ruby-identifier">groups</span>)
127: <span class="ruby-keyword kw">end</span>
128: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="resolve-method" class="method-detail ">
<a name="method-i-resolve"></a>
<div class="method-heading">
<span class="method-name">resolve</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="resolve-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 140</span>
140: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">resolve</span>
141: <span class="ruby-ivar">@resolve</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword kw">begin</span>
142: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>[<span class="ruby-value">:frozen</span>]
143: <span class="ruby-ivar">@locked_specs</span>
144: <span class="ruby-keyword kw">else</span>
145: <span class="ruby-identifier">last_resolve</span> = <span class="ruby-identifier">converge_locked_specs</span>
146: <span class="ruby-identifier">source_requirements</span> = {}
147: <span class="ruby-identifier">dependencies</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">dep</span><span class="ruby-operator">|</span>
148: <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">dep</span>.<span class="ruby-identifier">source</span>
149: <span class="ruby-identifier">source_requirements</span>[<span class="ruby-identifier">dep</span>.<span class="ruby-identifier">name</span>] = <span class="ruby-identifier">dep</span>.<span class="ruby-identifier">source</span>.<span class="ruby-identifier">specs</span>
150: <span class="ruby-keyword kw">end</span>
151:
152: <span class="ruby-comment cmt"># Run a resolve against the locally available gems</span>
153: <span class="ruby-identifier">last_resolve</span>.<span class="ruby-identifier">merge</span> <span class="ruby-constant">Resolver</span>.<span class="ruby-identifier">resolve</span>(<span class="ruby-identifier">expanded_dependencies</span>, <span class="ruby-identifier">index</span>, <span class="ruby-identifier">source_requirements</span>, <span class="ruby-identifier">last_resolve</span>)
154: <span class="ruby-keyword kw">end</span>
155: <span class="ruby-keyword kw">end</span>
156: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="resolve-remotely--method" class="method-detail ">
<a name="method-i-resolve_remotely%21"></a>
<div class="method-heading">
<span class="method-name">resolve_remotely!</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="resolve-remotely--source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 84</span>
84: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">resolve_remotely!</span>
85: <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Specs already loaded&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@specs</span>
86: <span class="ruby-ivar">@remote</span> = <span class="ruby-keyword kw">true</span>
87: <span class="ruby-ivar">@sources</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-identifier">s</span>.<span class="ruby-identifier">remote!</span> }
88: <span class="ruby-identifier">specs</span>
89: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="resolve-with-cache--method" class="method-detail ">
<a name="method-i-resolve_with_cache%21"></a>
<div class="method-heading">
<span class="method-name">resolve_with_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="resolve-with-cache--source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 78</span>
78: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">resolve_with_cache!</span>
79: <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Specs already loaded&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@specs</span>
80: <span class="ruby-ivar">@sources</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-identifier">s</span>.<span class="ruby-identifier">cached!</span> }
81: <span class="ruby-identifier">specs</span>
82: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="specs-method" class="method-detail ">
<a name="method-i-specs"></a>
<div class="method-heading">
<span class="method-name">specs</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="specs-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 91</span>
91: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">specs</span>
92: <span class="ruby-ivar">@specs</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword kw">begin</span>
93: <span class="ruby-identifier">specs</span> = <span class="ruby-identifier">resolve</span>.<span class="ruby-identifier">materialize</span>(<span class="ruby-identifier">requested_dependencies</span>)
94:
95: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">specs</span>[<span class="ruby-value str">&quot;bundler&quot;</span>].<span class="ruby-identifier">any?</span>
96: <span class="ruby-identifier">bundler</span> = <span class="ruby-identifier">index</span>.<span class="ruby-identifier">search</span>(<span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Dependency</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">'bundler'</span>, <span class="ruby-constant">VERSION</span>)).<span class="ruby-identifier">last</span>
97: <span class="ruby-identifier">specs</span>[<span class="ruby-value str">&quot;bundler&quot;</span>] = <span class="ruby-identifier">bundler</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">bundler</span>
98: <span class="ruby-keyword kw">end</span>
99:
100: <span class="ruby-identifier">specs</span>
101: <span class="ruby-keyword kw">end</span>
102: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="specs-for-method" class="method-detail ">
<a name="method-i-specs_for"></a>
<div class="method-heading">
<span class="method-name">specs_for</span><span
class="method-args">(groups)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code"
id="specs-for-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 134</span>
134: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">specs_for</span>(<span class="ruby-identifier">groups</span>)
135: <span class="ruby-identifier">deps</span> = <span class="ruby-identifier">dependencies</span>.<span class="ruby-identifier">select</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">d</span><span class="ruby-operator">|</span> (<span class="ruby-identifier">d</span>.<span class="ruby-identifier">groups</span> &amp; <span class="ruby-identifier">groups</span>).<span class="ruby-identifier">any?</span> }
136: <span class="ruby-identifier">deps</span>.<span class="ruby-identifier">delete_if</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">d</span><span class="ruby-operator">|</span> <span class="ruby-operator">!</span><span class="ruby-identifier">d</span>.<span class="ruby-identifier">should_include?</span> }
137: <span class="ruby-identifier">specs</span>.<span class="ruby-identifier">for</span>(<span class="ruby-identifier">expand_dependencies</span>(<span class="ruby-identifier">deps</span>))
138: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="to-lock-method" class="method-detail ">
<a name="method-i-to_lock"></a>
<div class="method-heading">
<span class="method-name">to_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="to-lock-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 189</span>
189: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_lock</span>
190: <span class="ruby-identifier">out</span> = <span class="ruby-value str">&quot;&quot;</span>
191:
192: <span class="ruby-identifier">sorted_sources</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">source</span><span class="ruby-operator">|</span>
193: <span class="ruby-comment cmt"># Add the source header</span>
194: <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">source</span>.<span class="ruby-identifier">to_lock</span>
195: <span class="ruby-comment cmt"># Find all specs for this source</span>
196: <span class="ruby-identifier">resolve</span>.
197: <span class="ruby-identifier">select</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">source</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">source</span> }.
198: <span class="ruby-comment cmt"># This needs to be sorted by full name so that</span>
199: <span class="ruby-comment cmt"># gems with the same name, but different platform</span>
200: <span class="ruby-comment cmt"># are ordered consistantly</span>
201: <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">full_name</span> }.
202: <span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">spec</span><span class="ruby-operator">|</span>
203: <span class="ruby-keyword kw">next</span> <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>
204: <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">to_lock</span>
205: <span class="ruby-keyword kw">end</span>
206: <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;\n&quot;</span>
207: <span class="ruby-keyword kw">end</span>
208:
209: <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;PLATFORMS\n&quot;</span>
210:
211: <span class="ruby-identifier">platforms</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">to_s</span> }.<span class="ruby-identifier">sort</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span>
212: <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot; #{p}\n&quot;</span>
213: <span class="ruby-keyword kw">end</span>
214:
215: <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;\n&quot;</span>
216: <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;DEPENDENCIES\n&quot;</span>
217:
218: <span class="ruby-identifier">handled</span> = []
219: <span class="ruby-identifier">dependencies</span>.
220: <span class="ruby-identifier">sort_by</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">d</span><span class="ruby-operator">|</span> <span class="ruby-identifier">d</span>.<span class="ruby-identifier">name</span> }.
221: <span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">dep</span><span class="ruby-operator">|</span>
222: <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">handled</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">dep</span>.<span class="ruby-identifier">name</span>)
223: <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">dep</span>.<span class="ruby-identifier">to_lock</span>
224: <span class="ruby-identifier">handled</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">dep</span>.<span class="ruby-identifier">name</span>
225: <span class="ruby-keyword kw">end</span>
226:
227: <span class="ruby-identifier">out</span>
228: <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="converge-dependencies-method" class="method-detail ">
<a name="method-i-converge_dependencies"></a>
<div class="method-heading">
<span class="method-name">converge_dependencies</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="converge-dependencies-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 312</span>
312: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">converge_dependencies</span>
313: (<span class="ruby-ivar">@dependencies</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@locked_deps</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">dep</span><span class="ruby-operator">|</span>
314: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">dep</span>.<span class="ruby-identifier">source</span>
315: <span class="ruby-identifier">dep</span>.<span class="ruby-identifier">source</span> = <span class="ruby-ivar">@sources</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">dep</span>.<span class="ruby-identifier">source</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">s</span> }
316: <span class="ruby-keyword kw">end</span>
317: <span class="ruby-keyword kw">end</span>
318: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="converge-locked-specs-method" class="method-detail ">
<a name="method-i-converge_locked_specs"></a>
<div class="method-heading">
<span class="method-name">converge_locked_specs</span><span
class="method-args">()</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<p>
Remove elements from the locked specs that are expired. This will most
commonly happen if the Gemfile has changed since the lockfile was last
generated
</p>
<div class="method-source-code"
id="converge-locked-specs-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 323</span>
323: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">converge_locked_specs</span>
324: <span class="ruby-identifier">deps</span> = []
325:
326: <span class="ruby-comment cmt"># Build a list of dependencies that are the same in the Gemfile</span>
327: <span class="ruby-comment cmt"># and Gemfile.lock. If the Gemfile modified a dependency, but</span>
328: <span class="ruby-comment cmt"># the gem in the Gemfile.lock still satisfies it, this is fine</span>
329: <span class="ruby-comment cmt"># too.</span>
330: <span class="ruby-ivar">@dependencies</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">dep</span><span class="ruby-operator">|</span>
331: <span class="ruby-identifier">locked_dep</span> = <span class="ruby-ivar">@locked_deps</span>.<span class="ruby-identifier">find</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">d</span><span class="ruby-operator">|</span> <span class="ruby-identifier">dep</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">d</span> }
332:
333: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">in_locked_deps?</span>(<span class="ruby-identifier">dep</span>, <span class="ruby-identifier">locked_dep</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">satisfies_locked_spec?</span>(<span class="ruby-identifier">dep</span>)
334: <span class="ruby-identifier">deps</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">dep</span>
335: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">dep</span>.<span class="ruby-identifier">source</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Source</span><span class="ruby-operator">::</span><span class="ruby-constant">Path</span>) <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-operator">!</span><span class="ruby-identifier">locked_dep</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">dep</span>.<span class="ruby-identifier">source</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">locked_dep</span>.<span class="ruby-identifier">source</span>)
336: <span class="ruby-ivar">@locked_specs</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>
337: <span class="ruby-ivar">@unlock</span>[<span class="ruby-value">:gems</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">name</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">source</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">dep</span>.<span class="ruby-identifier">source</span>
338: <span class="ruby-keyword kw">end</span>
339:
340: <span class="ruby-identifier">dep</span>.<span class="ruby-identifier">source</span>.<span class="ruby-identifier">unlock!</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">dep</span>.<span class="ruby-identifier">source</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:unlock!</span>)
341: <span class="ruby-identifier">dep</span>.<span class="ruby-identifier">source</span>.<span class="ruby-identifier">specs</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-ivar">@unlock</span>[<span class="ruby-value">:gems</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">name</span> }
342: <span class="ruby-keyword kw">end</span>
343: <span class="ruby-keyword kw">end</span>
344:
345: <span class="ruby-identifier">converged</span> = []
346: <span class="ruby-ivar">@locked_specs</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>
347: <span class="ruby-identifier">s</span>.<span class="ruby-identifier">source</span> = <span class="ruby-ivar">@sources</span>.<span class="ruby-identifier">find</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">src</span><span class="ruby-operator">|</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">source</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">src</span> }
348:
349: <span class="ruby-comment cmt"># Don't add a spec to the list if its source is expired. For example,</span>
350: <span class="ruby-comment cmt"># if you change a Git gem to Rubygems.</span>
351: <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">source</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-ivar">@unlock</span>[<span class="ruby-value">:sources</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">s</span>.<span class="ruby-identifier">name</span>)
352: <span class="ruby-comment cmt"># If the spec is from a path source and it doesn't exist anymore</span>
353: <span class="ruby-comment cmt"># then we just unlock it.</span>
354:
355: <span class="ruby-comment cmt"># Path sources have special logic</span>
356: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">source</span>.<span class="ruby-identifier">instance_of?</span>(<span class="ruby-constant">Source</span><span class="ruby-operator">::</span><span class="ruby-constant">Path</span>)
357: <span class="ruby-identifier">other</span> = <span class="ruby-identifier">s</span>.<span class="ruby-identifier">source</span>.<span class="ruby-identifier">specs</span>[<span class="ruby-identifier">s</span>].<span class="ruby-identifier">first</span>
358:
359: <span class="ruby-comment cmt"># If the spec is no longer in the path source, unlock it. This</span>
360: <span class="ruby-comment cmt"># commonly happens if the version changed in the gemspec</span>
361: <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">other</span>
362: <span class="ruby-comment cmt"># If the dependencies of the path source have changed, unlock it</span>
363: <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">dependencies</span>.<span class="ruby-identifier">sort</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">dependencies</span>.<span class="ruby-identifier">sort</span>
364: <span class="ruby-keyword kw">end</span>
365:
366: <span class="ruby-identifier">converged</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">s</span>
367: <span class="ruby-keyword kw">end</span>
368:
369: <span class="ruby-identifier">resolve</span> = <span class="ruby-constant">SpecSet</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">converged</span>)
370: <span class="ruby-identifier">resolve</span> = <span class="ruby-identifier">resolve</span>.<span class="ruby-identifier">for</span>(<span class="ruby-identifier">expand_dependencies</span>(<span class="ruby-identifier">deps</span>, <span class="ruby-keyword kw">true</span>), <span class="ruby-ivar">@unlock</span>[<span class="ruby-value">:gems</span>])
371: <span class="ruby-identifier">diff</span> = <span class="ruby-ivar">@locked_specs</span>.<span class="ruby-identifier">to_a</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">resolve</span>.<span class="ruby-identifier">to_a</span>
372:
373: <span class="ruby-comment cmt"># Now, we unlock any sources that do not have anymore gems pinned to it</span>
374: <span class="ruby-ivar">@sources</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">source</span><span class="ruby-operator">|</span>
375: <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">source</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:unlock!</span>)
376:
377: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">resolve</span>.<span class="ruby-identifier">any?</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">source</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">source</span> }
378: <span class="ruby-identifier">source</span>.<span class="ruby-identifier">unlock!</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">diff</span>.<span class="ruby-identifier">any?</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">source</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">source</span> }
379: <span class="ruby-keyword kw">end</span>
380: <span class="ruby-keyword kw">end</span>
381:
382: <span class="ruby-identifier">resolve</span>
383: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="converge-sources-method" class="method-detail ">
<a name="method-i-converge_sources"></a>
<div class="method-heading">
<span class="method-name">converge_sources</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="converge-sources-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 295</span>
295: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">converge_sources</span>
296: <span class="ruby-identifier">locked_gem</span> = <span class="ruby-ivar">@locked_sources</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-constant">Source</span><span class="ruby-operator">::</span><span class="ruby-constant">Rubygems</span> <span class="ruby-operator">===</span> <span class="ruby-identifier">s</span> }
297: <span class="ruby-identifier">actual_gem</span> = <span class="ruby-ivar">@sources</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-constant">Source</span><span class="ruby-operator">::</span><span class="ruby-constant">Rubygems</span> <span class="ruby-operator">===</span> <span class="ruby-identifier">s</span> }
298:
299: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">locked_gem</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">actual_gem</span>
300: <span class="ruby-identifier">locked_gem</span>.<span class="ruby-identifier">merge_remotes</span> <span class="ruby-identifier">actual_gem</span>
301: <span class="ruby-keyword kw">end</span>
302:
303: <span class="ruby-ivar">@sources</span>.<span class="ruby-identifier">map!</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">source</span><span class="ruby-operator">|</span>
304: <span class="ruby-ivar">@locked_sources</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-operator">==</span> <span class="ruby-identifier">source</span> } <span class="ruby-operator">||</span> <span class="ruby-identifier">source</span>
305: <span class="ruby-keyword kw">end</span>
306:
307: <span class="ruby-ivar">@sources</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">source</span><span class="ruby-operator">|</span>
308: <span class="ruby-identifier">source</span>.<span class="ruby-identifier">unlock!</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">source</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:unlock!</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@unlock</span>[<span class="ruby-value">:sources</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">source</span>.<span class="ruby-identifier">name</span>)
309: <span class="ruby-keyword kw">end</span>
310: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="expand-dependencies-method" class="method-detail ">
<a name="method-i-expand_dependencies"></a>
<div class="method-heading">
<span class="method-name">expand_dependencies</span><span
class="method-args">(dependencies, remote = false)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code"
id="expand-dependencies-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 397</span>
397: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">expand_dependencies</span>(<span class="ruby-identifier">dependencies</span>, <span class="ruby-identifier">remote</span> = <span class="ruby-keyword kw">false</span>)
398: <span class="ruby-identifier">deps</span> = []
399: <span class="ruby-identifier">dependencies</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">dep</span><span class="ruby-operator">|</span>
400: <span class="ruby-identifier">dep</span> = <span class="ruby-constant">Dependency</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">dep</span>, <span class="ruby-value str">&quot;&gt;= 0&quot;</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">dep</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:name</span>)
401: <span class="ruby-identifier">dep</span>.<span class="ruby-identifier">gem_platforms</span>(<span class="ruby-ivar">@platforms</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span>
402: <span class="ruby-identifier">deps</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">DepProxy</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">dep</span>, <span class="ruby-identifier">p</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">remote</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">p</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">generic</span>(<span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Platform</span>.<span class="ruby-identifier">local</span>)
403: <span class="ruby-keyword kw">end</span>
404: <span class="ruby-keyword kw">end</span>
405: <span class="ruby-identifier">deps</span>
406: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="expanded-dependencies-method" class="method-detail ">
<a name="method-i-expanded_dependencies"></a>
<div class="method-heading">
<span class="method-name">expanded_dependencies</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="expanded-dependencies-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 393</span>
393: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">expanded_dependencies</span>
394: <span class="ruby-ivar">@expanded_dependencies</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">expand_dependencies</span>(<span class="ruby-identifier">dependencies</span>, <span class="ruby-ivar">@remote</span>)
395: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="in-locked-deps--method" class="method-detail ">
<a name="method-i-in_locked_deps%3F"></a>
<div class="method-heading">
<span class="method-name">in_locked_deps?</span><span
class="method-args">(dep, d)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code"
id="in-locked-deps--source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 385</span>
385: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">in_locked_deps?</span>(<span class="ruby-identifier">dep</span>, <span class="ruby-identifier">d</span>)
386: <span class="ruby-identifier">d</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">dep</span>.<span class="ruby-identifier">source</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">d</span>.<span class="ruby-identifier">source</span>
387: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="pretty-dep-method" class="method-detail ">
<a name="method-i-pretty_dep"></a>
<div class="method-heading">
<span class="method-name">pretty_dep</span><span
class="method-args">(dep, source = false)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code"
id="pretty-dep-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 288</span>
288: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pretty_dep</span>(<span class="ruby-identifier">dep</span>, <span class="ruby-identifier">source</span> = <span class="ruby-keyword kw">false</span>)
289: <span class="ruby-identifier">msg</span> = <span class="ruby-node">&quot;#{dep.name}&quot;</span>
290: <span class="ruby-identifier">msg</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot; (#{dep.requirement})&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">dep</span>.<span class="ruby-identifier">requirement</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Requirement</span>.<span class="ruby-identifier">default</span>
291: <span class="ruby-identifier">msg</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot; from the `#{dep.source}` source&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">source</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">dep</span>.<span class="ruby-identifier">source</span>
292: <span class="ruby-identifier">msg</span>
293: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="requested-dependencies-method" class="method-detail ">
<a name="method-i-requested_dependencies"></a>
<div class="method-heading">
<span class="method-name">requested_dependencies</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="requested-dependencies-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 415</span>
415: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">requested_dependencies</span>
416: <span class="ruby-identifier">groups</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">groups</span> <span class="ruby-operator">-</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>.<span class="ruby-identifier">without</span>
417: <span class="ruby-identifier">groups</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> }
418: <span class="ruby-identifier">dependencies</span>.<span class="ruby-identifier">reject</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">d</span><span class="ruby-operator">|</span> <span class="ruby-operator">!</span><span class="ruby-identifier">d</span>.<span class="ruby-identifier">should_include?</span> <span class="ruby-operator">||</span> (<span class="ruby-identifier">d</span>.<span class="ruby-identifier">groups</span> &amp; <span class="ruby-identifier">groups</span>).<span class="ruby-identifier">empty?</span> }
419: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="satisfies-locked-spec--method" class="method-detail ">
<a name="method-i-satisfies_locked_spec%3F"></a>
<div class="method-heading">
<span class="method-name">satisfies_locked_spec?</span><span
class="method-args">(dep)</span>
<span class="method-click-advice">click to toggle source</span>
</div>
<div class="method-description">
<div class="method-source-code"
id="satisfies-locked-spec--source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 389</span>
389: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">satisfies_locked_spec?</span>(<span class="ruby-identifier">dep</span>)
390: <span class="ruby-ivar">@locked_specs</span>.<span class="ruby-identifier">any?</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">satisfies?</span>(<span class="ruby-identifier">dep</span>) <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-operator">!</span><span class="ruby-identifier">dep</span>.<span class="ruby-identifier">source</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">source</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">dep</span>.<span class="ruby-identifier">source</span>) }
391: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="sorted-sources-method" class="method-detail ">
<a name="method-i-sorted_sources"></a>
<div class="method-heading">
<span class="method-name">sorted_sources</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="sorted-sources-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 408</span>
408: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sorted_sources</span>
409: <span class="ruby-ivar">@sources</span>.<span class="ruby-identifier">sort_by</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span>
410: <span class="ruby-comment cmt"># Place GEM at the top</span>
411: [ <span class="ruby-identifier">s</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Source</span><span class="ruby-operator">::</span><span class="ruby-constant">Rubygems</span>) <span class="ruby-operator">?</span> <span class="ruby-value">1</span> <span class="ruby-operator">:</span> <span class="ruby-value">0</span>, <span class="ruby-identifier">s</span>.<span class="ruby-identifier">to_s</span> ]
412: <span class="ruby-keyword kw">end</span>
413: <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>