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

1791 lines
92 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::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>
2010-12-07 04:11:19 +01:00
<li><a href="#method-i-rubygems_index">#rubygems_index</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-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::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:
2010-12-07 04:11:19 +01:00
17: <span class="ruby-constant">Dsl</span>.<span class="ruby-identifier">evaluate</span>(<span class="ruby-identifier">gemfile</span>, <span class="ruby-identifier">lockfile</span>, <span class="ruby-identifier">unlock</span>)
18: <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>
2010-12-07 04:11:19 +01:00
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 32</span>
32: <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>)
33: <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>
34: <span class="ruby-ivar">@remote</span> = <span class="ruby-keyword kw">false</span>
35: <span class="ruby-ivar">@specs</span> = <span class="ruby-keyword kw">nil</span>
36: <span class="ruby-ivar">@lockfile_contents</span> = <span class="ruby-value str">&quot;&quot;</span>
37:
38: <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>)
39: <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>)
40: <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>)
41: <span class="ruby-ivar">@platforms</span> = <span class="ruby-identifier">locked</span>.<span class="ruby-identifier">platforms</span>
42:
43: <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>
44: <span class="ruby-ivar">@locked_deps</span> = <span class="ruby-identifier">locked</span>.<span class="ruby-identifier">dependencies</span>
45: <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>)
46: <span class="ruby-ivar">@locked_sources</span> = <span class="ruby-identifier">locked</span>.<span class="ruby-identifier">sources</span>
47: <span class="ruby-keyword kw">else</span>
48: <span class="ruby-ivar">@unlock</span> = {}
49: <span class="ruby-ivar">@locked_deps</span> = []
50: <span class="ruby-ivar">@locked_specs</span> = <span class="ruby-constant">SpecSet</span>.<span class="ruby-identifier">new</span>([])
51: <span class="ruby-ivar">@locked_sources</span> = []
52: <span class="ruby-keyword kw">end</span>
53: <span class="ruby-keyword kw">else</span>
54: <span class="ruby-ivar">@unlock</span> = {}
55: <span class="ruby-ivar">@platforms</span> = []
56: <span class="ruby-ivar">@locked_deps</span> = []
57: <span class="ruby-ivar">@locked_specs</span> = <span class="ruby-constant">SpecSet</span>.<span class="ruby-identifier">new</span>([])
58: <span class="ruby-ivar">@locked_sources</span> = []
59: <span class="ruby-keyword kw">end</span>
60:
61: <span class="ruby-ivar">@unlock</span>[<span class="ruby-value">:gems</span>] <span class="ruby-operator">||=</span> []
62: <span class="ruby-ivar">@unlock</span>[<span class="ruby-value">:sources</span>] <span class="ruby-operator">||=</span> []
63:
64: <span class="ruby-identifier">current_platform</span> = <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">rubygems</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>
2010-12-07 04:11:19 +01:00
65: <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>)
66: <span class="ruby-ivar">@platforms</span> <span class="ruby-operator">|=</span> [<span class="ruby-identifier">current_platform</span>]
67:
68: <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>])
69: <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> }
70:
2010-12-07 04:11:19 +01:00
71: <span class="ruby-identifier">converge_sources</span>
72: <span class="ruby-identifier">converge_dependencies</span>
73: <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>
2010-12-07 04:11:19 +01:00
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 128</span>
128: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">current_dependencies</span>
129: <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> }
130: <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">(explicit_flag = false)</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>
2010-12-07 04:11:19 +01:00
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 238</span>
238: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ensure_equivalent_gemfile_and_lockfile</span>(<span class="ruby-identifier">explicit_flag</span> = <span class="ruby-keyword kw">false</span>)
2010-12-07 04:11:19 +01:00
239: <span class="ruby-identifier">changes</span> = <span class="ruby-keyword kw">false</span>
240:
241: <span class="ruby-identifier">msg</span> = <span class="ruby-value str">&quot;You are trying to install in deployment mode after changing\n&quot;</span> <span class="ruby-value str">&quot;your Gemfile. Run `bundle install` elsewhere and add the\n&quot;</span> <span class="ruby-value str">&quot;updated Gemfile.lock to version control.&quot;</span>
242:
243: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">explicit_flag</span>
244: <span class="ruby-identifier">msg</span> <span class="ruby-operator">+=</span> <span class="ruby-value str">&quot;\n\nIf this is a development machine, remove the Gemfile &quot;</span> <span class="ruby-value str">&quot;freeze \nby running `bundle install --no-deployment`.&quot;</span>
245: <span class="ruby-keyword kw">end</span>
246:
247: <span class="ruby-identifier">added</span> = []
248: <span class="ruby-identifier">deleted</span> = []
249: <span class="ruby-identifier">changed</span> = []
250:
251: <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>
252: <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>
253: <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>
2010-12-07 04:11:19 +01:00
254:
255: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">new_sources</span>.<span class="ruby-identifier">any?</span>
256: <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> }
2010-12-07 04:11:19 +01:00
257: <span class="ruby-keyword kw">end</span>
258:
259: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">deleted_sources</span>.<span class="ruby-identifier">any?</span>
260: <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> }
261: <span class="ruby-keyword kw">end</span>
262:
263: <span class="ruby-identifier">changes</span> = <span class="ruby-keyword kw">true</span>
264: <span class="ruby-keyword kw">end</span>
265:
266: <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>] }
267: <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> }
268: <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> }
269: <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>] }
270:
271: <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>
272: <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>
273: <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>
274:
275: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">new_deps</span>.<span class="ruby-identifier">any?</span>
276: <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> }
2010-12-07 04:11:19 +01:00
277: <span class="ruby-keyword kw">end</span>
278:
279: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">deleted_deps</span>.<span class="ruby-identifier">any?</span>
280: <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> }
2010-12-07 04:11:19 +01:00
281: <span class="ruby-keyword kw">end</span>
282:
283: <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>
284: <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>
285: <span class="ruby-keyword kw">end</span>
286:
287: <span class="ruby-identifier">changes</span> = <span class="ruby-keyword kw">true</span>
288: <span class="ruby-keyword kw">end</span>
2010-12-07 04:11:19 +01:00
289:
290: <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>
291: <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>
292: <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>
293: <span class="ruby-identifier">msg</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;\n&quot;</span>
294:
295: <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>
296: <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>
2010-12-07 04:11:19 +01:00
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 176</span>
176: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">groups</span>
177: <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>
178: <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>
2010-12-07 04:11:19 +01:00
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 156</span>
156: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">index</span>
157: <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>
158: <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>
159: <span class="ruby-identifier">idx</span>.<span class="ruby-identifier">use</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">specs</span>
160: <span class="ruby-keyword kw">end</span>
161: <span class="ruby-keyword kw">end</span>
162: <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>
2010-12-07 04:11:19 +01:00
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 180</span>
180: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">lock</span>(<span class="ruby-identifier">file</span>)
181: <span class="ruby-identifier">contents</span> = <span class="ruby-identifier">to_lock</span>
182:
183: <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>
184:
185: <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>]
186: <span class="ruby-comment cmt"># TODO: Warn here if we got here.</span>
187: <span class="ruby-keyword kw">return</span>
188: <span class="ruby-keyword kw">end</span>
189:
190: <span class="ruby-comment cmt"># Convert to \r\n if the existing lock has them</span>
191: <span class="ruby-comment cmt"># i.e., Windows with `git config core.autocrlf=true`</span>
192: <span class="ruby-identifier">contents</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/\n/</span>, <span class="ruby-value str">&quot;\r\n&quot;</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@lockfile_contents</span>.<span class="ruby-identifier">match</span>(<span class="ruby-value str">&quot;\r\n&quot;</span>)
193:
194: <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-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">puts</span>(<span class="ruby-identifier">contents</span>) }
195: <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>
2010-12-07 04:11:19 +01:00
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 114</span>
114: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">missing_specs</span>
115: <span class="ruby-identifier">missing</span> = []
116: <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>)
117: <span class="ruby-identifier">missing</span>
118: <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>
2010-12-07 04:11:19 +01:00
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 110</span>
110: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">new_platform?</span>
111: <span class="ruby-ivar">@new_platform</span>
112: <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>
2010-12-07 04:11:19 +01:00
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 102</span>
102: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">new_specs</span>
103: <span class="ruby-identifier">specs</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@locked_specs</span>
104: <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>
2010-12-07 04:11:19 +01:00
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 172</span>
172: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">no_sources?</span>
173: <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>
174: <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>
2010-12-07 04:11:19 +01:00
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 106</span>
106: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">removed_specs</span>
107: <span class="ruby-ivar">@locked_specs</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">specs</span>
108: <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>
2010-12-07 04:11:19 +01:00
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 120</span>
120: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">requested_specs</span>
121: <span class="ruby-ivar">@requested_specs</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword kw">begin</span>
122: <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>
123: <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> }
124: <span class="ruby-identifier">specs_for</span>(<span class="ruby-identifier">groups</span>)
125: <span class="ruby-keyword kw">end</span>
126: <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>
2010-12-07 04:11:19 +01:00
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 138</span>
138: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">resolve</span>
139: <span class="ruby-ivar">@resolve</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword kw">begin</span>
140: <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>]
141: <span class="ruby-ivar">@locked_specs</span>
142: <span class="ruby-keyword kw">else</span>
143: <span class="ruby-identifier">last_resolve</span> = <span class="ruby-identifier">converge_locked_specs</span>
144: <span class="ruby-identifier">source_requirements</span> = {}
145: <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>
146: <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>
147: <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>
148: <span class="ruby-keyword kw">end</span>
149:
150: <span class="ruby-comment cmt"># Run a resolve against the locally available gems</span>
151: <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>)
152: <span class="ruby-keyword kw">end</span>
153: <span class="ruby-keyword kw">end</span>
154: <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>
2010-12-07 04:11:19 +01:00
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 81</span>
81: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">resolve_remotely!</span>
82: <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>
83: <span class="ruby-ivar">@remote</span> = <span class="ruby-keyword kw">true</span>
84: <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> }
85: <span class="ruby-identifier">specs</span>
86: <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>
2010-12-07 04:11:19 +01:00
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 75</span>
75: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">resolve_with_cache!</span>
76: <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>
77: <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> }
78: <span class="ruby-identifier">specs</span>
79: <span class="ruby-keyword kw">end</span></pre>
</div>
</div>
</div>
<div id="rubygems-index-method" class="method-detail ">
<a name="method-i-rubygems_index"></a>
<div class="method-heading">
<span class="method-name">rubygems_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="rubygems-index-source">
<pre>
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 164</span>
164: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rubygems_index</span>
165: <span class="ruby-ivar">@rubygems_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>
166: <span class="ruby-ivar">@sources</span>.<span class="ruby-identifier">find_all</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">is_a?</span>(<span class="ruby-constant">Source</span><span class="ruby-operator">::</span><span class="ruby-constant">Rubygems</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>
167: <span class="ruby-identifier">idx</span>.<span class="ruby-identifier">use</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">specs</span>
168: <span class="ruby-keyword kw">end</span>
169: <span class="ruby-keyword kw">end</span>
170: <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>
2010-12-07 04:11:19 +01:00
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 88</span>
88: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">specs</span>
89: <span class="ruby-ivar">@specs</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword kw">begin</span>
90: <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>)
91:
92: <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>
93: <span class="ruby-identifier">local</span> = <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>[<span class="ruby-value">:frozen</span>] <span class="ruby-operator">?</span> <span class="ruby-identifier">rubygems_index</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">index</span>
94: <span class="ruby-identifier">bundler</span> = <span class="ruby-identifier">local</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>
95: <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>
96: <span class="ruby-keyword kw">end</span>
97:
98: <span class="ruby-identifier">specs</span>
99: <span class="ruby-keyword kw">end</span>
100: <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>
2010-12-07 04:11:19 +01:00
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 132</span>
132: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">specs_for</span>(<span class="ruby-identifier">groups</span>)
133: <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> }
134: <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> }
135: <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>))
136: <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>
2010-12-07 04:11:19 +01:00
<span class="ruby-comment cmt"># File lib/bundler/definition.rb, line 197</span>
197: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_lock</span>
198: <span class="ruby-identifier">out</span> = <span class="ruby-value str">&quot;&quot;</span>
199:
200: <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>
201: <span class="ruby-comment cmt"># Add the source header</span>
202: <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>
203: <span class="ruby-comment cmt"># Find all specs for this source</span>
204: <span class="ruby-identifier">resolve</span>.
205: <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> }.
206: <span class="ruby-comment cmt"># This needs to be sorted by full name so that</span>
207: <span class="ruby-comment cmt"># gems with the same name, but different platform</span>
208: <span class="ruby-comment cmt"># are ordered consistantly</span>
209: <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> }.
210: <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>
211: <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>
212: <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>
213: <span class="ruby-keyword kw">end</span>
214: <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;\n&quot;</span>
215: <span class="ruby-keyword kw">end</span>
216:
217: <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;PLATFORMS\n&quot;</span>
218:
219: <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>
220: <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot; #{p}\n&quot;</span>
221: <span class="ruby-keyword kw">end</span>
222:
223: <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;\n&quot;</span>
224: <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;DEPENDENCIES\n&quot;</span>
225:
226: <span class="ruby-identifier">handled</span> = []
227: <span class="ruby-identifier">dependencies</span>.
228: <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">to_s</span> }.
2010-12-07 04:11:19 +01:00
229: <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>
230: <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>)
231: <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>
232: <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>
233: <span class="ruby-keyword kw">end</span>
234:
235: <span class="ruby-identifier">out</span>
236: <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 327</span>
327: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">converge_dependencies</span>
328: (<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>
329: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">dep</span>.<span class="ruby-identifier">source</span>
330: <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> }
331: <span class="ruby-keyword kw">end</span>
332: <span class="ruby-keyword kw">end</span>
333: <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 338</span>
338: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">converge_locked_specs</span>
339: <span class="ruby-identifier">deps</span> = []
2010-12-07 04:11:19 +01:00
340:
341: <span class="ruby-comment cmt"># Build a list of dependencies that are the same in the Gemfile</span>
342: <span class="ruby-comment cmt"># and Gemfile.lock. If the Gemfile modified a dependency, but</span>
343: <span class="ruby-comment cmt"># the gem in the Gemfile.lock still satisfies it, this is fine</span>
344: <span class="ruby-comment cmt"># too.</span>
345: <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>
346: <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> }
2010-12-07 04:11:19 +01:00
347:
348: <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>)
349: <span class="ruby-identifier">deps</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">dep</span>
350: <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-identifier">dep</span>.<span class="ruby-identifier">current_platform?</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>)
351: <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>
352: <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>
353: <span class="ruby-keyword kw">end</span>
354:
355: <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>)
356: <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> }
357: <span class="ruby-keyword kw">end</span>
358: <span class="ruby-keyword kw">end</span>
359:
360: <span class="ruby-identifier">converged</span> = []
361: <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>
362: <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> }
363:
364: <span class="ruby-comment cmt"># Don't add a spec to the list if its source is expired. For example,</span>
365: <span class="ruby-comment cmt"># if you change a Git gem to Rubygems.</span>
366: <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>)
367: <span class="ruby-comment cmt"># If the spec is from a path source and it doesn't exist anymore</span>
368: <span class="ruby-comment cmt"># then we just unlock it.</span>
369:
370: <span class="ruby-comment cmt"># Path sources have special logic</span>
371: <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>)
372: <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>
2010-12-07 04:11:19 +01:00
373:
374: <span class="ruby-comment cmt"># If the spec is no longer in the path source, unlock it. This</span>
375: <span class="ruby-comment cmt"># commonly happens if the version changed in the gemspec</span>
376: <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">other</span>
377:
378: <span class="ruby-identifier">deps2</span> = <span class="ruby-identifier">other</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">type</span> <span class="ruby-operator">!=</span> <span class="ruby-value">:development</span> }
379: <span class="ruby-comment cmt"># If the dependencies of the path source have changed, unlock it</span>
380: <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">deps2</span>.<span class="ruby-identifier">sort</span>
381: <span class="ruby-keyword kw">end</span>
382:
383: <span class="ruby-identifier">converged</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">s</span>
384: <span class="ruby-keyword kw">end</span>
385:
386: <span class="ruby-identifier">resolve</span> = <span class="ruby-constant">SpecSet</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">converged</span>)
387: <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>])
388: <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>
2010-12-07 04:11:19 +01:00
389:
390: <span class="ruby-comment cmt"># Now, we unlock any sources that do not have anymore gems pinned to it</span>
391: <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>
392: <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>)
393:
394: <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> }
395: <span class="ruby-identifier">source</span>.<span class="ruby-identifier">unlock!</span> <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">diff</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">&amp;&amp;</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> }
396: <span class="ruby-keyword kw">end</span>
397: <span class="ruby-keyword kw">end</span>
398:
399: <span class="ruby-identifier">resolve</span>
400: <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 310</span>
310: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">converge_sources</span>
311: <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> }
312: <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> }
313:
314: <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>
315: <span class="ruby-identifier">locked_gem</span>.<span class="ruby-identifier">merge_remotes</span> <span class="ruby-identifier">actual_gem</span>
316: <span class="ruby-keyword kw">end</span>
317:
318: <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>
319: <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>
320: <span class="ruby-keyword kw">end</span>
321:
322: <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>
323: <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>)
324: <span class="ruby-keyword kw">end</span>
325: <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 414</span>
414: <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>)
415: <span class="ruby-identifier">deps</span> = []
416: <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>
417: <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>)
418: <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>
419: <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>)
420: <span class="ruby-keyword kw">end</span>
421: <span class="ruby-keyword kw">end</span>
422: <span class="ruby-identifier">deps</span>
423: <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 410</span>
410: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">expanded_dependencies</span>
411: <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>)
412: <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 402</span>
402: <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>)
403: <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>
404: <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 303</span>
303: <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>)
304: <span class="ruby-identifier">msg</span> = <span class="ruby-node">&quot;#{dep.name}&quot;</span>
305: <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>
306: <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>
307: <span class="ruby-identifier">msg</span>
308: <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 432</span>
432: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">requested_dependencies</span>
433: <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>
434: <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> }
435: <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> }
436: <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 406</span>
406: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">satisfies_locked_spec?</span>(<span class="ruby-identifier">dep</span>)
407: <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>) }
408: <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 425</span>
425: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sorted_sources</span>
426: <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>
427: <span class="ruby-comment cmt"># Place GEM at the top</span>
428: [ <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> ]
429: <span class="ruby-keyword kw">end</span>
430: <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>