4bf2e0d944
Remove the vendored sqlite3-ruby. Instead, add support for Bundler (which is vendored). Before running the new Instiki, do a ruby bundle which will install all of the needed gems locally. (If you need to, tweak the contents of Gemfile.)
1078 lines
52 KiB
HTML
1078 lines
52 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-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/DeprecatedError.html">Bundler::DeprecatedError</a></li>
|
|
|
|
<li><a href="../Bundler/Dsl.html">Bundler::Dsl</a></li>
|
|
|
|
<li><a href="../Bundler/DslError.html">Bundler::DslError</a></li>
|
|
|
|
<li><a href="../Bundler/Environment.html">Bundler::Environment</a></li>
|
|
|
|
<li><a href="../Bundler/GemHelper.html">Bundler::GemHelper</a></li>
|
|
|
|
<li><a href="../Bundler/GemHelpers.html">Bundler::GemHelpers</a></li>
|
|
|
|
<li><a href="../Bundler/GemNotFound.html">Bundler::GemNotFound</a></li>
|
|
|
|
<li><a href="../Bundler/GemfileError.html">Bundler::GemfileError</a></li>
|
|
|
|
<li><a href="../Bundler/GemfileNotFound.html">Bundler::GemfileNotFound</a></li>
|
|
|
|
<li><a href="../Bundler/GemspecError.html">Bundler::GemspecError</a></li>
|
|
|
|
<li><a href="../Bundler/GitError.html">Bundler::GitError</a></li>
|
|
|
|
<li><a href="../Bundler/Graph.html">Bundler::Graph</a></li>
|
|
|
|
<li><a href="../Bundler/GraphNode.html">Bundler::GraphNode</a></li>
|
|
|
|
<li><a href="../Bundler/Index.html">Bundler::Index</a></li>
|
|
|
|
<li><a href="../Bundler/Installer.html">Bundler::Installer</a></li>
|
|
|
|
<li><a href="../Bundler/InvalidOption.html">Bundler::InvalidOption</a></li>
|
|
|
|
<li><a href="../Bundler/InvalidSpecSet.html">Bundler::InvalidSpecSet</a></li>
|
|
|
|
<li><a href="../Bundler/LazySpecification.html">Bundler::LazySpecification</a></li>
|
|
|
|
<li><a href="../Bundler/LockfileParser.html">Bundler::LockfileParser</a></li>
|
|
|
|
<li><a href="../Bundler/MatchPlatform.html">Bundler::MatchPlatform</a></li>
|
|
|
|
<li><a href="../Bundler/PathError.html">Bundler::PathError</a></li>
|
|
|
|
<li><a href="../Bundler/ProductionError.html">Bundler::ProductionError</a></li>
|
|
|
|
<li><a href="../Bundler/RemoteSpecification.html">Bundler::RemoteSpecification</a></li>
|
|
|
|
<li><a href="../Bundler/Resolver.html">Bundler::Resolver</a></li>
|
|
|
|
<li><a href="../Bundler/Resolver/SpecGroup.html">Bundler::Resolver::SpecGroup</a></li>
|
|
|
|
<li><a href="../Bundler/Runtime.html">Bundler::Runtime</a></li>
|
|
|
|
<li><a href="../Bundler/Settings.html">Bundler::Settings</a></li>
|
|
|
|
<li><a href="../Bundler/SharedHelpers.html">Bundler::SharedHelpers</a></li>
|
|
|
|
<li><a href="../Bundler/SharedHelpers/Gem.html">Bundler::SharedHelpers::Gem</a></li>
|
|
|
|
<li><a href="../Bundler/SharedHelpers/Gem/SourceIndex.html">Bundler::SharedHelpers::Gem::SourceIndex</a></li>
|
|
|
|
<li><a href="../Bundler/Source.html">Bundler::Source</a></li>
|
|
|
|
<li><a href="../Bundler/Source/Git.html">Bundler::Source::Git</a></li>
|
|
|
|
<li><a href="../Bundler/Source/Path.html">Bundler::Source::Path</a></li>
|
|
|
|
<li><a href="../Bundler/Source/Path/Installer.html">Bundler::Source::Path::Installer</a></li>
|
|
|
|
<li><a href="../Bundler/Source/Rubygems.html">Bundler::Source::Rubygems</a></li>
|
|
|
|
<li><a href="../Bundler/SpecSet.html">Bundler::SpecSet</a></li>
|
|
|
|
<li><a href="../Bundler/UI.html">Bundler::UI</a></li>
|
|
|
|
<li><a href="../Bundler/UI/RGProxy.html">Bundler::UI::RGProxy</a></li>
|
|
|
|
<li><a href="../Bundler/UI/Shell.html">Bundler::UI::Shell</a></li>
|
|
|
|
<li><a href="../Bundler/VersionConflict.html">Bundler::VersionConflict</a></li>
|
|
|
|
<li><a href="../Thor.html">Thor</a></li>
|
|
|
|
<li><a href="../Thor/Actions.html">Thor::Actions</a></li>
|
|
|
|
<li><a href="../Thor/Actions/ClassMethods.html">Thor::Actions::ClassMethods</a></li>
|
|
|
|
<li><a href="../Thor/Base.html">Thor::Base</a></li>
|
|
|
|
<li><a href="../Thor/Base/ClassMethods.html">Thor::Base::ClassMethods</a></li>
|
|
|
|
<li><a href="../Thor/DynamicTask.html">Thor::DynamicTask</a></li>
|
|
|
|
<li><a href="../Thor/Error.html">Thor::Error</a></li>
|
|
|
|
<li><a href="../Thor/HiddenTask.html">Thor::HiddenTask</a></li>
|
|
|
|
<li><a href="../Thor/Invocation.html">Thor::Invocation</a></li>
|
|
|
|
<li><a href="../Thor/Invocation/ClassMethods.html">Thor::Invocation::ClassMethods</a></li>
|
|
|
|
<li><a href="../Thor/InvocationError.html">Thor::InvocationError</a></li>
|
|
|
|
<li><a href="../Thor/MalformattedArgumentError.html">Thor::MalformattedArgumentError</a></li>
|
|
|
|
<li><a href="../Thor/RequiredArgumentMissingError.html">Thor::RequiredArgumentMissingError</a></li>
|
|
|
|
<li><a href="../Thor/Shell.html">Thor::Shell</a></li>
|
|
|
|
<li><a href="../Thor/Shell/Basic.html">Thor::Shell::Basic</a></li>
|
|
|
|
<li><a href="../Thor/Shell/Color.html">Thor::Shell::Color</a></li>
|
|
|
|
<li><a href="../Thor/Shell/HTML.html">Thor::Shell::HTML</a></li>
|
|
|
|
<li><a href="../Thor/Task.html">Thor::Task</a></li>
|
|
|
|
<li><a href="../Thor/UndefinedTaskError.html">Thor::UndefinedTaskError</a></li>
|
|
|
|
<li><a href="../Thor/UnknownArgumentError.html">Thor::UnknownArgumentError</a></li>
|
|
|
|
<li><a href="../Thor/Util.html">Thor::Util</a></li>
|
|
|
|
<li><a href="../Gem.html">Gem</a></li>
|
|
|
|
<li><a href="../Gem/Dependency.html">Gem::Dependency</a></li>
|
|
|
|
<li><a href="../Gem/Platform.html">Gem::Platform</a></li>
|
|
|
|
<li><a href="../Gem/Specification.html">Gem::Specification</a></li>
|
|
|
|
</ul>
|
|
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div id="documentation">
|
|
<h1 class="class">Bundler::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 148</span>
|
|
148: <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>)
|
|
149: <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>
|
|
150: <span class="ruby-identifier">message</span> = <span class="ruby-node">"'#{name}' has been removed from the Gemfile DSL, "</span>
|
|
151: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">replacement</span>
|
|
152: <span class="ruby-identifier">message</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"and has been replaced with '#{replacement}'."</span>
|
|
153: <span class="ruby-keyword kw">else</span>
|
|
154: <span class="ruby-identifier">message</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"and is no longer supported."</span>
|
|
155: <span class="ruby-keyword kw">end</span>
|
|
156: <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>
|
|
157: <span class="ruby-identifier">raise</span> <span class="ruby-constant">DeprecatedError</span>, <span class="ruby-identifier">message</span>
|
|
158: <span class="ruby-keyword kw">end</span>
|
|
159: <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)</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>)
|
|
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>
|
|
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 139</span>
|
|
139: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">env</span>(<span class="ruby-identifier">name</span>)
|
|
140: <span class="ruby-ivar">@env</span>, <span class="ruby-identifier">old</span> = <span class="ruby-identifier">name</span>, <span class="ruby-ivar">@env</span>
|
|
141: <span class="ruby-keyword kw">yield</span>
|
|
142: <span class="ruby-keyword kw">ensure</span>
|
|
143: <span class="ruby-ivar">@env</span> = <span class="ruby-identifier">old</span>
|
|
144: <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 49</span>
|
|
49: <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>)
|
|
50: <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>)
|
|
51: <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>
|
|
52: <span class="ruby-keyword kw">end</span>
|
|
53:
|
|
54: <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> {}
|
|
55: <span class="ruby-identifier">version</span> = <span class="ruby-identifier">args</span> <span class="ruby-operator">||</span> [<span class="ruby-value str">">= 0"</span>]
|
|
56: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">group</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value">:groups</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">options</span>[<span class="ruby-value">:group</span>]
|
|
57: <span class="ruby-identifier">options</span>[<span class="ruby-value">:group</span>] = <span class="ruby-identifier">group</span>
|
|
58: <span class="ruby-keyword kw">end</span>
|
|
59:
|
|
60: <span class="ruby-identifier">_deprecated_options</span>(<span class="ruby-identifier">options</span>)
|
|
61: <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>)
|
|
62:
|
|
63: <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>)
|
|
64:
|
|
65: <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> }
|
|
66: <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>
|
|
67: <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>
|
|
68: <span class="ruby-keyword kw">end</span>
|
|
69:
|
|
70: <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>
|
|
71: <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>
|
|
72: <span class="ruby-keyword kw">end</span>
|
|
73: <span class="ruby-keyword kw">end</span>
|
|
74: <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>)
|
|
75: <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">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>
|
|
34: <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>
|
|
35: <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">to_s</span>
|
|
36: <span class="ruby-keyword kw">end</span>
|
|
37: <span class="ruby-identifier">group</span>(<span class="ruby-identifier">development_group</span>) <span class="ruby-keyword kw">do</span>
|
|
38: <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>
|
|
39: <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">to_s</span>
|
|
40: <span class="ruby-keyword kw">end</span>
|
|
41: <span class="ruby-keyword kw">end</span>
|
|
42: <span class="ruby-keyword kw">when</span> <span class="ruby-value">0</span>
|
|
43: <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidOption</span>, <span class="ruby-node">"There are no gemspecs at #{path}."</span>
|
|
44: <span class="ruby-keyword kw">else</span>
|
|
45: <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>
|
|
46: <span class="ruby-keyword kw">end</span>
|
|
47: <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 104</span>
|
|
104: <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>)
|
|
105: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">block_given?</span>
|
|
106: <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>
|
|
107: <span class="ruby-identifier">raise</span> <span class="ruby-constant">DeprecatedError</span>, <span class="ruby-identifier">msg</span>
|
|
108: <span class="ruby-keyword kw">end</span>
|
|
109:
|
|
110: <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>
|
|
111: <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 125</span>
|
|
125: <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>)
|
|
126: <span class="ruby-ivar">@groups</span>.<span class="ruby-identifier">concat</span> <span class="ruby-identifier">args</span>
|
|
127: <span class="ruby-keyword kw">yield</span>
|
|
128: <span class="ruby-keyword kw">ensure</span>
|
|
129: <span class="ruby-identifier">args</span>.<span class="ruby-identifier">each</span> { <span class="ruby-ivar">@groups</span>.<span class="ruby-identifier">pop</span> }
|
|
130: <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 100</span>
|
|
100: <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>)
|
|
101: <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>
|
|
102: <span class="ruby-keyword kw">end</span></pre>
|
|
</div>
|
|
|
|
</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 132</span>
|
|
132: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">platforms</span>(*<span class="ruby-identifier">platforms</span>)
|
|
133: <span class="ruby-ivar">@platforms</span>.<span class="ruby-identifier">concat</span> <span class="ruby-identifier">platforms</span>
|
|
134: <span class="ruby-keyword kw">yield</span>
|
|
135: <span class="ruby-keyword kw">ensure</span>
|
|
136: <span class="ruby-identifier">platforms</span>.<span class="ruby-identifier">each</span> { <span class="ruby-ivar">@platforms</span>.<span class="ruby-identifier">pop</span> }
|
|
137: <span class="ruby-keyword kw">end</span></pre>
|
|
</div>
|
|
|
|
</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 81</span>
|
|
81: <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> = {})
|
|
82: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">source</span>
|
|
83: <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>
|
|
84: <span class="ruby-identifier">rubygems_source</span> <span class="ruby-value str">"http://rubygems.org"</span>
|
|
85: <span class="ruby-keyword kw">return</span>
|
|
86: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">String</span>
|
|
87: <span class="ruby-identifier">rubygems_source</span> <span class="ruby-identifier">source</span>
|
|
88: <span class="ruby-keyword kw">return</span>
|
|
89: <span class="ruby-keyword kw">end</span>
|
|
90:
|
|
91: <span class="ruby-ivar">@source</span> = <span class="ruby-identifier">source</span>
|
|
92: <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>
|
|
93:
|
|
94: <span class="ruby-keyword kw">yield</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
|
|
95: <span class="ruby-ivar">@source</span>
|
|
96: <span class="ruby-keyword kw">ensure</span>
|
|
97: <span class="ruby-ivar">@source</span> = <span class="ruby-keyword kw">nil</span>
|
|
98: <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 119</span>
|
|
119: <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>)
|
|
120: <span class="ruby-ivar">@sources</span> <span class="ruby-operator"><<</span> <span class="ruby-ivar">@rubygems_source</span>
|
|
121: <span class="ruby-ivar">@sources</span>.<span class="ruby-identifier">uniq!</span>
|
|
122: <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>)
|
|
123: <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 233</span>
|
|
233: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_deprecated_options</span>(<span class="ruby-identifier">options</span>)
|
|
234: <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>)
|
|
235: <span class="ruby-identifier">raise</span> <span class="ruby-constant">DeprecatedError</span>, <span class="ruby-value str">"Please replace :require_as with :require"</span>
|
|
236: <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>)
|
|
237: <span class="ruby-identifier">raise</span> <span class="ruby-constant">DeprecatedError</span>, <span class="ruby-value str">"Please replace :vendored_at with :path"</span>
|
|
238: <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>)
|
|
239: <span class="ruby-identifier">raise</span> <span class="ruby-constant">DeprecatedError</span>, <span class="ruby-value str">"Please replace :only with :group"</span>
|
|
240: <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>)
|
|
241: <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>
|
|
242: <span class="ruby-keyword kw">end</span>
|
|
243: <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 176</span>
|
|
176: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_normalize_hash</span>(<span class="ruby-identifier">opts</span>)
|
|
177: <span class="ruby-comment cmt"># Cannot modify a hash during an iteration in 1.9</span>
|
|
178: <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>
|
|
179: <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>
|
|
180: <span class="ruby-identifier">v</span> = <span class="ruby-identifier">opts</span>[<span class="ruby-identifier">k</span>]
|
|
181: <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">k</span>)
|
|
182: <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>
|
|
183: <span class="ruby-keyword kw">end</span>
|
|
184: <span class="ruby-identifier">opts</span>
|
|
185: <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 187</span>
|
|
187: <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>)
|
|
188: <span class="ruby-identifier">_normalize_hash</span>(<span class="ruby-identifier">opts</span>)
|
|
189:
|
|
190: <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 git path name branch ref tag require submodules platforms)</span>
|
|
191: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">invalid_keys</span>.<span class="ruby-identifier">any?</span>
|
|
192: <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>
|
|
193: <span class="ruby-identifier">message</span> = <span class="ruby-node">"You passed #{invalid_keys.map{|k| ':'+k }.join(", ")} "</span>
|
|
194: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">plural</span>
|
|
195: <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>
|
|
196: <span class="ruby-keyword kw">else</span>
|
|
197: <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>
|
|
198: <span class="ruby-keyword kw">end</span>
|
|
199: <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidOption</span>, <span class="ruby-identifier">message</span>
|
|
200: <span class="ruby-keyword kw">end</span>
|
|
201:
|
|
202: <span class="ruby-identifier">groups</span> = <span class="ruby-ivar">@groups</span>.<span class="ruby-identifier">dup</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">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>))
|
|
208: <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> }
|
|
209: <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>
|
|
210: <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>)
|
|
211: <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>
|
|
212: <span class="ruby-keyword kw">end</span>
|
|
213:
|
|
214: <span class="ruby-comment cmt"># Normalize git and path options</span>
|
|
215: [<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>
|
|
216: <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>]
|
|
217: <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>
|
|
218: <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>)
|
|
219: <span class="ruby-keyword kw">else</span>
|
|
220: <span class="ruby-identifier">options</span> = <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">dup</span>
|
|
221: <span class="ruby-keyword kw">end</span>
|
|
222: <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>) {}
|
|
223: <span class="ruby-identifier">opts</span>[<span class="ruby-value str">"source"</span>] = <span class="ruby-identifier">source</span>
|
|
224: <span class="ruby-keyword kw">end</span>
|
|
225: <span class="ruby-keyword kw">end</span>
|
|
226:
|
|
227: <span class="ruby-identifier">opts</span>[<span class="ruby-value str">"source"</span>] <span class="ruby-operator">||=</span> <span class="ruby-ivar">@source</span>
|
|
228: <span class="ruby-identifier">opts</span>[<span class="ruby-value str">"env"</span>] <span class="ruby-operator">||=</span> <span class="ruby-ivar">@env</span>
|
|
229: <span class="ruby-identifier">opts</span>[<span class="ruby-value str">"platforms"</span>] = <span class="ruby-ivar">@platforms</span>.<span class="ruby-identifier">dup</span>
|
|
230: <span class="ruby-identifier">opts</span>[<span class="ruby-value str">"group"</span>] = <span class="ruby-identifier">groups</span>
|
|
231: <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 171</span>
|
|
171: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rubygems_source</span>(<span class="ruby-identifier">source</span>)
|
|
172: <span class="ruby-ivar">@rubygems_source</span>.<span class="ruby-identifier">add_remote</span> <span class="ruby-identifier">source</span>
|
|
173: <span class="ruby-ivar">@sources</span> <span class="ruby-operator"><<</span> <span class="ruby-ivar">@rubygems_source</span>
|
|
174: <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>
|
|
|