doc/Bovem/ParserMethods/General/ClassMethods.html in bovem-3.0.5 vs doc/Bovem/ParserMethods/General/ClassMethods.html in bovem-4.0.0

- old
+ new

@@ -4,22 +4,22 @@ <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title> Module: Bovem::ParserMethods::General::ClassMethods - &mdash; Documentation by YARD 0.8.7.3 + &mdash; Documentation by YARD 0.8.7.6 </title> <link rel="stylesheet" href="../../../css/style.css" type="text/css" charset="utf-8" /> <link rel="stylesheet" href="../../../css/common.css" type="text/css" charset="utf-8" /> <script type="text/javascript" charset="utf-8"> hasFrames = window.top.frames.main ? true : false; relpath = '../../../'; - framesUrl = "../../../frames.html#!" + escape(window.location.href); + framesUrl = "../../../frames.html#!Bovem/ParserMethods/General/ClassMethods.html"; </script> <script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script> @@ -110,11 +110,11 @@ <ul class="summary"> <li class="public "> <span class="summary_signature"> - <a href="#find_command-instance_method" title="#find_command (instance method)">- (Hash|NilClass) <strong>find_command</strong>(arg, command, args, separator = &quot;:&quot;) </a> + <a href="#find_command-instance_method" title="#find_command (instance method)">- (Hash|NilClass) <strong>find_command</strong>(arg, command, args: {}, separator: &quot;:&quot;) </a> </span> @@ -156,11 +156,11 @@ <li class="public "> <span class="summary_signature"> - <a href="#smart_join-instance_method" title="#smart_join (instance method)">- (String) <strong>smart_join</strong>(array, separator = &quot;, &quot;, last_separator = &quot; and &quot;, quote = &quot;\&quot;&quot;) </a> + <a href="#smart_join-instance_method" title="#smart_join (instance method)">- (String) <strong>smart_join</strong>(array, separator: &quot;, &quot;, last_separator: &quot; and &quot;, quote: &quot;\&quot;&quot;) </a> </span> @@ -188,11 +188,11 @@ <div class="method_details first"> <h3 class="signature first" id="find_command-instance_method"> - - (<tt>Hash|NilClass</tt>) <strong>find_command</strong>(arg, command, args, separator = &quot;:&quot;) + - (<tt>Hash|NilClass</tt>) <strong>find_command</strong>(arg, command, args: {}, separator: &quot;:&quot;) @@ -258,13 +258,11 @@ <span class='type'>(<tt>String</tt>)</span> - <em class="default">(defaults to: <tt>&quot;:&quot;</tt>)</em> - &mdash; <div class='inline'><p>The separator for joined syntax commands.</p> </div> </li> @@ -304,29 +302,25 @@ 43 44 45 46 47 -48 -49 -50</pre> +48</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/bovem/parser.rb', line 37</span> -<span class='kw'>def</span> <span class='id identifier rubyid_find_command'>find_command</span><span class='lparen'>(</span><span class='id identifier rubyid_arg'>arg</span><span class='comma'>,</span> <span class='id identifier rubyid_command'>command</span><span class='comma'>,</span> <span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='id identifier rubyid_separator'>separator</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>:</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> - <span class='kw'>if</span> <span class='id identifier rubyid_command'>command</span><span class='period'>.</span><span class='id identifier rubyid_commands'>commands</span><span class='period'>.</span><span class='id identifier rubyid_present?'>present?</span> <span class='kw'>then</span> - <span class='id identifier rubyid_arg'>arg</span><span class='comma'>,</span> <span class='id identifier rubyid_args'>args</span> <span class='op'>=</span> <span class='id identifier rubyid_adjust_command'>adjust_command</span><span class='lparen'>(</span><span class='id identifier rubyid_arg'>arg</span><span class='comma'>,</span> <span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='id identifier rubyid_separator'>separator</span><span class='rparen'>)</span> +<span class='kw'>def</span> <span class='id identifier rubyid_find_command'>find_command</span><span class='lparen'>(</span><span class='id identifier rubyid_arg'>arg</span><span class='comma'>,</span> <span class='id identifier rubyid_command'>command</span><span class='comma'>,</span> <span class='label'>args:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='label'>separator:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>:</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> + <span class='kw'>return</span> <span class='kw'>nil</span> <span class='kw'>unless</span> <span class='id identifier rubyid_command'>command</span><span class='period'>.</span><span class='id identifier rubyid_commands'>commands</span><span class='period'>.</span><span class='id identifier rubyid_present?'>present?</span> - <span class='id identifier rubyid_matching'>matching</span> <span class='op'>=</span> <span class='id identifier rubyid_match_subcommands'>match_subcommands</span><span class='lparen'>(</span><span class='id identifier rubyid_arg'>arg</span><span class='comma'>,</span> <span class='id identifier rubyid_command'>command</span><span class='rparen'>)</span> - <span class='kw'>if</span> <span class='id identifier rubyid_matching'>matching</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>==</span> <span class='int'>1</span> <span class='comment'># Found a command -</span> <span class='lbrace'>{</span><span class='label'>name:</span> <span class='id identifier rubyid_matching'>matching</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>args:</span> <span class='id identifier rubyid_args'>args</span><span class='rbrace'>}</span> - <span class='kw'>elsif</span> <span class='id identifier rubyid_matching'>matching</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>&gt;</span> <span class='int'>1</span> <span class='comment'># Ambiguous match -</span> <span class='id identifier rubyid_raise'>raise</span> <span class='const'>Bovem</span><span class='op'>::</span><span class='const'>Errors</span><span class='op'>::</span><span class='const'>Error</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_command'>command</span><span class='comma'>,</span> <span class='symbol'>:ambiguous_command</span><span class='comma'>,</span> <span class='id identifier rubyid_command'>command</span><span class='period'>.</span><span class='id identifier rubyid_i18n'>i18n</span><span class='period'>.</span><span class='id identifier rubyid_ambigous_command'>ambigous_command</span><span class='lparen'>(</span><span class='id identifier rubyid_arg'>arg</span><span class='comma'>,</span> <span class='id identifier rubyid_format_alternatives'>format_alternatives</span><span class='lparen'>(</span><span class='id identifier rubyid_matching'>matching</span><span class='comma'>,</span> <span class='id identifier rubyid_command'>command</span><span class='rparen'>)</span><span class='rparen'>)</span><span class='rparen'>)</span> - <span class='kw'>end</span> - <span class='kw'>else</span> - <span class='kw'>nil</span> + <span class='id identifier rubyid_arg'>arg</span><span class='comma'>,</span> <span class='id identifier rubyid_args'>args</span> <span class='op'>=</span> <span class='id identifier rubyid_adjust_command'>adjust_command</span><span class='lparen'>(</span><span class='id identifier rubyid_arg'>arg</span><span class='comma'>,</span> <span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='id identifier rubyid_separator'>separator</span><span class='rparen'>)</span> + + <span class='id identifier rubyid_matching'>matching</span> <span class='op'>=</span> <span class='id identifier rubyid_match_subcommands'>match_subcommands</span><span class='lparen'>(</span><span class='id identifier rubyid_arg'>arg</span><span class='comma'>,</span> <span class='id identifier rubyid_command'>command</span><span class='rparen'>)</span> + <span class='kw'>if</span> <span class='id identifier rubyid_matching'>matching</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>==</span> <span class='int'>1</span> <span class='comment'># Found a command +</span> <span class='lbrace'>{</span><span class='label'>name:</span> <span class='id identifier rubyid_matching'>matching</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>args:</span> <span class='id identifier rubyid_args'>args</span><span class='rbrace'>}</span> + <span class='kw'>elsif</span> <span class='id identifier rubyid_matching'>matching</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>&gt;</span> <span class='int'>1</span> <span class='comment'># Ambiguous match +</span> <span class='id identifier rubyid_raise'>raise</span> <span class='const'>Bovem</span><span class='op'>::</span><span class='const'>Errors</span><span class='op'>::</span><span class='const'>Error</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_command'>command</span><span class='comma'>,</span> <span class='symbol'>:ambiguous_command</span><span class='comma'>,</span> <span class='id identifier rubyid_command'>command</span><span class='period'>.</span><span class='id identifier rubyid_i18n'>i18n</span><span class='period'>.</span><span class='id identifier rubyid_ambigous_command'>ambigous_command</span><span class='lparen'>(</span><span class='id identifier rubyid_arg'>arg</span><span class='comma'>,</span> <span class='id identifier rubyid_format_alternatives'>format_alternatives</span><span class='lparen'>(</span><span class='id identifier rubyid_matching'>matching</span><span class='comma'>,</span> <span class='id identifier rubyid_command'>command</span><span class='rparen'>)</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='kw'>end</span> <span class='kw'>end</span></pre> </td> </tr> </table> @@ -406,16 +400,16 @@ <tr> <td> <pre class="lines"> -57 -58 -59</pre> +55 +56 +57</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/bovem/parser.rb', line 57</span> + <pre class="code"><span class="info file"># File 'lib/bovem/parser.rb', line 55</span> <span class='kw'>def</span> <span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_command'>command</span><span class='comma'>,</span> <span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span> <span class='const'>Bovem</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_command'>command</span><span class='comma'>,</span> <span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span> <span class='kw'>end</span></pre> </td> @@ -424,11 +418,11 @@ </div> <div class="method_details "> <h3 class="signature " id="smart_join-instance_method"> - - (<tt>String</tt>) <strong>smart_join</strong>(array, separator = &quot;, &quot;, last_separator = &quot; and &quot;, quote = &quot;\&quot;&quot;) + - (<tt>String</tt>) <strong>smart_join</strong>(array, separator: &quot;, &quot;, last_separator: &quot; and &quot;, quote: &quot;\&quot;&quot;) @@ -464,13 +458,11 @@ <span class='type'>(<tt>String</tt>)</span> - <em class="default">(defaults to: <tt>&quot;, &quot;</tt>)</em> - &mdash; <div class='inline'><p>The separator to use for all but last join.</p> </div> </li> @@ -481,13 +473,11 @@ <span class='type'>(<tt>String</tt>)</span> - <em class="default">(defaults to: <tt>&quot; and &quot;</tt>)</em> - &mdash; <div class='inline'><p>The separator to use for the last join.</p> </div> </li> @@ -498,13 +488,11 @@ <span class='type'>(<tt>String</tt>)</span> - <em class="default">(defaults to: <tt>&quot;\&quot;&quot;</tt>)</em> - &mdash; <div class='inline'><p>If not nil, elements are quoted with that element.</p> </div> </li> @@ -543,15 +531,15 @@ 28</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/bovem/parser.rb', line 23</span> -<span class='kw'>def</span> <span class='id identifier rubyid_smart_join'>smart_join</span><span class='lparen'>(</span><span class='id identifier rubyid_array'>array</span><span class='comma'>,</span> <span class='id identifier rubyid_separator'>separator</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>, </span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_last_separator'>last_separator</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'> and </span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_quote'>quote</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\&quot;</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> +<span class='kw'>def</span> <span class='id identifier rubyid_smart_join'>smart_join</span><span class='lparen'>(</span><span class='id identifier rubyid_array'>array</span><span class='comma'>,</span> <span class='label'>separator:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>, </span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='label'>last_separator:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'> and </span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='label'>quote:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\&quot;</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='id identifier rubyid_separator'>separator</span> <span class='op'>=</span> <span class='id identifier rubyid_separator'>separator</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span> <span class='id identifier rubyid_last_separator'>last_separator</span> <span class='op'>=</span> <span class='id identifier rubyid_last_separator'>last_separator</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span> - <span class='id identifier rubyid_array'>array</span> <span class='op'>=</span> <span class='id identifier rubyid_array'>array</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_a'>a</span><span class='op'>|</span> <span class='id identifier rubyid_quote'>quote</span><span class='period'>.</span><span class='id identifier rubyid_present?'>present?</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_quote'>quote</span><span class='embexpr_end'>}</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_a'>a</span><span class='embexpr_end'>}</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_quote'>quote</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span> <span class='op'>:</span> <span class='id identifier rubyid_a'>a</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span> <span class='rbrace'>}</span> - <span class='id identifier rubyid_array'>array</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>&lt;</span> <span class='int'>2</span> <span class='op'>?</span> <span class='lparen'>(</span><span class='id identifier rubyid_array'>array</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='op'>:</span> <span class='lparen'>(</span><span class='id identifier rubyid_array'>array</span><span class='lbracket'>[</span><span class='int'>0</span><span class='comma'>,</span> <span class='id identifier rubyid_array'>array</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>-</span> <span class='int'>1</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='id identifier rubyid_separator'>separator</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='id identifier rubyid_last_separator'>last_separator</span> <span class='op'>+</span> <span class='id identifier rubyid_array'>array</span><span class='lbracket'>[</span><span class='op'>-</span><span class='int'>1</span><span class='rbracket'>]</span><span class='rparen'>)</span> + <span class='id identifier rubyid_array'>array</span> <span class='op'>=</span> <span class='id identifier rubyid_array'>array</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_a'>a</span><span class='op'>|</span> <span class='id identifier rubyid_quote'>quote</span><span class='period'>.</span><span class='id identifier rubyid_present?'>present?</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_quote'>quote</span><span class='embexpr_end'>}</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_a'>a</span><span class='embexpr_end'>}</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_quote'>quote</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span> <span class='op'>:</span> <span class='id identifier rubyid_a'>a</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span> <span class='rbrace'>}</span> + <span class='id identifier rubyid_perform_smart_join'>perform_smart_join</span><span class='lparen'>(</span><span class='id identifier rubyid_array'>array</span><span class='comma'>,</span> <span class='id identifier rubyid_last_separator'>last_separator</span><span class='comma'>,</span> <span class='id identifier rubyid_separator'>separator</span><span class='rparen'>)</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> @@ -559,12 +547,12 @@ </div> </div> <div id="footer"> - Generated on Sat Mar 8 10:27:42 2014 by + Generated on Tue Mar 29 20:43:16 2016 by <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a> - 0.8.7.3 (ruby-2.1.0). + 0.8.7.6 (ruby-2.3.0). </div> </body> </html> \ No newline at end of file