cli 1.3.1 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +5 -7
  3. data/Gemfile.lock +29 -37
  4. data/README.md +17 -18
  5. data/Rakefile +1 -28
  6. data/cli.gemspec +14 -84
  7. data/rdoc/CLI/Arguments.html +178 -0
  8. data/rdoc/CLI/DSL/Argument.html +200 -0
  9. data/rdoc/CLI/DSL/Arguments.html +172 -0
  10. data/rdoc/CLI/DSL/Base.html +154 -0
  11. data/rdoc/CLI/DSL/Cast.html +152 -0
  12. data/rdoc/CLI/DSL/Description.html +150 -0
  13. data/rdoc/CLI/DSL/Input.html +143 -0
  14. data/rdoc/CLI/DSL/MultiDefault.html +151 -0
  15. data/rdoc/CLI/DSL/Option.html +143 -0
  16. data/rdoc/CLI/DSL/Options.html +142 -0
  17. data/rdoc/CLI/DSL/Switch.html +267 -0
  18. data/rdoc/CLI/DSL/Value.html +238 -0
  19. data/rdoc/CLI/DSL.html +91 -0
  20. data/rdoc/CLI/Options.html +200 -0
  21. data/rdoc/CLI/ParserError/ArgumentNameSpecifiedTwice.html +138 -0
  22. data/rdoc/CLI/ParserError/LongNameSpecifiedTwiceError.html +138 -0
  23. data/rdoc/CLI/ParserError/MultipleArgumentsSpecifierError.html +138 -0
  24. data/rdoc/CLI/ParserError/NameArgumetNotSymbolError.html +138 -0
  25. data/rdoc/CLI/ParserError/OptionsArgumentNotHashError.html +138 -0
  26. data/rdoc/CLI/ParserError/ShortNameIsInvalidError.html +138 -0
  27. data/rdoc/CLI/ParserError/ShortNameNotSymbolError.html +138 -0
  28. data/rdoc/CLI/ParserError/ShortNameSpecifiedTwiceError.html +138 -0
  29. data/rdoc/CLI/ParserError.html +97 -0
  30. data/rdoc/CLI/ParsingError/CastError.html +138 -0
  31. data/rdoc/CLI/ParsingError/MandatoryArgumentNotSpecifiedError.html +138 -0
  32. data/rdoc/CLI/ParsingError/MandatoryOptionsNotSpecifiedError.html +138 -0
  33. data/rdoc/CLI/ParsingError/MissingOptionValueError.html +138 -0
  34. data/rdoc/CLI/ParsingError/UnknownSwitchError.html +138 -0
  35. data/rdoc/CLI/ParsingError/UsageError.html +97 -0
  36. data/rdoc/CLI/ParsingError.html +97 -0
  37. data/rdoc/CLI/Switches.html +306 -0
  38. data/rdoc/CLI/Values.html +202 -0
  39. data/rdoc/CLI.html +652 -0
  40. data/rdoc/README_md.html +553 -0
  41. data/rdoc/created.rid +7 -0
  42. data/rdoc/css/fonts.css +167 -0
  43. data/rdoc/css/rdoc.css +639 -0
  44. data/rdoc/fonts/Lato-Light.ttf +0 -0
  45. data/rdoc/fonts/Lato-LightItalic.ttf +0 -0
  46. data/rdoc/fonts/Lato-Regular.ttf +0 -0
  47. data/rdoc/fonts/Lato-RegularItalic.ttf +0 -0
  48. data/rdoc/fonts/SourceCodePro-Bold.ttf +0 -0
  49. data/rdoc/fonts/SourceCodePro-Regular.ttf +0 -0
  50. data/rdoc/images/add.png +0 -0
  51. data/rdoc/images/arrow_up.png +0 -0
  52. data/rdoc/images/brick.png +0 -0
  53. data/rdoc/images/brick_link.png +0 -0
  54. data/rdoc/images/bug.png +0 -0
  55. data/rdoc/images/bullet_black.png +0 -0
  56. data/rdoc/images/bullet_toggle_minus.png +0 -0
  57. data/rdoc/images/bullet_toggle_plus.png +0 -0
  58. data/rdoc/images/date.png +0 -0
  59. data/rdoc/images/delete.png +0 -0
  60. data/rdoc/images/find.png +0 -0
  61. data/rdoc/images/loadingAnimation.gif +0 -0
  62. data/rdoc/images/macFFBgHack.png +0 -0
  63. data/rdoc/images/package.png +0 -0
  64. data/rdoc/images/page_green.png +0 -0
  65. data/rdoc/images/page_white_text.png +0 -0
  66. data/rdoc/images/page_white_width.png +0 -0
  67. data/rdoc/images/plugin.png +0 -0
  68. data/rdoc/images/ruby.png +0 -0
  69. data/rdoc/images/tag_blue.png +0 -0
  70. data/rdoc/images/tag_green.png +0 -0
  71. data/rdoc/images/transparent.png +0 -0
  72. data/rdoc/images/wrench.png +0 -0
  73. data/rdoc/images/wrench_orange.png +0 -0
  74. data/rdoc/images/zoom.png +0 -0
  75. data/rdoc/index.html +120 -0
  76. data/rdoc/js/darkfish.js +84 -0
  77. data/rdoc/js/navigation.js +105 -0
  78. data/rdoc/js/navigation.js.gz +0 -0
  79. data/rdoc/js/search.js +110 -0
  80. data/rdoc/js/search_index.js +1 -0
  81. data/rdoc/js/search_index.js.gz +0 -0
  82. data/rdoc/js/searcher.js +229 -0
  83. data/rdoc/js/searcher.js.gz +0 -0
  84. data/rdoc/table_of_contents.html +533 -0
  85. data/spec/argument_spec.rb +104 -105
  86. data/spec/cli_spec.rb +27 -28
  87. data/spec/conflict_reporting_spec.rb +16 -17
  88. data/spec/option_spec.rb +60 -61
  89. data/spec/separator_spec.rb +19 -20
  90. data/spec/stdin_spec.rb +13 -14
  91. data/spec/switch_spec.rb +15 -16
  92. data/spec/usage_spec.rb +80 -81
  93. metadata +91 -139
  94. data/.document +0 -5
  95. data/.rspec +0 -1
  96. data/VERSION +0 -1
  97. data/features/cli.feature +0 -9
  98. data/features/step_definitions/cli_steps.rb +0 -0
  99. data/features/support/env.rb +0 -13
@@ -0,0 +1,200 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-8">
6
+
7
+ <title>class CLI::DSL::Argument - 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="Value.html">CLI::DSL::Value</a>
73
+ <li><a class="include" href="Cast.html">CLI::DSL::Cast</a>
74
+ <li><a class="include" href="Description.html">CLI::DSL::Description</a>
75
+ </ul>
76
+ </div>
77
+
78
+
79
+
80
+ <!-- Method Quickref -->
81
+ <div id="method-list-section" class="nav-section">
82
+ <h3>Methods</h3>
83
+
84
+ <ul class="link-list" role="directory">
85
+ <li class="calls-super" ><a href="#method-c-new">::new</a>
86
+ <li ><a href="#method-i-multiary-3F">#multiary?</a>
87
+ <li ><a href="#method-i-to_s">#to_s</a>
88
+ </ul>
89
+ </div>
90
+
91
+ </div>
92
+ </nav>
93
+
94
+ <main role="main" aria-labelledby="class-CLI::DSL::Argument">
95
+ <h1 id="class-CLI::DSL::Argument" class="class">
96
+ class CLI::DSL::Argument
97
+ </h1>
98
+
99
+ <section class="description">
100
+
101
+ </section>
102
+
103
+ <section id="5Buntitled-5D" class="documentation-section">
104
+
105
+
106
+
107
+
108
+
109
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section">
110
+ <header>
111
+ <h3>Public Class Methods</h3>
112
+ </header>
113
+
114
+ <div id="method-c-new" class="method-detail ">
115
+ <div class="method-heading">
116
+ <span class="method-name">new</span><span
117
+ class="method-args">(name, options = {})</span>
118
+ <span class="method-click-advice">click to toggle source</span>
119
+ </div>
120
+
121
+ <div class="method-description">
122
+
123
+ <div class="method-calls-super">
124
+ Calls superclass method
125
+ <a href="Base.html#method-c-new"><code>CLI::DSL::Base::new</code></a>
126
+ </div>
127
+
128
+ <div class="method-source-code" id="new-source">
129
+ <pre><span class="ruby-comment"># File lib/cli/dsl.rb, line 106</span>
130
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">options</span> = {})
131
+ <span class="ruby-keyword">super</span>
132
+ <span class="ruby-ivar">@options</span>[<span class="ruby-value">:required</span>] = <span class="ruby-keyword">true</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@options</span>.<span class="ruby-identifier">member?</span>(<span class="ruby-value">:required</span>)
133
+ <span class="ruby-keyword">end</span></pre>
134
+ </div>
135
+ </div>
136
+
137
+
138
+ </div>
139
+
140
+ </section>
141
+
142
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
143
+ <header>
144
+ <h3>Public Instance Methods</h3>
145
+ </header>
146
+
147
+ <div id="method-i-multiary-3F" class="method-detail ">
148
+ <div class="method-heading">
149
+ <span class="method-name">multiary?</span><span
150
+ class="method-args">()</span>
151
+ <span class="method-click-advice">click to toggle source</span>
152
+ </div>
153
+
154
+ <div class="method-description">
155
+
156
+
157
+ <div class="method-source-code" id="multiary-3F-source">
158
+ <pre><span class="ruby-comment"># File lib/cli/dsl.rb, line 115</span>
159
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">multiary?</span>
160
+ <span class="ruby-keyword">false</span>
161
+ <span class="ruby-keyword">end</span></pre>
162
+ </div>
163
+ </div>
164
+
165
+
166
+ </div>
167
+
168
+ <div id="method-i-to_s" class="method-detail ">
169
+ <div class="method-heading">
170
+ <span class="method-name">to_s</span><span
171
+ class="method-args">()</span>
172
+ <span class="method-click-advice">click to toggle source</span>
173
+ </div>
174
+
175
+ <div class="method-description">
176
+
177
+
178
+ <div class="method-source-code" id="to_s-source">
179
+ <pre><span class="ruby-comment"># File lib/cli/dsl.rb, line 111</span>
180
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">to_s</span>
181
+ <span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">tr</span>(<span class="ruby-string">&#39;_&#39;</span>, <span class="ruby-string">&#39;-&#39;</span>)
182
+ <span class="ruby-keyword">end</span></pre>
183
+ </div>
184
+ </div>
185
+
186
+
187
+ </div>
188
+
189
+ </section>
190
+
191
+ </section>
192
+ </main>
193
+
194
+
195
+ <footer id="validator-badges" role="contentinfo">
196
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
197
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.
198
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
199
+ </footer>
200
+
@@ -0,0 +1,172 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-8">
6
+
7
+ <title>class CLI::DSL::Arguments - 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="Argument.html">CLI::DSL::Argument</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="MultiDefault.html">CLI::DSL::MultiDefault</a>
73
+ </ul>
74
+ </div>
75
+
76
+
77
+
78
+ <!-- Method Quickref -->
79
+ <div id="method-list-section" class="nav-section">
80
+ <h3>Methods</h3>
81
+
82
+ <ul class="link-list" role="directory">
83
+ <li class="calls-super" ><a href="#method-i-cast">#cast</a>
84
+ <li ><a href="#method-i-multiary-3F">#multiary?</a>
85
+ </ul>
86
+ </div>
87
+
88
+ </div>
89
+ </nav>
90
+
91
+ <main role="main" aria-labelledby="class-CLI::DSL::Arguments">
92
+ <h1 id="class-CLI::DSL::Arguments" class="class">
93
+ class CLI::DSL::Arguments
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-cast" class="method-detail ">
112
+ <div class="method-heading">
113
+ <span class="method-name">cast</span><span
114
+ class="method-args">(values)</span>
115
+ <span class="method-click-advice">click to toggle source</span>
116
+ </div>
117
+
118
+ <div class="method-description">
119
+
120
+ <div class="method-calls-super">
121
+ Calls superclass method
122
+ <a href="Cast.html#method-i-cast"><code>CLI::DSL::Cast#cast</code></a>
123
+ </div>
124
+
125
+ <div class="method-source-code" id="cast-source">
126
+ <pre><span class="ruby-comment"># File lib/cli/dsl.rb, line 123</span>
127
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">cast</span>(<span class="ruby-identifier">values</span>)
128
+ <span class="ruby-identifier">out</span> = []
129
+ <span class="ruby-identifier">values</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
130
+ <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-keyword">super</span>(<span class="ruby-identifier">v</span>)
131
+ <span class="ruby-keyword">end</span>
132
+ <span class="ruby-identifier">out</span>
133
+ <span class="ruby-keyword">end</span></pre>
134
+ </div>
135
+ </div>
136
+
137
+
138
+ </div>
139
+
140
+ <div id="method-i-multiary-3F" class="method-detail ">
141
+ <div class="method-heading">
142
+ <span class="method-name">multiary?</span><span
143
+ class="method-args">()</span>
144
+ <span class="method-click-advice">click to toggle source</span>
145
+ </div>
146
+
147
+ <div class="method-description">
148
+
149
+
150
+ <div class="method-source-code" id="multiary-3F-source">
151
+ <pre><span class="ruby-comment"># File lib/cli/dsl.rb, line 131</span>
152
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">multiary?</span>
153
+ <span class="ruby-keyword">true</span>
154
+ <span class="ruby-keyword">end</span></pre>
155
+ </div>
156
+ </div>
157
+
158
+
159
+ </div>
160
+
161
+ </section>
162
+
163
+ </section>
164
+ </main>
165
+
166
+
167
+ <footer id="validator-badges" role="contentinfo">
168
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
169
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.
170
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
171
+ </footer>
172
+
@@ -0,0 +1,154 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-8">
6
+
7
+ <title>class CLI::DSL::Base - 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">Object
65
+ </div>
66
+
67
+
68
+
69
+
70
+ <!-- Method Quickref -->
71
+ <div id="method-list-section" class="nav-section">
72
+ <h3>Methods</h3>
73
+
74
+ <ul class="link-list" role="directory">
75
+ <li ><a href="#method-c-new">::new</a>
76
+ </ul>
77
+ </div>
78
+
79
+ </div>
80
+ </nav>
81
+
82
+ <main role="main" aria-labelledby="class-CLI::DSL::Base">
83
+ <h1 id="class-CLI::DSL::Base" class="class">
84
+ class CLI::DSL::Base
85
+ </h1>
86
+
87
+ <section class="description">
88
+
89
+ </section>
90
+
91
+ <section id="5Buntitled-5D" class="documentation-section">
92
+
93
+
94
+
95
+ <section class="attribute-method-details" class="method-section">
96
+ <header>
97
+ <h3>Attributes</h3>
98
+ </header>
99
+
100
+ <div id="attribute-i-name" class="method-detail">
101
+ <div class="method-heading attribute-method-heading">
102
+ <span class="method-name">name</span><span
103
+ class="attribute-access-type">[R]</span>
104
+ </div>
105
+
106
+ <div class="method-description">
107
+
108
+ </div>
109
+ </div>
110
+ </section>
111
+
112
+
113
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section">
114
+ <header>
115
+ <h3>Public Class Methods</h3>
116
+ </header>
117
+
118
+ <div id="method-c-new" class="method-detail ">
119
+ <div class="method-heading">
120
+ <span class="method-name">new</span><span
121
+ class="method-args">(name, options = {})</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="new-source">
129
+ <pre><span class="ruby-comment"># File lib/cli/dsl.rb, line 4</span>
130
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">options</span> = {})
131
+ <span class="ruby-identifier">class_name</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp">/.*:/</span>, <span class="ruby-string">&#39;&#39;</span>).<span class="ruby-identifier">downcase</span>
132
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">ParserError</span><span class="ruby-operator">::</span><span class="ruby-constant">NameArgumetNotSymbolError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">class_name</span>, <span class="ruby-identifier">name</span>) <span class="ruby-keyword">unless</span> <span class="ruby-identifier">name</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">Symbol</span>
133
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">ParserError</span><span class="ruby-operator">::</span><span class="ruby-constant">OptionsArgumentNotHashError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">class_name</span>, <span class="ruby-identifier">options</span>) <span class="ruby-keyword">unless</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">Hash</span>
134
+ <span class="ruby-ivar">@name</span> = <span class="ruby-identifier">name</span>
135
+ <span class="ruby-ivar">@options</span> = <span class="ruby-identifier">options</span>
136
+ <span class="ruby-keyword">end</span></pre>
137
+ </div>
138
+ </div>
139
+
140
+
141
+ </div>
142
+
143
+ </section>
144
+
145
+ </section>
146
+ </main>
147
+
148
+
149
+ <footer id="validator-badges" role="contentinfo">
150
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
151
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.
152
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
153
+ </footer>
154
+