cli 1.3.1 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +5 -7
- data/Gemfile.lock +29 -37
- data/README.md +17 -18
- data/Rakefile +1 -28
- data/cli.gemspec +14 -84
- data/rdoc/CLI/Arguments.html +178 -0
- data/rdoc/CLI/DSL/Argument.html +200 -0
- data/rdoc/CLI/DSL/Arguments.html +172 -0
- data/rdoc/CLI/DSL/Base.html +154 -0
- data/rdoc/CLI/DSL/Cast.html +152 -0
- data/rdoc/CLI/DSL/Description.html +150 -0
- data/rdoc/CLI/DSL/Input.html +143 -0
- data/rdoc/CLI/DSL/MultiDefault.html +151 -0
- data/rdoc/CLI/DSL/Option.html +143 -0
- data/rdoc/CLI/DSL/Options.html +142 -0
- data/rdoc/CLI/DSL/Switch.html +267 -0
- data/rdoc/CLI/DSL/Value.html +238 -0
- data/rdoc/CLI/DSL.html +91 -0
- data/rdoc/CLI/Options.html +200 -0
- data/rdoc/CLI/ParserError/ArgumentNameSpecifiedTwice.html +138 -0
- data/rdoc/CLI/ParserError/LongNameSpecifiedTwiceError.html +138 -0
- data/rdoc/CLI/ParserError/MultipleArgumentsSpecifierError.html +138 -0
- data/rdoc/CLI/ParserError/NameArgumetNotSymbolError.html +138 -0
- data/rdoc/CLI/ParserError/OptionsArgumentNotHashError.html +138 -0
- data/rdoc/CLI/ParserError/ShortNameIsInvalidError.html +138 -0
- data/rdoc/CLI/ParserError/ShortNameNotSymbolError.html +138 -0
- data/rdoc/CLI/ParserError/ShortNameSpecifiedTwiceError.html +138 -0
- data/rdoc/CLI/ParserError.html +97 -0
- data/rdoc/CLI/ParsingError/CastError.html +138 -0
- data/rdoc/CLI/ParsingError/MandatoryArgumentNotSpecifiedError.html +138 -0
- data/rdoc/CLI/ParsingError/MandatoryOptionsNotSpecifiedError.html +138 -0
- data/rdoc/CLI/ParsingError/MissingOptionValueError.html +138 -0
- data/rdoc/CLI/ParsingError/UnknownSwitchError.html +138 -0
- data/rdoc/CLI/ParsingError/UsageError.html +97 -0
- data/rdoc/CLI/ParsingError.html +97 -0
- data/rdoc/CLI/Switches.html +306 -0
- data/rdoc/CLI/Values.html +202 -0
- data/rdoc/CLI.html +652 -0
- data/rdoc/README_md.html +553 -0
- data/rdoc/created.rid +7 -0
- data/rdoc/css/fonts.css +167 -0
- data/rdoc/css/rdoc.css +639 -0
- data/rdoc/fonts/Lato-Light.ttf +0 -0
- data/rdoc/fonts/Lato-LightItalic.ttf +0 -0
- data/rdoc/fonts/Lato-Regular.ttf +0 -0
- data/rdoc/fonts/Lato-RegularItalic.ttf +0 -0
- data/rdoc/fonts/SourceCodePro-Bold.ttf +0 -0
- data/rdoc/fonts/SourceCodePro-Regular.ttf +0 -0
- data/rdoc/images/add.png +0 -0
- data/rdoc/images/arrow_up.png +0 -0
- data/rdoc/images/brick.png +0 -0
- data/rdoc/images/brick_link.png +0 -0
- data/rdoc/images/bug.png +0 -0
- data/rdoc/images/bullet_black.png +0 -0
- data/rdoc/images/bullet_toggle_minus.png +0 -0
- data/rdoc/images/bullet_toggle_plus.png +0 -0
- data/rdoc/images/date.png +0 -0
- data/rdoc/images/delete.png +0 -0
- data/rdoc/images/find.png +0 -0
- data/rdoc/images/loadingAnimation.gif +0 -0
- data/rdoc/images/macFFBgHack.png +0 -0
- data/rdoc/images/package.png +0 -0
- data/rdoc/images/page_green.png +0 -0
- data/rdoc/images/page_white_text.png +0 -0
- data/rdoc/images/page_white_width.png +0 -0
- data/rdoc/images/plugin.png +0 -0
- data/rdoc/images/ruby.png +0 -0
- data/rdoc/images/tag_blue.png +0 -0
- data/rdoc/images/tag_green.png +0 -0
- data/rdoc/images/transparent.png +0 -0
- data/rdoc/images/wrench.png +0 -0
- data/rdoc/images/wrench_orange.png +0 -0
- data/rdoc/images/zoom.png +0 -0
- data/rdoc/index.html +120 -0
- data/rdoc/js/darkfish.js +84 -0
- data/rdoc/js/navigation.js +105 -0
- data/rdoc/js/navigation.js.gz +0 -0
- data/rdoc/js/search.js +110 -0
- data/rdoc/js/search_index.js +1 -0
- data/rdoc/js/search_index.js.gz +0 -0
- data/rdoc/js/searcher.js +229 -0
- data/rdoc/js/searcher.js.gz +0 -0
- data/rdoc/table_of_contents.html +533 -0
- data/spec/argument_spec.rb +104 -105
- data/spec/cli_spec.rb +27 -28
- data/spec/conflict_reporting_spec.rb +16 -17
- data/spec/option_spec.rb +60 -61
- data/spec/separator_spec.rb +19 -20
- data/spec/stdin_spec.rb +13 -14
- data/spec/switch_spec.rb +15 -16
- data/spec/usage_spec.rb +80 -81
- metadata +91 -139
- data/.document +0 -5
- data/.rspec +0 -1
- data/VERSION +0 -1
- data/features/cli.feature +0 -9
- data/features/step_definitions/cli_steps.rb +0 -0
- data/features/support/env.rb +0 -13
@@ -0,0 +1,152 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>module CLI::DSL::Cast - cli 1.3.1</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "../../";
|
11
|
+
var index_rel_prefix = "../../";
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script src="../../js/navigation.js" defer></script>
|
15
|
+
<script src="../../js/search.js" defer></script>
|
16
|
+
<script src="../../js/search_index.js" defer></script>
|
17
|
+
<script src="../../js/searcher.js" defer></script>
|
18
|
+
<script src="../../js/darkfish.js" defer></script>
|
19
|
+
|
20
|
+
<link href="../../css/fonts.css" rel="stylesheet">
|
21
|
+
<link href="../../css/rdoc.css" rel="stylesheet">
|
22
|
+
|
23
|
+
|
24
|
+
<body id="top" role="document" class="module">
|
25
|
+
<nav role="navigation">
|
26
|
+
<div id="project-navigation">
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
28
|
+
<h2>
|
29
|
+
<a href="../../index.html" rel="home">Home</a>
|
30
|
+
</h2>
|
31
|
+
|
32
|
+
<div id="table-of-contents-navigation">
|
33
|
+
<a href="../../table_of_contents.html#pages">Pages</a>
|
34
|
+
<a href="../../table_of_contents.html#classes">Classes</a>
|
35
|
+
<a href="../../table_of_contents.html#methods">Methods</a>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
41
|
+
<div id="search-field-wrapper">
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
44
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
49
|
+
aria-busy="false" aria-expanded="false"
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
51
|
+
</form>
|
52
|
+
</div>
|
53
|
+
|
54
|
+
</div>
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
<div id="class-metadata">
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
<!-- Method Quickref -->
|
65
|
+
<div id="method-list-section" class="nav-section">
|
66
|
+
<h3>Methods</h3>
|
67
|
+
|
68
|
+
<ul class="link-list" role="directory">
|
69
|
+
<li ><a href="#method-i-cast">#cast</a>
|
70
|
+
</ul>
|
71
|
+
</div>
|
72
|
+
|
73
|
+
</div>
|
74
|
+
</nav>
|
75
|
+
|
76
|
+
<main role="main" aria-labelledby="module-CLI::DSL::Cast">
|
77
|
+
<h1 id="module-CLI::DSL::Cast" class="module">
|
78
|
+
module CLI::DSL::Cast
|
79
|
+
</h1>
|
80
|
+
|
81
|
+
<section class="description">
|
82
|
+
|
83
|
+
</section>
|
84
|
+
|
85
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
92
|
+
<header>
|
93
|
+
<h3>Public Instance Methods</h3>
|
94
|
+
</header>
|
95
|
+
|
96
|
+
<div id="method-i-cast" class="method-detail ">
|
97
|
+
<div class="method-heading">
|
98
|
+
<span class="method-name">cast</span><span
|
99
|
+
class="method-args">(value)</span>
|
100
|
+
<span class="method-click-advice">click to toggle source</span>
|
101
|
+
</div>
|
102
|
+
|
103
|
+
<div class="method-description">
|
104
|
+
|
105
|
+
|
106
|
+
<div class="method-source-code" id="cast-source">
|
107
|
+
<pre><span class="ruby-comment"># File lib/cli/dsl.rb, line 16</span>
|
108
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">cast</span>(<span class="ruby-identifier">value</span>)
|
109
|
+
<span class="ruby-keyword">begin</span>
|
110
|
+
<span class="ruby-identifier">cast_to</span> = <span class="ruby-ivar">@options</span>[<span class="ruby-value">:cast</span>] <span class="ruby-keyword">or</span> <span class="ruby-keyword">return</span> <span class="ruby-identifier">value</span>
|
111
|
+
|
112
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">cast_to</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">Module</span> <span class="ruby-comment"># all classes are modules</span>
|
113
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">cast_to</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Integer</span>
|
114
|
+
<span class="ruby-constant">Integer</span>(<span class="ruby-identifier">value</span>)
|
115
|
+
<span class="ruby-keyword">elsif</span> <span class="ruby-identifier">cast_to</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Float</span>
|
116
|
+
<span class="ruby-constant">Float</span>(<span class="ruby-identifier">value</span>)
|
117
|
+
<span class="ruby-keyword">elsif</span> <span class="ruby-identifier">cast_to</span>.<span class="ruby-identifier">respond_to?</span> <span class="ruby-value">:new</span>
|
118
|
+
<span class="ruby-identifier">cast_to</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">value</span>)
|
119
|
+
<span class="ruby-keyword">elsif</span> <span class="ruby-identifier">cast_to</span>.<span class="ruby-identifier">respond_to?</span> <span class="ruby-value">:load</span>
|
120
|
+
<span class="ruby-identifier">cast_to</span>.<span class="ruby-identifier">load</span>(<span class="ruby-identifier">value</span>)
|
121
|
+
<span class="ruby-keyword">else</span>
|
122
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">"can't cast to class or module #{cast_to.class.name}"</span>
|
123
|
+
<span class="ruby-keyword">end</span>
|
124
|
+
<span class="ruby-keyword">else</span>
|
125
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">cast_to</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">Proc</span>
|
126
|
+
<span class="ruby-identifier">cast_to</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">value</span>)
|
127
|
+
<span class="ruby-keyword">else</span>
|
128
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">"can't cast to instance of #{cast_to.class.name}"</span>
|
129
|
+
<span class="ruby-keyword">end</span>
|
130
|
+
<span class="ruby-keyword">end</span>
|
131
|
+
<span class="ruby-keyword">rescue</span> <span class="ruby-operator">=></span> <span class="ruby-identifier">e</span>
|
132
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ParsingError</span><span class="ruby-operator">::</span><span class="ruby-constant">CastError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@name</span>, <span class="ruby-ivar">@options</span>[<span class="ruby-value">:cast</span>].<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:name</span>) <span class="ruby-operator">?</span> <span class="ruby-ivar">@options</span>[<span class="ruby-value">:cast</span>].<span class="ruby-identifier">name</span> <span class="ruby-operator">:</span> <span class="ruby-ivar">@options</span>[<span class="ruby-value">:cast</span>], <span class="ruby-identifier">e</span>)
|
133
|
+
<span class="ruby-keyword">end</span>
|
134
|
+
<span class="ruby-keyword">end</span></pre>
|
135
|
+
</div>
|
136
|
+
</div>
|
137
|
+
|
138
|
+
|
139
|
+
</div>
|
140
|
+
|
141
|
+
</section>
|
142
|
+
|
143
|
+
</section>
|
144
|
+
</main>
|
145
|
+
|
146
|
+
|
147
|
+
<footer id="validator-badges" role="contentinfo">
|
148
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
149
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.
|
150
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
151
|
+
</footer>
|
152
|
+
|
@@ -0,0 +1,150 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>module CLI::DSL::Description - cli 1.3.1</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "../../";
|
11
|
+
var index_rel_prefix = "../../";
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script src="../../js/navigation.js" defer></script>
|
15
|
+
<script src="../../js/search.js" defer></script>
|
16
|
+
<script src="../../js/search_index.js" defer></script>
|
17
|
+
<script src="../../js/searcher.js" defer></script>
|
18
|
+
<script src="../../js/darkfish.js" defer></script>
|
19
|
+
|
20
|
+
<link href="../../css/fonts.css" rel="stylesheet">
|
21
|
+
<link href="../../css/rdoc.css" rel="stylesheet">
|
22
|
+
|
23
|
+
|
24
|
+
<body id="top" role="document" class="module">
|
25
|
+
<nav role="navigation">
|
26
|
+
<div id="project-navigation">
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
28
|
+
<h2>
|
29
|
+
<a href="../../index.html" rel="home">Home</a>
|
30
|
+
</h2>
|
31
|
+
|
32
|
+
<div id="table-of-contents-navigation">
|
33
|
+
<a href="../../table_of_contents.html#pages">Pages</a>
|
34
|
+
<a href="../../table_of_contents.html#classes">Classes</a>
|
35
|
+
<a href="../../table_of_contents.html#methods">Methods</a>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
41
|
+
<div id="search-field-wrapper">
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
44
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
49
|
+
aria-busy="false" aria-expanded="false"
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
51
|
+
</form>
|
52
|
+
</div>
|
53
|
+
|
54
|
+
</div>
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
<div id="class-metadata">
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
<!-- Method Quickref -->
|
65
|
+
<div id="method-list-section" class="nav-section">
|
66
|
+
<h3>Methods</h3>
|
67
|
+
|
68
|
+
<ul class="link-list" role="directory">
|
69
|
+
<li ><a href="#method-i-description">#description</a>
|
70
|
+
<li ><a href="#method-i-description-3F">#description?</a>
|
71
|
+
</ul>
|
72
|
+
</div>
|
73
|
+
|
74
|
+
</div>
|
75
|
+
</nav>
|
76
|
+
|
77
|
+
<main role="main" aria-labelledby="module-CLI::DSL::Description">
|
78
|
+
<h1 id="module-CLI::DSL::Description" class="module">
|
79
|
+
module CLI::DSL::Description
|
80
|
+
</h1>
|
81
|
+
|
82
|
+
<section class="description">
|
83
|
+
|
84
|
+
</section>
|
85
|
+
|
86
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
93
|
+
<header>
|
94
|
+
<h3>Public Instance Methods</h3>
|
95
|
+
</header>
|
96
|
+
|
97
|
+
<div id="method-i-description" class="method-detail ">
|
98
|
+
<div class="method-heading">
|
99
|
+
<span class="method-name">description</span><span
|
100
|
+
class="method-args">()</span>
|
101
|
+
<span class="method-click-advice">click to toggle source</span>
|
102
|
+
</div>
|
103
|
+
|
104
|
+
<div class="method-description">
|
105
|
+
|
106
|
+
|
107
|
+
<div class="method-source-code" id="description-source">
|
108
|
+
<pre><span class="ruby-comment"># File lib/cli/dsl.rb, line 50</span>
|
109
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">description</span>
|
110
|
+
<span class="ruby-ivar">@options</span>[<span class="ruby-value">:description</span>].<span class="ruby-identifier">to_s</span>
|
111
|
+
<span class="ruby-keyword">end</span></pre>
|
112
|
+
</div>
|
113
|
+
</div>
|
114
|
+
|
115
|
+
|
116
|
+
</div>
|
117
|
+
|
118
|
+
<div id="method-i-description-3F" class="method-detail ">
|
119
|
+
<div class="method-heading">
|
120
|
+
<span class="method-name">description?</span><span
|
121
|
+
class="method-args">()</span>
|
122
|
+
<span class="method-click-advice">click to toggle source</span>
|
123
|
+
</div>
|
124
|
+
|
125
|
+
<div class="method-description">
|
126
|
+
|
127
|
+
|
128
|
+
<div class="method-source-code" id="description-3F-source">
|
129
|
+
<pre><span class="ruby-comment"># File lib/cli/dsl.rb, line 46</span>
|
130
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">description?</span>
|
131
|
+
<span class="ruby-ivar">@options</span>.<span class="ruby-identifier">member?</span> <span class="ruby-value">:description</span>
|
132
|
+
<span class="ruby-keyword">end</span></pre>
|
133
|
+
</div>
|
134
|
+
</div>
|
135
|
+
|
136
|
+
|
137
|
+
</div>
|
138
|
+
|
139
|
+
</section>
|
140
|
+
|
141
|
+
</section>
|
142
|
+
</main>
|
143
|
+
|
144
|
+
|
145
|
+
<footer id="validator-badges" role="contentinfo">
|
146
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
147
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.
|
148
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
149
|
+
</footer>
|
150
|
+
|
@@ -0,0 +1,143 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class CLI::DSL::Input - cli 1.3.1</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "../../";
|
11
|
+
var index_rel_prefix = "../../";
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script src="../../js/navigation.js" defer></script>
|
15
|
+
<script src="../../js/search.js" defer></script>
|
16
|
+
<script src="../../js/search_index.js" defer></script>
|
17
|
+
<script src="../../js/searcher.js" defer></script>
|
18
|
+
<script src="../../js/darkfish.js" defer></script>
|
19
|
+
|
20
|
+
<link href="../../css/fonts.css" rel="stylesheet">
|
21
|
+
<link href="../../css/rdoc.css" rel="stylesheet">
|
22
|
+
|
23
|
+
|
24
|
+
<body id="top" role="document" class="class">
|
25
|
+
<nav role="navigation">
|
26
|
+
<div id="project-navigation">
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
28
|
+
<h2>
|
29
|
+
<a href="../../index.html" rel="home">Home</a>
|
30
|
+
</h2>
|
31
|
+
|
32
|
+
<div id="table-of-contents-navigation">
|
33
|
+
<a href="../../table_of_contents.html#pages">Pages</a>
|
34
|
+
<a href="../../table_of_contents.html#classes">Classes</a>
|
35
|
+
<a href="../../table_of_contents.html#methods">Methods</a>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
41
|
+
<div id="search-field-wrapper">
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
44
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
49
|
+
aria-busy="false" aria-expanded="false"
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
51
|
+
</form>
|
52
|
+
</div>
|
53
|
+
|
54
|
+
</div>
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
<div id="class-metadata">
|
59
|
+
|
60
|
+
|
61
|
+
<div id="parent-class-section" class="nav-section">
|
62
|
+
<h3>Parent</h3>
|
63
|
+
|
64
|
+
<p class="link"><a href="Base.html">CLI::DSL::Base</a>
|
65
|
+
</div>
|
66
|
+
|
67
|
+
|
68
|
+
<div id="includes-section" class="nav-section">
|
69
|
+
<h3>Included Modules</h3>
|
70
|
+
|
71
|
+
<ul class="link-list">
|
72
|
+
<li><a class="include" href="Cast.html">CLI::DSL::Cast</a>
|
73
|
+
<li><a class="include" href="Description.html">CLI::DSL::Description</a>
|
74
|
+
</ul>
|
75
|
+
</div>
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<!-- Method Quickref -->
|
80
|
+
<div id="method-list-section" class="nav-section">
|
81
|
+
<h3>Methods</h3>
|
82
|
+
|
83
|
+
<ul class="link-list" role="directory">
|
84
|
+
<li ><a href="#method-i-to_s">#to_s</a>
|
85
|
+
</ul>
|
86
|
+
</div>
|
87
|
+
|
88
|
+
</div>
|
89
|
+
</nav>
|
90
|
+
|
91
|
+
<main role="main" aria-labelledby="class-CLI::DSL::Input">
|
92
|
+
<h1 id="class-CLI::DSL::Input" class="class">
|
93
|
+
class CLI::DSL::Input
|
94
|
+
</h1>
|
95
|
+
|
96
|
+
<section class="description">
|
97
|
+
|
98
|
+
</section>
|
99
|
+
|
100
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
107
|
+
<header>
|
108
|
+
<h3>Public Instance Methods</h3>
|
109
|
+
</header>
|
110
|
+
|
111
|
+
<div id="method-i-to_s" class="method-detail ">
|
112
|
+
<div class="method-heading">
|
113
|
+
<span class="method-name">to_s</span><span
|
114
|
+
class="method-args">()</span>
|
115
|
+
<span class="method-click-advice">click to toggle source</span>
|
116
|
+
</div>
|
117
|
+
|
118
|
+
<div class="method-description">
|
119
|
+
|
120
|
+
|
121
|
+
<div class="method-source-code" id="to_s-source">
|
122
|
+
<pre><span class="ruby-comment"># File lib/cli/dsl.rb, line 96</span>
|
123
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">to_s</span>
|
124
|
+
(<span class="ruby-ivar">@name</span> <span class="ruby-keyword">or</span> <span class="ruby-ivar">@options</span>[<span class="ruby-value">:cast</span>] <span class="ruby-keyword">or</span> <span class="ruby-string">'data'</span>).<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">tr</span>(<span class="ruby-string">'_'</span>, <span class="ruby-string">'-'</span>)
|
125
|
+
<span class="ruby-keyword">end</span></pre>
|
126
|
+
</div>
|
127
|
+
</div>
|
128
|
+
|
129
|
+
|
130
|
+
</div>
|
131
|
+
|
132
|
+
</section>
|
133
|
+
|
134
|
+
</section>
|
135
|
+
</main>
|
136
|
+
|
137
|
+
|
138
|
+
<footer id="validator-badges" role="contentinfo">
|
139
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
140
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.
|
141
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
142
|
+
</footer>
|
143
|
+
|
@@ -0,0 +1,151 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>module CLI::DSL::MultiDefault - cli 1.3.1</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "../../";
|
11
|
+
var index_rel_prefix = "../../";
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script src="../../js/navigation.js" defer></script>
|
15
|
+
<script src="../../js/search.js" defer></script>
|
16
|
+
<script src="../../js/search_index.js" defer></script>
|
17
|
+
<script src="../../js/searcher.js" defer></script>
|
18
|
+
<script src="../../js/darkfish.js" defer></script>
|
19
|
+
|
20
|
+
<link href="../../css/fonts.css" rel="stylesheet">
|
21
|
+
<link href="../../css/rdoc.css" rel="stylesheet">
|
22
|
+
|
23
|
+
|
24
|
+
<body id="top" role="document" class="module">
|
25
|
+
<nav role="navigation">
|
26
|
+
<div id="project-navigation">
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
28
|
+
<h2>
|
29
|
+
<a href="../../index.html" rel="home">Home</a>
|
30
|
+
</h2>
|
31
|
+
|
32
|
+
<div id="table-of-contents-navigation">
|
33
|
+
<a href="../../table_of_contents.html#pages">Pages</a>
|
34
|
+
<a href="../../table_of_contents.html#classes">Classes</a>
|
35
|
+
<a href="../../table_of_contents.html#methods">Methods</a>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
41
|
+
<div id="search-field-wrapper">
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
44
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
49
|
+
aria-busy="false" aria-expanded="false"
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
51
|
+
</form>
|
52
|
+
</div>
|
53
|
+
|
54
|
+
</div>
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
<div id="class-metadata">
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
<!-- Method Quickref -->
|
65
|
+
<div id="method-list-section" class="nav-section">
|
66
|
+
<h3>Methods</h3>
|
67
|
+
|
68
|
+
<ul class="link-list" role="directory">
|
69
|
+
<li ><a href="#method-i-default">#default</a>
|
70
|
+
<li ><a href="#method-i-default_cast">#default_cast</a>
|
71
|
+
</ul>
|
72
|
+
</div>
|
73
|
+
|
74
|
+
</div>
|
75
|
+
</nav>
|
76
|
+
|
77
|
+
<main role="main" aria-labelledby="module-CLI::DSL::MultiDefault">
|
78
|
+
<h1 id="module-CLI::DSL::MultiDefault" class="module">
|
79
|
+
module CLI::DSL::MultiDefault
|
80
|
+
</h1>
|
81
|
+
|
82
|
+
<section class="description">
|
83
|
+
|
84
|
+
</section>
|
85
|
+
|
86
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
93
|
+
<header>
|
94
|
+
<h3>Public Instance Methods</h3>
|
95
|
+
</header>
|
96
|
+
|
97
|
+
<div id="method-i-default" class="method-detail ">
|
98
|
+
<div class="method-heading">
|
99
|
+
<span class="method-name">default</span><span
|
100
|
+
class="method-args">()</span>
|
101
|
+
<span class="method-click-advice">click to toggle source</span>
|
102
|
+
</div>
|
103
|
+
|
104
|
+
<div class="method-description">
|
105
|
+
|
106
|
+
|
107
|
+
<div class="method-source-code" id="default-source">
|
108
|
+
<pre><span class="ruby-comment"># File lib/cli/dsl.rb, line 82</span>
|
109
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">default</span>
|
110
|
+
<span class="ruby-identifier">value</span> = <span class="ruby-ivar">@options</span>[<span class="ruby-value">:default</span>]
|
111
|
+
<span class="ruby-identifier">value</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">v</span>.<span class="ruby-identifier">to_s</span>} <span class="ruby-operator">:</span> [<span class="ruby-identifier">value</span>.<span class="ruby-identifier">to_s</span>]
|
112
|
+
<span class="ruby-keyword">end</span></pre>
|
113
|
+
</div>
|
114
|
+
</div>
|
115
|
+
|
116
|
+
|
117
|
+
</div>
|
118
|
+
|
119
|
+
<div id="method-i-default_cast" class="method-detail ">
|
120
|
+
<div class="method-heading">
|
121
|
+
<span class="method-name">default_cast</span><span
|
122
|
+
class="method-args">()</span>
|
123
|
+
<span class="method-click-advice">click to toggle source</span>
|
124
|
+
</div>
|
125
|
+
|
126
|
+
<div class="method-description">
|
127
|
+
|
128
|
+
|
129
|
+
<div class="method-source-code" id="default_cast-source">
|
130
|
+
<pre><span class="ruby-comment"># File lib/cli/dsl.rb, line 87</span>
|
131
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">default_cast</span>
|
132
|
+
<span class="ruby-identifier">default</span>.<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">d</span><span class="ruby-operator">|</span> <span class="ruby-identifier">cast</span>(<span class="ruby-identifier">d</span>)}
|
133
|
+
<span class="ruby-keyword">end</span></pre>
|
134
|
+
</div>
|
135
|
+
</div>
|
136
|
+
|
137
|
+
|
138
|
+
</div>
|
139
|
+
|
140
|
+
</section>
|
141
|
+
|
142
|
+
</section>
|
143
|
+
</main>
|
144
|
+
|
145
|
+
|
146
|
+
<footer id="validator-badges" role="contentinfo">
|
147
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
148
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.
|
149
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
150
|
+
</footer>
|
151
|
+
|