1116 lines
53 KiB
HTML
1116 lines
53 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::Dsl</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/dsl_rb.html?TB_iframe=true&height=550&width=785"
|
|
class="thickbox" title="lib/bundler/dsl.rb">lib/bundler/dsl.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-deprecate">::deprecate</a></li>
|
|
|
|
<li><a href="#method-c-evaluate">::evaluate</a></li>
|
|
|
|
<li><a href="#method-c-new">::new</a></li>
|
|
|
|
<li><a href="#method-i-_deprecated_options">#_deprecated_options</a></li>
|
|
|
|
<li><a href="#method-i-_normalize_hash">#_normalize_hash</a></li>
|
|
|
|
<li><a href="#method-i-_normalize_options">#_normalize_options</a></li>
|
|
|
|
<li><a href="#method-i-env">#env</a></li>
|
|
|
|
<li><a href="#method-i-gem">#gem</a></li>
|
|
|
|
<li><a href="#method-i-gemspec">#gemspec</a></li>
|
|
|
|
<li><a href="#method-i-git">#git</a></li>
|
|
|
|
<li><a href="#method-i-group">#group</a></li>
|
|
|
|
<li><a href="#method-i-path">#path</a></li>
|
|
|
|
<li><a href="#method-i-platform">#platform</a></li>
|
|
|
|
<li><a href="#method-i-platforms">#platforms</a></li>
|
|
|
|
<li><a href="#method-i-rubygems_source">#rubygems_source</a></li>
|
|
|
|
<li><a href="#method-i-source">#source</a></li>
|
|
|
|
<li><a href="#method-i-to_definition">#to_definition</a></li>
|
|
|
|
</ul>
|
|
</div>
|
|
|
|
|
|
<!-- Included Modules -->
|
|
|
|
</div>
|
|
|
|
<div id="project-metadata">
|
|
|
|
|
|
<div id="fileindex-section" class="section project-section">
|
|
<h3 class="section-header">Files</h3>
|
|
<ul>
|
|
|
|
<li class="file"><a href="../lib/bundler/man/bundle.html">bundle</a></li>
|
|
|
|
<li class="file"><a href="../lib/bundler/man/bundle-config.html">bundle-config</a></li>
|
|
|
|
<li class="file"><a href="../lib/bundler/man/bundle-config_txt.html">bundle-config.txt</a></li>
|
|
|
|
<li class="file"><a href="../lib/bundler/man/bundle-exec.html">bundle-exec</a></li>
|
|
|
|
<li class="file"><a href="../lib/bundler/man/bundle-exec_txt.html">bundle-exec.txt</a></li>
|
|
|
|
<li class="file"><a href="../lib/bundler/man/bundle-install.html">bundle-install</a></li>
|
|
|
|
<li class="file"><a href="../lib/bundler/man/bundle-install_txt.html">bundle-install.txt</a></li>
|
|
|
|
<li class="file"><a href="../lib/bundler/man/bundle-package.html">bundle-package</a></li>
|
|
|
|
<li class="file"><a href="../lib/bundler/man/bundle-package_txt.html">bundle-package.txt</a></li>
|
|
|
|
<li class="file"><a href="../lib/bundler/man/bundle-update.html">bundle-update</a></li>
|
|
|
|
<li class="file"><a href="../lib/bundler/man/bundle-update_txt.html">bundle-update.txt</a></li>
|
|
|
|
<li class="file"><a href="../lib/bundler/man/bundle_txt.html">bundle.txt</a></li>
|
|
|
|
<li class="file"><a href="../lib/bundler/man/gemfile_5_txt.html">gemfile.5.txt</a></li>
|
|
|
|
<li class="file"><a href="../lib/bundler/templates/Gemfile.html">Gemfile</a></li>
|
|
|
|
</ul>
|
|
</div>
|
|
|
|
|
|
<div id="classindex-section" class="section project-section">
|
|
<h3 class="section-header">Class Index
|
|
<span class="search-toggle"><img src="../images/find.png"
|
|
height="16" width="16" alt="[+]"
|
|
title="show/hide quicksearch" /></span></h3>
|
|
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
|
<fieldset>
|
|
<legend>Quicksearch</legend>
|
|
<input type="text" name="quicksearch" value=""
|
|
class="quicksearch-field" />
|
|
</fieldset>
|
|
</form>
|
|
|
|
<ul class="link-list">
|
|
|
|
<li><a href="../Bundler.html">Bundler</a></li>
|
|
|
|
<li><a href="../Bundler/BundlerError.html">Bundler::BundlerError</a></li>
|
|
|
|
<li><a href="../Bundler/CLI.html">Bundler::CLI</a></li>
|
|
|
|
<li><a href="../Bundler/Definition.html">Bundler::Definition</a></li>
|
|
|
|
<li><a href="../Bundler/DepProxy.html">Bundler::DepProxy</a></li>
|
|
|
|
<li><a href="../Bundler/Dependency.html">Bundler::Dependency</a></li>
|
|
|
|
<li><a href="../Bundler/Deployment.html">Bundler::Deployment</a></li>
|
|
|
|
<li><a href="../Bundler/DeprecatedError.html">Bundler::DeprecatedError</a></li>
|
|
|
|
<li><a href="../Bundler/Dsl.html">Bundler::Dsl</a></li>
|
|
|
|
<li><a href="../Bundler/DslError.html">Bundler::DslError</a></li>
|
|
|
|
<li><a href="../Bundler/Environment.html">Bundler::Environment</a></li>
|
|
|
|
<li><a href="../Bundler/GemHelper.html">Bundler::GemHelper</a></li>
|
|
|
|
<li><a href="../Bundler/GemHelpers.html">Bundler::GemHelpers</a></li>
|
|
|
|
<li><a href="../Bundler/GemNotFound.html">Bundler::GemNotFound</a></li>
|
|
|
|
<li><a href="../Bundler/GemfileError.html">Bundler::GemfileError</a></li>
|
|
|
|
<li><a href="../Bundler/GemfileNotFound.html">Bundler::GemfileNotFound</a></li>
|
|
|
|
<li><a href="../Bundler/GemspecError.html">Bundler::GemspecError</a></li>
|
|
|
|
<li><a href="../Bundler/GitError.html">Bundler::GitError</a></li>
|
|
|
|
<li><a href="../Bundler/Graph.html">Bundler::Graph</a></li>
|
|
|
|
<li><a href="../Bundler/GraphNode.html">Bundler::GraphNode</a></li>
|
|
|
|
<li><a href="../Bundler/Index.html">Bundler::Index</a></li>
|
|
|
|
<li><a href="../Bundler/Installer.html">Bundler::Installer</a></li>
|
|
|
|
<li><a href="../Bundler/InvalidOption.html">Bundler::InvalidOption</a></li>
|
|
|
|
<li><a href="../Bundler/InvalidSpecSet.html">Bundler::InvalidSpecSet</a></li>
|
|
|
|
<li><a href="../Bundler/LazySpecification.html">Bundler::LazySpecification</a></li>
|
|
|
|
<li><a href="../Bundler/LockfileParser.html">Bundler::LockfileParser</a></li>
|
|
|
|
<li><a href="../Bundler/MatchPlatform.html">Bundler::MatchPlatform</a></li>
|
|
|
|
<li><a href="../Bundler/PathError.html">Bundler::PathError</a></li>
|
|
|
|
<li><a href="../Bundler/ProductionError.html">Bundler::ProductionError</a></li>
|
|
|
|
<li><a href="../Bundler/RemoteSpecification.html">Bundler::RemoteSpecification</a></li>
|
|
|
|
<li><a href="../Bundler/Resolver.html">Bundler::Resolver</a></li>
|
|
|
|
<li><a href="../Bundler/Resolver/SpecGroup.html">Bundler::Resolver::SpecGroup</a></li>
|
|
|
|
<li><a href="../Bundler/Runtime.html">Bundler::Runtime</a></li>
|
|
|
|
<li><a href="../Bundler/Settings.html">Bundler::Settings</a></li>
|
|
|
|
<li><a href="../Bundler/SharedHelpers.html">Bundler::SharedHelpers</a></li>
|
|
|
|
<li><a href="../Bundler/SharedHelpers/Gem.html">Bundler::SharedHelpers::Gem</a></li>
|
|
|
|
<li><a href="../Bundler/SharedHelpers/Gem/SourceIndex.html">Bundler::SharedHelpers::Gem::SourceIndex</a></li>
|
|
|
|
<li><a href="../Bundler/Source.html">Bundler::Source</a></li>
|
|
|
|
<li><a href="../Bundler/Source/Git.html">Bundler::Source::Git</a></li>
|
|
|
|
<li><a href="../Bundler/Source/Path.html">Bundler::Source::Path</a></li>
|
|
|
|
<li><a href="../Bundler/Source/Path/Installer.html">Bundler::Source::Path::Installer</a></li>
|
|
|
|
<li><a href="../Bundler/Source/Rubygems.html">Bundler::Source::Rubygems</a></li>
|
|
|
|
<li><a href="../Bundler/SpecSet.html">Bundler::SpecSet</a></li>
|
|
|
|
<li><a href="../Bundler/UI.html">Bundler::UI</a></li>
|
|
|
|
<li><a href="../Bundler/UI/RGProxy.html">Bundler::UI::RGProxy</a></li>
|
|
|
|
<li><a href="../Bundler/UI/Shell.html">Bundler::UI::Shell</a></li>
|
|
|
|
<li><a href="../Bundler/VersionConflict.html">Bundler::VersionConflict</a></li>
|
|
|
|
<li><a href="../Thor.html">Thor</a></li>
|
|
|
|
<li><a href="../Thor/Actions.html">Thor::Actions</a></li>
|
|
|
|
<li><a href="../Thor/Actions/ClassMethods.html">Thor::Actions::ClassMethods</a></li>
|
|
|
|
<li><a href="../Thor/Base.html">Thor::Base</a></li>
|
|
|
|
<li><a href="../Thor/Base/ClassMethods.html">Thor::Base::ClassMethods</a></li>
|
|
|
|
<li><a href="../Thor/DynamicTask.html">Thor::DynamicTask</a></li>
|
|
|
|
<li><a href="../Thor/Error.html">Thor::Error</a></li>
|
|
|
|
<li><a href="../Thor/HiddenTask.html">Thor::HiddenTask</a></li>
|
|
|
|
<li><a href="../Thor/Invocation.html">Thor::Invocation</a></li>
|
|
|
|
<li><a href="../Thor/Invocation/ClassMethods.html">Thor::Invocation::ClassMethods</a></li>
|
|
|
|
<li><a href="../Thor/InvocationError.html">Thor::InvocationError</a></li>
|
|
|
|
<li><a href="../Thor/MalformattedArgumentError.html">Thor::MalformattedArgumentError</a></li>
|
|
|
|
<li><a href="../Thor/RequiredArgumentMissingError.html">Thor::RequiredArgumentMissingError</a></li>
|
|
|
|
<li><a href="../Thor/Shell.html">Thor::Shell</a></li>
|
|
|
|
<li><a href="../Thor/Shell/Basic.html">Thor::Shell::Basic</a></li>
|
|
|
|
<li><a href="../Thor/Shell/Color.html">Thor::Shell::Color</a></li>
|
|
|
|
<li><a href="../Thor/Shell/HTML.html">Thor::Shell::HTML</a></li>
|
|
|
|
<li><a href="../Thor/Task.html">Thor::Task</a></li>
|
|
|
|
<li><a href="../Thor/UndefinedTaskError.html">Thor::UndefinedTaskError</a></li>
|
|
|
|
<li><a href="../Thor/UnknownArgumentError.html">Thor::UnknownArgumentError</a></li>
|
|
|
|
<li><a href="../Thor/Util.html">Thor::Util</a></li>
|
|
|
|
<li><a href="../Gem.html">Gem</a></li>
|
|
|
|
<li><a href="../Gem/Dependency.html">Gem::Dependency</a></li>
|
|
|
|
<li><a href="../Gem/Platform.html">Gem::Platform</a></li>
|
|
|
|
<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::Dsl</h1>
|
|
|
|
<div id="description">
|
|
|
|
</div>
|
|
|
|
<!-- Constants -->
|
|
|
|
<div id="constants-list" class="section">
|
|
<h3 class="section-header">Constants</h3>
|
|
<dl>
|
|
|
|
<dt><a name="VALID_PLATFORMS">VALID_PLATFORMS</a></dt>
|
|
|
|
<dd class="description"></dd>
|
|
|
|
|
|
</dl>
|
|
</div>
|
|
|
|
|
|
<!-- Attributes -->
|
|
|
|
|
|
<!-- Methods -->
|
|
|
|
<div id="public-class-method-details" class="method-section section">
|
|
<h3 class="section-header">Public Class Methods</h3>
|
|
|
|
|
|
<div id="deprecate-method" class="method-detail ">
|
|
<a name="method-c-deprecate"></a>
|
|
|
|
<div class="method-heading">
|
|
|
|
<span class="method-name">deprecate</span><span
|
|
class="method-args">(name, replacement = nil)</span>
|
|
<span class="method-click-advice">click to toggle source</span>
|
|
|
|
</div>
|
|
|
|
<div class="method-description">
|
|
|
|
<p>
|
|
Deprecated methods
|
|
</p>
|
|
|
|
|
|
|
|
<div class="method-source-code"
|
|
id="deprecate-source">
|
|
<pre>
|
|
<span class="ruby-comment cmt"># File lib/bundler/dsl.rb, line 147</span>
|
|
147: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">deprecate</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">replacement</span> = <span class="ruby-keyword kw">nil</span>)
|
|
148: <span class="ruby-identifier">define_method</span>(<span class="ruby-identifier">name</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span>*<span class="ruby-operator">|</span>
|
|
149: <span class="ruby-identifier">message</span> = <span class="ruby-node">"'#{name}' has been removed from the Gemfile DSL, "</span>
|
|
150: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">replacement</span>
|
|
151: <span class="ruby-identifier">message</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"and has been replaced with '#{replacement}'."</span>
|
|
152: <span class="ruby-keyword kw">else</span>
|
|
153: <span class="ruby-identifier">message</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"and is no longer supported."</span>
|
|
154: <span class="ruby-keyword kw">end</span>
|
|
155: <span class="ruby-identifier">message</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"\nSee the README for more information on upgrading from Bundler 0.8."</span>
|
|
156: <span class="ruby-identifier">raise</span> <span class="ruby-constant">DeprecatedError</span>, <span class="ruby-identifier">message</span>
|
|
157: <span class="ruby-keyword kw">end</span>
|
|
158: <span class="ruby-keyword kw">end</span></pre>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div id="evaluate-method" class="method-detail ">
|
|
<a name="method-c-evaluate"></a>
|
|
|
|
<div class="method-heading">
|
|
|
|
<span class="method-name">evaluate</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="evaluate-source">
|
|
<pre>
|
|
<span class="ruby-comment cmt"># File lib/bundler/dsl.rb, line 5</span>
|
|
5: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</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>)
|
|
6: <span class="ruby-identifier">builder</span> = <span class="ruby-identifier">new</span>
|
|
7: <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>)
|
|
8: <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>)
|
|
9: <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">()</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/dsl.rb, line 13</span>
|
|
13: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
|
|
14: <span class="ruby-ivar">@rubygems_source</span> = <span class="ruby-constant">Source</span><span class="ruby-operator">::</span><span class="ruby-constant">Rubygems</span>.<span class="ruby-identifier">new</span>
|
|
15: <span class="ruby-ivar">@source</span> = <span class="ruby-keyword kw">nil</span>
|
|
16: <span class="ruby-ivar">@sources</span> = []
|
|
17: <span class="ruby-ivar">@dependencies</span> = []
|
|
18: <span class="ruby-ivar">@groups</span> = []
|
|
19: <span class="ruby-ivar">@platforms</span> = []
|
|
20: <span class="ruby-ivar">@env</span> = <span class="ruby-keyword kw">nil</span>
|
|
21: <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="env-method" class="method-detail ">
|
|
<a name="method-i-env"></a>
|
|
|
|
<div class="method-heading">
|
|
|
|
<span class="method-name">env</span><span
|
|
class="method-args">(name)</span>
|
|
<span class="method-click-advice">click to toggle source</span>
|
|
|
|
</div>
|
|
|
|
<div class="method-description">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-source-code"
|
|
id="env-source">
|
|
<pre>
|
|
<span class="ruby-comment cmt"># File lib/bundler/dsl.rb, line 138</span>
|
|
138: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">env</span>(<span class="ruby-identifier">name</span>)
|
|
139: <span class="ruby-ivar">@env</span>, <span class="ruby-identifier">old</span> = <span class="ruby-identifier">name</span>, <span class="ruby-ivar">@env</span>
|
|
140: <span class="ruby-keyword kw">yield</span>
|
|
141: <span class="ruby-keyword kw">ensure</span>
|
|
142: <span class="ruby-ivar">@env</span> = <span class="ruby-identifier">old</span>
|
|
143: <span class="ruby-keyword kw">end</span></pre>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div id="gem-method" class="method-detail ">
|
|
<a name="method-i-gem"></a>
|
|
|
|
<div class="method-heading">
|
|
|
|
<span class="method-name">gem</span><span
|
|
class="method-args">(name, *args)</span>
|
|
<span class="method-click-advice">click to toggle source</span>
|
|
|
|
</div>
|
|
|
|
<div class="method-description">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-source-code"
|
|
id="gem-source">
|
|
<pre>
|
|
<span class="ruby-comment cmt"># File lib/bundler/dsl.rb, line 50</span>
|
|
50: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">gem</span>(<span class="ruby-identifier">name</span>, *<span class="ruby-identifier">args</span>)
|
|
51: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">name</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Symbol</span>)
|
|
52: <span class="ruby-identifier">raise</span> <span class="ruby-constant">GemfileError</span>, <span class="ruby-node">%{You need to specify gem names as Strings. Use 'gem "#{name.to_s}"' instead.}</span>
|
|
53: <span class="ruby-keyword kw">end</span>
|
|
54:
|
|
55: <span class="ruby-identifier">options</span> = <span class="ruby-constant">Hash</span> <span class="ruby-operator">===</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">last</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">pop</span> <span class="ruby-operator">:</span> {}
|
|
56: <span class="ruby-identifier">version</span> = <span class="ruby-identifier">args</span> <span class="ruby-operator">||</span> [<span class="ruby-value str">">= 0"</span>]
|
|
57:
|
|
58: <span class="ruby-identifier">_deprecated_options</span>(<span class="ruby-identifier">options</span>)
|
|
59: <span class="ruby-identifier">_normalize_options</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">version</span>, <span class="ruby-identifier">options</span>)
|
|
60:
|
|
61: <span class="ruby-identifier">dep</span> = <span class="ruby-constant">Dependency</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">version</span>, <span class="ruby-identifier">options</span>)
|
|
62:
|
|
63: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">current</span> = <span class="ruby-ivar">@dependencies</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">d</span>.<span class="ruby-identifier">name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">dep</span>.<span class="ruby-identifier">name</span> }
|
|
64: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">current</span>.<span class="ruby-identifier">requirement</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">dep</span>.<span class="ruby-identifier">requirement</span>
|
|
65: <span class="ruby-identifier">raise</span> <span class="ruby-constant">DslError</span>, <span class="ruby-value str">"You cannot specify the same gem twice with different version requirements. "</span> <span class="ruby-node">"You specified: #{current.name} (#{current.requirement}) and "</span> <span class="ruby-node">"#{dep.name} (#{dep.requirement})"</span>
|
|
66: <span class="ruby-keyword kw">end</span>
|
|
67:
|
|
68: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">current</span>.<span class="ruby-identifier">source</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">dep</span>.<span class="ruby-identifier">source</span>
|
|
69: <span class="ruby-identifier">raise</span> <span class="ruby-constant">DslError</span>, <span class="ruby-value str">"You cannot specify the same gem twice coming from different sources. You "</span> <span class="ruby-node">"specified that #{dep.name} (#{dep.requirement}) should come from "</span> <span class="ruby-node">"#{current.source || 'an unspecfied source'} and #{dep.source}"</span>
|
|
70: <span class="ruby-keyword kw">end</span>
|
|
71: <span class="ruby-keyword kw">end</span>
|
|
72: <span class="ruby-ivar">@dependencies</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">Dependency</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">version</span>, <span class="ruby-identifier">options</span>)
|
|
73: <span class="ruby-keyword kw">end</span></pre>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div id="gemspec-method" class="method-detail ">
|
|
<a name="method-i-gemspec"></a>
|
|
|
|
<div class="method-heading">
|
|
|
|
<span class="method-name">gemspec</span><span
|
|
class="method-args">(opts = nil)</span>
|
|
<span class="method-click-advice">click to toggle source</span>
|
|
|
|
</div>
|
|
|
|
<div class="method-description">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-source-code"
|
|
id="gemspec-source">
|
|
<pre>
|
|
<span class="ruby-comment cmt"># File lib/bundler/dsl.rb, line 23</span>
|
|
23: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">gemspec</span>(<span class="ruby-identifier">opts</span> = <span class="ruby-keyword kw">nil</span>)
|
|
24: <span class="ruby-identifier">path</span> = <span class="ruby-identifier">opts</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">opts</span>[<span class="ruby-value">:path</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">'.'</span>
|
|
25: <span class="ruby-identifier">name</span> = <span class="ruby-identifier">opts</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">opts</span>[<span class="ruby-value">:name</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">'*'</span>
|
|
26: <span class="ruby-identifier">development_group</span> = <span class="ruby-identifier">opts</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">opts</span>[<span class="ruby-value">:development_group</span>] <span class="ruby-operator">||</span> <span class="ruby-value">:development</span>
|
|
27: <span class="ruby-identifier">path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">path</span>, <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">default_gemfile</span>.<span class="ruby-identifier">dirname</span>)
|
|
28: <span class="ruby-identifier">gemspecs</span> = <span class="ruby-constant">Dir</span>[<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">path</span>, <span class="ruby-node">"#{name}.gemspec"</span>)]
|
|
29:
|
|
30: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">gemspecs</span>.<span class="ruby-identifier">size</span>
|
|
31: <span class="ruby-keyword kw">when</span> <span class="ruby-value">1</span>
|
|
32: <span class="ruby-identifier">spec</span> = <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Specification</span>.<span class="ruby-identifier">load</span>(<span class="ruby-identifier">gemspecs</span>.<span class="ruby-identifier">first</span>)
|
|
33: <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidOption</span>, <span class="ruby-node">"There was an error loading the gemspec at #{gemspecs.first}."</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">spec</span>
|
|
34: <span class="ruby-identifier">gem</span> <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">name</span>, <span class="ruby-value">:path</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">path</span>
|
|
35: <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">runtime_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>
|
|
36: <span class="ruby-identifier">gem</span> <span class="ruby-identifier">dep</span>.<span class="ruby-identifier">name</span>, *<span class="ruby-identifier">dep</span>.<span class="ruby-identifier">requirement</span>.<span class="ruby-identifier">as_list</span>
|
|
37: <span class="ruby-keyword kw">end</span>
|
|
38: <span class="ruby-identifier">group</span>(<span class="ruby-identifier">development_group</span>) <span class="ruby-keyword kw">do</span>
|
|
39: <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">development_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>
|
|
40: <span class="ruby-identifier">gem</span> <span class="ruby-identifier">dep</span>.<span class="ruby-identifier">name</span>, *<span class="ruby-identifier">dep</span>.<span class="ruby-identifier">requirement</span>.<span class="ruby-identifier">as_list</span>
|
|
41: <span class="ruby-keyword kw">end</span>
|
|
42: <span class="ruby-keyword kw">end</span>
|
|
43: <span class="ruby-keyword kw">when</span> <span class="ruby-value">0</span>
|
|
44: <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidOption</span>, <span class="ruby-node">"There are no gemspecs at #{path}."</span>
|
|
45: <span class="ruby-keyword kw">else</span>
|
|
46: <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidOption</span>, <span class="ruby-node">"There are multiple gemspecs at #{path}. Please use the :name option to specify which one."</span>
|
|
47: <span class="ruby-keyword kw">end</span>
|
|
48: <span class="ruby-keyword kw">end</span></pre>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div id="git-method" class="method-detail ">
|
|
<a name="method-i-git"></a>
|
|
|
|
<div class="method-heading">
|
|
|
|
<span class="method-name">git</span><span
|
|
class="method-args">(uri, options = {}, source_options = {}, &blk)</span>
|
|
<span class="method-click-advice">click to toggle source</span>
|
|
|
|
</div>
|
|
|
|
<div class="method-description">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-source-code"
|
|
id="git-source">
|
|
<pre>
|
|
<span class="ruby-comment cmt"># File lib/bundler/dsl.rb, line 102</span>
|
|
102: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">git</span>(<span class="ruby-identifier">uri</span>, <span class="ruby-identifier">options</span> = {}, <span class="ruby-identifier">source_options</span> = {}, &<span class="ruby-identifier">blk</span>)
|
|
103: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">block_given?</span>
|
|
104: <span class="ruby-identifier">msg</span> = <span class="ruby-value str">"You can no longer specify a git source by itself. Instead, \n"</span> <span class="ruby-value str">"either use the :git option on a gem, or specify the gems that \n"</span> <span class="ruby-value str">"bundler should find in the git source by passing a block to \n"</span> <span class="ruby-value str">"the git method, like: \n\n"</span> <span class="ruby-value str">" git 'git://github.com/rails/rails.git' do\n"</span> <span class="ruby-value str">" gem 'rails'\n"</span> <span class="ruby-value str">" end"</span>
|
|
105: <span class="ruby-identifier">raise</span> <span class="ruby-constant">DeprecatedError</span>, <span class="ruby-identifier">msg</span>
|
|
106: <span class="ruby-keyword kw">end</span>
|
|
107:
|
|
108: <span class="ruby-identifier">source</span> <span class="ruby-constant">Source</span><span class="ruby-operator">::</span><span class="ruby-constant">Git</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">_normalize_hash</span>(<span class="ruby-identifier">options</span>).<span class="ruby-identifier">merge</span>(<span class="ruby-value str">"uri"</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">uri</span>)), <span class="ruby-identifier">source_options</span>, &<span class="ruby-identifier">blk</span>
|
|
109: <span class="ruby-keyword kw">end</span></pre>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div id="group-method" class="method-detail ">
|
|
<a name="method-i-group"></a>
|
|
|
|
<div class="method-heading">
|
|
|
|
<span class="method-name">group</span><span
|
|
class="method-args">(*args, &blk)</span>
|
|
<span class="method-click-advice">click to toggle source</span>
|
|
|
|
</div>
|
|
|
|
<div class="method-description">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-source-code"
|
|
id="group-source">
|
|
<pre>
|
|
<span class="ruby-comment cmt"># File lib/bundler/dsl.rb, line 123</span>
|
|
123: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">group</span>(*<span class="ruby-identifier">args</span>, &<span class="ruby-identifier">blk</span>)
|
|
124: <span class="ruby-ivar">@groups</span>.<span class="ruby-identifier">concat</span> <span class="ruby-identifier">args</span>
|
|
125: <span class="ruby-keyword kw">yield</span>
|
|
126: <span class="ruby-keyword kw">ensure</span>
|
|
127: <span class="ruby-identifier">args</span>.<span class="ruby-identifier">each</span> { <span class="ruby-ivar">@groups</span>.<span class="ruby-identifier">pop</span> }
|
|
128: <span class="ruby-keyword kw">end</span></pre>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div id="path-method" class="method-detail ">
|
|
<a name="method-i-path"></a>
|
|
|
|
<div class="method-heading">
|
|
|
|
<span class="method-name">path</span><span
|
|
class="method-args">(path, options = {}, source_options = {}, &blk)</span>
|
|
<span class="method-click-advice">click to toggle source</span>
|
|
|
|
</div>
|
|
|
|
<div class="method-description">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-source-code"
|
|
id="path-source">
|
|
<pre>
|
|
<span class="ruby-comment cmt"># File lib/bundler/dsl.rb, line 98</span>
|
|
98: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">path</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">options</span> = {}, <span class="ruby-identifier">source_options</span> = {}, &<span class="ruby-identifier">blk</span>)
|
|
99: <span class="ruby-identifier">source</span> <span class="ruby-constant">Source</span><span class="ruby-operator">::</span><span class="ruby-constant">Path</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">_normalize_hash</span>(<span class="ruby-identifier">options</span>).<span class="ruby-identifier">merge</span>(<span class="ruby-value str">"path"</span> =<span class="ruby-operator">></span> <span class="ruby-constant">Pathname</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">path</span>))), <span class="ruby-identifier">source_options</span>, &<span class="ruby-identifier">blk</span>
|
|
100: <span class="ruby-keyword kw">end</span></pre>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div id="platform-method" class="method-detail method-alias">
|
|
<a name="method-i-platform"></a>
|
|
|
|
<div class="method-heading">
|
|
|
|
<span class="method-name">platform</span><span
|
|
class="method-args">(*platforms)</span>
|
|
<span class="method-click-advice">click to toggle source</span>
|
|
|
|
</div>
|
|
|
|
<div class="method-description">
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="aliases">
|
|
Alias for: <a href="Dsl.html#method-i-platforms">platforms</a>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
<div id="platforms-method" class="method-detail ">
|
|
<a name="method-i-platforms"></a>
|
|
|
|
<div class="method-heading">
|
|
|
|
<span class="method-name">platforms</span><span
|
|
class="method-args">(*platforms)</span>
|
|
<span class="method-click-advice">click to toggle source</span>
|
|
|
|
</div>
|
|
|
|
<div class="method-description">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-source-code"
|
|
id="platforms-source">
|
|
<pre>
|
|
<span class="ruby-comment cmt"># File lib/bundler/dsl.rb, line 130</span>
|
|
130: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">platforms</span>(*<span class="ruby-identifier">platforms</span>)
|
|
131: <span class="ruby-ivar">@platforms</span>.<span class="ruby-identifier">concat</span> <span class="ruby-identifier">platforms</span>
|
|
132: <span class="ruby-keyword kw">yield</span>
|
|
133: <span class="ruby-keyword kw">ensure</span>
|
|
134: <span class="ruby-identifier">platforms</span>.<span class="ruby-identifier">each</span> { <span class="ruby-ivar">@platforms</span>.<span class="ruby-identifier">pop</span> }
|
|
135: <span class="ruby-keyword kw">end</span></pre>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
<div class="aliases">
|
|
Also aliased as: <a href="Dsl.html#method-i-platform">platform</a>
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div id="source-method" class="method-detail ">
|
|
<a name="method-i-source"></a>
|
|
|
|
<div class="method-heading">
|
|
|
|
<span class="method-name">source</span><span
|
|
class="method-args">(source, options = {})</span>
|
|
<span class="method-click-advice">click to toggle source</span>
|
|
|
|
</div>
|
|
|
|
<div class="method-description">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-source-code"
|
|
id="source-source">
|
|
<pre>
|
|
<span class="ruby-comment cmt"># File lib/bundler/dsl.rb, line 79</span>
|
|
79: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">source</span>(<span class="ruby-identifier">source</span>, <span class="ruby-identifier">options</span> = {})
|
|
80: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">source</span>
|
|
81: <span class="ruby-keyword kw">when</span> <span class="ruby-value">:gemcutter</span>, <span class="ruby-value">:rubygems</span>, <span class="ruby-value">:rubyforge</span> <span class="ruby-keyword kw">then</span>
|
|
82: <span class="ruby-identifier">rubygems_source</span> <span class="ruby-value str">"http://rubygems.org"</span>
|
|
83: <span class="ruby-keyword kw">return</span>
|
|
84: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">String</span>
|
|
85: <span class="ruby-identifier">rubygems_source</span> <span class="ruby-identifier">source</span>
|
|
86: <span class="ruby-keyword kw">return</span>
|
|
87: <span class="ruby-keyword kw">end</span>
|
|
88:
|
|
89: <span class="ruby-ivar">@source</span> = <span class="ruby-identifier">source</span>
|
|
90: <span class="ruby-identifier">options</span>[<span class="ruby-value">:prepend</span>] <span class="ruby-operator">?</span> <span class="ruby-ivar">@sources</span>.<span class="ruby-identifier">unshift</span>(<span class="ruby-ivar">@source</span>) <span class="ruby-operator">:</span> <span class="ruby-ivar">@sources</span> <span class="ruby-operator"><<</span> <span class="ruby-ivar">@source</span>
|
|
91:
|
|
92: <span class="ruby-keyword kw">yield</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
|
|
93: <span class="ruby-ivar">@source</span>
|
|
94: <span class="ruby-keyword kw">ensure</span>
|
|
95: <span class="ruby-ivar">@source</span> = <span class="ruby-keyword kw">nil</span>
|
|
96: <span class="ruby-keyword kw">end</span></pre>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div id="to-definition-method" class="method-detail ">
|
|
<a name="method-i-to_definition"></a>
|
|
|
|
<div class="method-heading">
|
|
|
|
<span class="method-name">to_definition</span><span
|
|
class="method-args">(lockfile, unlock)</span>
|
|
<span class="method-click-advice">click to toggle source</span>
|
|
|
|
</div>
|
|
|
|
<div class="method-description">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-source-code"
|
|
id="to-definition-source">
|
|
<pre>
|
|
<span class="ruby-comment cmt"># File lib/bundler/dsl.rb, line 117</span>
|
|
117: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_definition</span>(<span class="ruby-identifier">lockfile</span>, <span class="ruby-identifier">unlock</span>)
|
|
118: <span class="ruby-ivar">@sources</span> <span class="ruby-operator"><<</span> <span class="ruby-ivar">@rubygems_source</span>
|
|
119: <span class="ruby-ivar">@sources</span>.<span class="ruby-identifier">uniq!</span>
|
|
120: <span class="ruby-constant">Definition</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">lockfile</span>, <span class="ruby-ivar">@dependencies</span>, <span class="ruby-ivar">@sources</span>, <span class="ruby-identifier">unlock</span>)
|
|
121: <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="-deprecated-options-method" class="method-detail ">
|
|
<a name="method-i-_deprecated_options"></a>
|
|
|
|
<div class="method-heading">
|
|
|
|
<span class="method-name">_deprecated_options</span><span
|
|
class="method-args">(options)</span>
|
|
<span class="method-click-advice">click to toggle source</span>
|
|
|
|
</div>
|
|
|
|
<div class="method-description">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-source-code"
|
|
id="-deprecated-options-source">
|
|
<pre>
|
|
<span class="ruby-comment cmt"># File lib/bundler/dsl.rb, line 234</span>
|
|
234: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_deprecated_options</span>(<span class="ruby-identifier">options</span>)
|
|
235: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value">:require_as</span>)
|
|
236: <span class="ruby-identifier">raise</span> <span class="ruby-constant">DeprecatedError</span>, <span class="ruby-value str">"Please replace :require_as with :require"</span>
|
|
237: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value">:vendored_at</span>)
|
|
238: <span class="ruby-identifier">raise</span> <span class="ruby-constant">DeprecatedError</span>, <span class="ruby-value str">"Please replace :vendored_at with :path"</span>
|
|
239: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value">:only</span>)
|
|
240: <span class="ruby-identifier">raise</span> <span class="ruby-constant">DeprecatedError</span>, <span class="ruby-value str">"Please replace :only with :group"</span>
|
|
241: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value">:except</span>)
|
|
242: <span class="ruby-identifier">raise</span> <span class="ruby-constant">DeprecatedError</span>, <span class="ruby-value str">"The :except option is no longer supported"</span>
|
|
243: <span class="ruby-keyword kw">end</span>
|
|
244: <span class="ruby-keyword kw">end</span></pre>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div id="-normalize-hash-method" class="method-detail ">
|
|
<a name="method-i-_normalize_hash"></a>
|
|
|
|
<div class="method-heading">
|
|
|
|
<span class="method-name">_normalize_hash</span><span
|
|
class="method-args">(opts)</span>
|
|
<span class="method-click-advice">click to toggle source</span>
|
|
|
|
</div>
|
|
|
|
<div class="method-description">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-source-code"
|
|
id="-normalize-hash-source">
|
|
<pre>
|
|
<span class="ruby-comment cmt"># File lib/bundler/dsl.rb, line 175</span>
|
|
175: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_normalize_hash</span>(<span class="ruby-identifier">opts</span>)
|
|
176: <span class="ruby-comment cmt"># Cannot modify a hash during an iteration in 1.9</span>
|
|
177: <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span><span class="ruby-operator">|</span>
|
|
178: <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">String</span> <span class="ruby-operator">===</span> <span class="ruby-identifier">k</span>
|
|
179: <span class="ruby-identifier">v</span> = <span class="ruby-identifier">opts</span>[<span class="ruby-identifier">k</span>]
|
|
180: <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">k</span>)
|
|
181: <span class="ruby-identifier">opts</span>[<span class="ruby-identifier">k</span>.<span class="ruby-identifier">to_s</span>] = <span class="ruby-identifier">v</span>
|
|
182: <span class="ruby-keyword kw">end</span>
|
|
183: <span class="ruby-identifier">opts</span>
|
|
184: <span class="ruby-keyword kw">end</span></pre>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div id="-normalize-options-method" class="method-detail ">
|
|
<a name="method-i-_normalize_options"></a>
|
|
|
|
<div class="method-heading">
|
|
|
|
<span class="method-name">_normalize_options</span><span
|
|
class="method-args">(name, version, opts)</span>
|
|
<span class="method-click-advice">click to toggle source</span>
|
|
|
|
</div>
|
|
|
|
<div class="method-description">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-source-code"
|
|
id="-normalize-options-source">
|
|
<pre>
|
|
<span class="ruby-comment cmt"># File lib/bundler/dsl.rb, line 186</span>
|
|
186: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_normalize_options</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">version</span>, <span class="ruby-identifier">opts</span>)
|
|
187: <span class="ruby-identifier">_normalize_hash</span>(<span class="ruby-identifier">opts</span>)
|
|
188:
|
|
189: <span class="ruby-identifier">invalid_keys</span> = <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">keys</span> <span class="ruby-operator">-</span> <span class="ruby-node">%(group groups git path name branch ref tag require submodules platform platforms)</span>
|
|
190: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">invalid_keys</span>.<span class="ruby-identifier">any?</span>
|
|
191: <span class="ruby-identifier">plural</span> = <span class="ruby-identifier">invalid_keys</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">></span> <span class="ruby-value">1</span>
|
|
192: <span class="ruby-identifier">message</span> = <span class="ruby-node">"You passed #{invalid_keys.map{|k| ':'+k }.join(", ")} "</span>
|
|
193: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">plural</span>
|
|
194: <span class="ruby-identifier">message</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"as options for gem '#{name}', but they are invalid."</span>
|
|
195: <span class="ruby-keyword kw">else</span>
|
|
196: <span class="ruby-identifier">message</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"as an option for gem '#{name}', but it is invalid."</span>
|
|
197: <span class="ruby-keyword kw">end</span>
|
|
198: <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidOption</span>, <span class="ruby-identifier">message</span>
|
|
199: <span class="ruby-keyword kw">end</span>
|
|
200:
|
|
201: <span class="ruby-identifier">groups</span> = <span class="ruby-ivar">@groups</span>.<span class="ruby-identifier">dup</span>
|
|
202: <span class="ruby-identifier">opts</span>[<span class="ruby-value str">"group"</span>] = <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value str">"groups"</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">opts</span>[<span class="ruby-value str">"group"</span>]
|
|
203: <span class="ruby-identifier">groups</span>.<span class="ruby-identifier">concat</span> <span class="ruby-constant">Array</span>(<span class="ruby-identifier">opts</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value str">"group"</span>))
|
|
204: <span class="ruby-identifier">groups</span> = [<span class="ruby-value">:default</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">groups</span>.<span class="ruby-identifier">empty?</span>
|
|
205:
|
|
206: <span class="ruby-identifier">platforms</span> = <span class="ruby-ivar">@platforms</span>.<span class="ruby-identifier">dup</span>
|
|
207: <span class="ruby-identifier">opts</span>[<span class="ruby-value str">"platforms"</span>] = <span class="ruby-identifier">opts</span>[<span class="ruby-value str">"platform"</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">opts</span>[<span class="ruby-value str">"platforms"</span>]
|
|
208: <span class="ruby-identifier">platforms</span>.<span class="ruby-identifier">concat</span> <span class="ruby-constant">Array</span>(<span class="ruby-identifier">opts</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value str">"platforms"</span>))
|
|
209: <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_sym</span> }
|
|
210: <span class="ruby-identifier">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>
|
|
211: <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">VALID_PLATFORMS</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">p</span>)
|
|
212: <span class="ruby-identifier">raise</span> <span class="ruby-constant">DslError</span>, <span class="ruby-node">"`#{p}` is not a valid platform. The available options are: #{VALID_PLATFORMS.inspect}"</span>
|
|
213: <span class="ruby-keyword kw">end</span>
|
|
214:
|
|
215: <span class="ruby-comment cmt"># Normalize git and path options</span>
|
|
216: [<span class="ruby-value str">"git"</span>, <span class="ruby-value str">"path"</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">type</span><span class="ruby-operator">|</span>
|
|
217: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">param</span> = <span class="ruby-identifier">opts</span>[<span class="ruby-identifier">type</span>]
|
|
218: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">version</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">version</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^\s*=?\s*(\d[^\s]*)\s*$/</span>
|
|
219: <span class="ruby-identifier">options</span> = <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-value str">"name"</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">name</span>, <span class="ruby-value str">"version"</span> =<span class="ruby-operator">></span> <span class="ruby-node">$1</span>)
|
|
220: <span class="ruby-keyword kw">else</span>
|
|
221: <span class="ruby-identifier">options</span> = <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">dup</span>
|
|
222: <span class="ruby-keyword kw">end</span>
|
|
223: <span class="ruby-identifier">source</span> = <span class="ruby-identifier">send</span>(<span class="ruby-identifier">type</span>, <span class="ruby-identifier">param</span>, <span class="ruby-identifier">options</span>, <span class="ruby-value">:prepend</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">true</span>) {}
|
|
224: <span class="ruby-identifier">opts</span>[<span class="ruby-value str">"source"</span>] = <span class="ruby-identifier">source</span>
|
|
225: <span class="ruby-keyword kw">end</span>
|
|
226: <span class="ruby-keyword kw">end</span>
|
|
227:
|
|
228: <span class="ruby-identifier">opts</span>[<span class="ruby-value str">"source"</span>] <span class="ruby-operator">||=</span> <span class="ruby-ivar">@source</span>
|
|
229: <span class="ruby-identifier">opts</span>[<span class="ruby-value str">"env"</span>] <span class="ruby-operator">||=</span> <span class="ruby-ivar">@env</span>
|
|
230: <span class="ruby-identifier">opts</span>[<span class="ruby-value str">"platforms"</span>] = <span class="ruby-identifier">platforms</span>.<span class="ruby-identifier">dup</span>
|
|
231: <span class="ruby-identifier">opts</span>[<span class="ruby-value str">"group"</span>] = <span class="ruby-identifier">groups</span>
|
|
232: <span class="ruby-keyword kw">end</span></pre>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div id="rubygems-source-method" class="method-detail ">
|
|
<a name="method-i-rubygems_source"></a>
|
|
|
|
<div class="method-heading">
|
|
|
|
<span class="method-name">rubygems_source</span><span
|
|
class="method-args">(source)</span>
|
|
<span class="method-click-advice">click to toggle source</span>
|
|
|
|
</div>
|
|
|
|
<div class="method-description">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-source-code"
|
|
id="rubygems-source-source">
|
|
<pre>
|
|
<span class="ruby-comment cmt"># File lib/bundler/dsl.rb, line 170</span>
|
|
170: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rubygems_source</span>(<span class="ruby-identifier">source</span>)
|
|
171: <span class="ruby-ivar">@rubygems_source</span>.<span class="ruby-identifier">add_remote</span> <span class="ruby-identifier">source</span>
|
|
172: <span class="ruby-ivar">@sources</span> <span class="ruby-operator"><<</span> <span class="ruby-ivar">@rubygems_source</span>
|
|
173: <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>
|
|
|