doc/classes/MediaWiki/Config.html in mediawiki-gateway-0.1.0 vs doc/classes/MediaWiki/Config.html in mediawiki-gateway-0.1.1
- old
+ new
@@ -53,12 +53,12 @@
<td class="class-name-in-header">MediaWiki::Config</td>
</tr>
<tr class="top-aligned-row">
<td><strong>In:</strong></td>
<td>
- <a href="../../files/media_wiki/config_rb.html">
- media_wiki/config.rb
+ <a href="../../files/lib/media_wiki/config_rb.html">
+ lib/media_wiki/config.rb
</a>
<br />
</td>
</tr>
@@ -84,12 +84,12 @@
<div id="method-list">
<h3 class="section-bar">Methods</h3>
<div class="name-list">
- <a href="#M000023">abort</a>
- <a href="#M000022">new</a>
+ <a href="#M000025">abort</a>
+ <a href="#M000024">new</a>
</div>
</div>
</div>
@@ -155,101 +155,101 @@
<!-- if method_list -->
<div id="methods">
<h3 class="section-bar">Public Class methods</h3>
- <div id="method-M000022" class="method-detail">
- <a name="M000022"></a>
+ <div id="method-M000024" class="method-detail">
+ <a name="M000024"></a>
<div class="method-heading">
- <a href="#M000022" class="method-signature">
+ <a href="#M000024" class="method-signature">
<span class="method-name">new</span><span class="method-args">(args, type = "read")</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
- onclick="toggleCode('M000022-source');return false;">[Source]</a></p>
- <div class="method-source-code" id="M000022-source">
+ onclick="toggleCode('M000024-source');return false;">[Source]</a></p>
+ <div class="method-source-code" id="M000024-source">
<pre>
- <span class="ruby-comment cmt"># File media_wiki/config.rb, line 9</span>
- 9: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">args</span>, <span class="ruby-identifier">type</span> = <span class="ruby-value str">"read"</span>)
-10: <span class="ruby-ivar">@summary</span> = <span class="ruby-value str">"Automated edit via MediaWiki::Gateway"</span>
-11: <span class="ruby-ivar">@opts</span> = <span class="ruby-constant">OptionParser</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">opts</span><span class="ruby-operator">|</span>
-12: <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">banner</span> = <span class="ruby-value str">"Usage: [options]"</span>
-13:
-14: <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">"-h"</span>, <span class="ruby-value str">"--host HOST"</span>, <span class="ruby-value str">"Use preconfigured HOST in config/hosts.yml"</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">host_id</span><span class="ruby-operator">|</span>
-15: <span class="ruby-identifier">yaml</span> = <span class="ruby-constant">YAML</span>.<span class="ruby-identifier">load_file</span>(<span class="ruby-value str">'config/hosts.yml'</span>)
-16: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">yaml</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">host_id</span>
-17: <span class="ruby-identifier">host</span> = <span class="ruby-identifier">yaml</span>[<span class="ruby-identifier">host_id</span>]
-18: <span class="ruby-ivar">@url</span> = <span class="ruby-identifier">host</span>[<span class="ruby-value str">'url'</span>]
-19: <span class="ruby-ivar">@pw</span> = <span class="ruby-identifier">host</span>[<span class="ruby-value str">'pw'</span>]
-20: <span class="ruby-ivar">@user</span> = <span class="ruby-identifier">host</span>[<span class="ruby-value str">'user'</span>]
-21: <span class="ruby-keyword kw">else</span>
-22: <span class="ruby-identifier">raise</span> <span class="ruby-node">"Host #{host_id} not found in config/hosts.yml"</span>
-23: <span class="ruby-keyword kw">end</span>
-24: <span class="ruby-keyword kw">end</span>
-25:
-26: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">type</span> <span class="ruby-operator">==</span> <span class="ruby-value str">"upload"</span>
-27: <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">"-d"</span>, <span class="ruby-value str">"--description DESCRIPTION"</span>, <span class="ruby-value str">"Description of file to upload"</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">desc</span><span class="ruby-operator">|</span>
-28: <span class="ruby-ivar">@desc</span> = <span class="ruby-identifier">desc</span>
-29: <span class="ruby-keyword kw">end</span>
-30: <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">"-t"</span>, <span class="ruby-value str">"--target-file TARGET-FILE"</span>, <span class="ruby-value str">"Target file name to upload to"</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">target</span><span class="ruby-operator">|</span>
-31: <span class="ruby-ivar">@target</span> = <span class="ruby-identifier">target</span>
-32: <span class="ruby-keyword kw">end</span>
-33: <span class="ruby-keyword kw">else</span>
-34: <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">"-a"</span>, <span class="ruby-value str">"--article ARTICLE"</span>, <span class="ruby-value str">"Name of article in Wiki"</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">article</span><span class="ruby-operator">|</span>
-35: <span class="ruby-ivar">@article</span> = <span class="ruby-identifier">article</span>
-36: <span class="ruby-keyword kw">end</span>
-37: <span class="ruby-keyword kw">end</span>
-38:
-39: <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">"-n"</span>, <span class="ruby-value str">"--username USERNAME"</span>, <span class="ruby-value str">"Username for login"</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">user</span><span class="ruby-operator">|</span>
-40: <span class="ruby-ivar">@user</span> = <span class="ruby-identifier">user</span>
-41: <span class="ruby-keyword kw">end</span>
-42:
-43: <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">"-p"</span>, <span class="ruby-value str">"--password PASSWORD"</span>, <span class="ruby-value str">"Password for login"</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">pw</span><span class="ruby-operator">|</span>
-44: <span class="ruby-ivar">@pw</span> = <span class="ruby-identifier">pw</span>
-45: <span class="ruby-keyword kw">end</span>
-46:
-47: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">type</span> <span class="ruby-operator">!=</span> <span class="ruby-value str">"read"</span>
-48: <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">"-s"</span>, <span class="ruby-value str">"--summary SUMMARY"</span>, <span class="ruby-value str">"Edit summary for this change"</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">summary</span><span class="ruby-operator">|</span>
-49: <span class="ruby-ivar">@summary</span> = <span class="ruby-identifier">summary</span>
-50: <span class="ruby-keyword kw">end</span>
-51: <span class="ruby-keyword kw">end</span>
-52:
-53: <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">"-u"</span>, <span class="ruby-value str">"--url URL"</span>, <span class="ruby-value str">"MediaWiki API URL"</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">url</span><span class="ruby-operator">|</span>
-54: <span class="ruby-ivar">@url</span> = <span class="ruby-identifier">url</span>
-55: <span class="ruby-keyword kw">end</span>
-56: <span class="ruby-keyword kw">end</span>
-57: <span class="ruby-ivar">@opts</span>.<span class="ruby-identifier">parse!</span>
-58: <span class="ruby-identifier">abort</span>(<span class="ruby-value str">"URL (-u) or valid host (-h) is mandatory."</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@url</span>
-59: <span class="ruby-keyword kw">end</span>
+ <span class="ruby-comment cmt"># File lib/media_wiki/config.rb, line 10</span>
+10: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">args</span>, <span class="ruby-identifier">type</span> = <span class="ruby-value str">"read"</span>)
+11: <span class="ruby-ivar">@summary</span> = <span class="ruby-value str">"Automated edit via MediaWiki::Gateway"</span>
+12: <span class="ruby-ivar">@opts</span> = <span class="ruby-constant">OptionParser</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">opts</span><span class="ruby-operator">|</span>
+13: <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">banner</span> = <span class="ruby-value str">"Usage: [options]"</span>
+14:
+15: <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">"-h"</span>, <span class="ruby-value str">"--host HOST"</span>, <span class="ruby-value str">"Use preconfigured HOST in config/hosts.yml"</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">host_id</span><span class="ruby-operator">|</span>
+16: <span class="ruby-identifier">yaml</span> = <span class="ruby-constant">YAML</span>.<span class="ruby-identifier">load_file</span>(<span class="ruby-value str">'config/hosts.yml'</span>)
+17: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">yaml</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">host_id</span>
+18: <span class="ruby-identifier">host</span> = <span class="ruby-identifier">yaml</span>[<span class="ruby-identifier">host_id</span>]
+19: <span class="ruby-ivar">@url</span> = <span class="ruby-identifier">host</span>[<span class="ruby-value str">'url'</span>]
+20: <span class="ruby-ivar">@pw</span> = <span class="ruby-identifier">host</span>[<span class="ruby-value str">'pw'</span>]
+21: <span class="ruby-ivar">@user</span> = <span class="ruby-identifier">host</span>[<span class="ruby-value str">'user'</span>]
+22: <span class="ruby-keyword kw">else</span>
+23: <span class="ruby-identifier">raise</span> <span class="ruby-node">"Host #{host_id} not found in config/hosts.yml"</span>
+24: <span class="ruby-keyword kw">end</span>
+25: <span class="ruby-keyword kw">end</span>
+26:
+27: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">type</span> <span class="ruby-operator">==</span> <span class="ruby-value str">"upload"</span>
+28: <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">"-d"</span>, <span class="ruby-value str">"--description DESCRIPTION"</span>, <span class="ruby-value str">"Description of file to upload"</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">desc</span><span class="ruby-operator">|</span>
+29: <span class="ruby-ivar">@desc</span> = <span class="ruby-identifier">desc</span>
+30: <span class="ruby-keyword kw">end</span>
+31: <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">"-t"</span>, <span class="ruby-value str">"--target-file TARGET-FILE"</span>, <span class="ruby-value str">"Target file name to upload to"</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">target</span><span class="ruby-operator">|</span>
+32: <span class="ruby-ivar">@target</span> = <span class="ruby-identifier">target</span>
+33: <span class="ruby-keyword kw">end</span>
+34: <span class="ruby-keyword kw">else</span>
+35: <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">"-a"</span>, <span class="ruby-value str">"--article ARTICLE"</span>, <span class="ruby-value str">"Name of article in Wiki"</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">article</span><span class="ruby-operator">|</span>
+36: <span class="ruby-ivar">@article</span> = <span class="ruby-identifier">article</span>
+37: <span class="ruby-keyword kw">end</span>
+38: <span class="ruby-keyword kw">end</span>
+39:
+40: <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">"-n"</span>, <span class="ruby-value str">"--username USERNAME"</span>, <span class="ruby-value str">"Username for login"</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">user</span><span class="ruby-operator">|</span>
+41: <span class="ruby-ivar">@user</span> = <span class="ruby-identifier">user</span>
+42: <span class="ruby-keyword kw">end</span>
+43:
+44: <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">"-p"</span>, <span class="ruby-value str">"--password PASSWORD"</span>, <span class="ruby-value str">"Password for login"</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">pw</span><span class="ruby-operator">|</span>
+45: <span class="ruby-ivar">@pw</span> = <span class="ruby-identifier">pw</span>
+46: <span class="ruby-keyword kw">end</span>
+47:
+48: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">type</span> <span class="ruby-operator">!=</span> <span class="ruby-value str">"read"</span>
+49: <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">"-s"</span>, <span class="ruby-value str">"--summary SUMMARY"</span>, <span class="ruby-value str">"Edit summary for this change"</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">summary</span><span class="ruby-operator">|</span>
+50: <span class="ruby-ivar">@summary</span> = <span class="ruby-identifier">summary</span>
+51: <span class="ruby-keyword kw">end</span>
+52: <span class="ruby-keyword kw">end</span>
+53:
+54: <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">"-u"</span>, <span class="ruby-value str">"--url URL"</span>, <span class="ruby-value str">"MediaWiki API URL"</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">url</span><span class="ruby-operator">|</span>
+55: <span class="ruby-ivar">@url</span> = <span class="ruby-identifier">url</span>
+56: <span class="ruby-keyword kw">end</span>
+57: <span class="ruby-keyword kw">end</span>
+58: <span class="ruby-ivar">@opts</span>.<span class="ruby-identifier">parse!</span>
+59: <span class="ruby-identifier">abort</span>(<span class="ruby-value str">"URL (-u) or valid host (-h) is mandatory."</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@url</span>
+60: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<h3 class="section-bar">Public Instance methods</h3>
- <div id="method-M000023" class="method-detail">
- <a name="M000023"></a>
+ <div id="method-M000025" class="method-detail">
+ <a name="M000025"></a>
<div class="method-heading">
- <a href="#M000023" class="method-signature">
+ <a href="#M000025" class="method-signature">
<span class="method-name">abort</span><span class="method-args">(error)</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
- onclick="toggleCode('M000023-source');return false;">[Source]</a></p>
- <div class="method-source-code" id="M000023-source">
+ onclick="toggleCode('M000025-source');return false;">[Source]</a></p>
+ <div class="method-source-code" id="M000025-source">
<pre>
- <span class="ruby-comment cmt"># File media_wiki/config.rb, line 61</span>
-61: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">abort</span>(<span class="ruby-identifier">error</span>)
-62: <span class="ruby-identifier">puts</span> <span class="ruby-node">"Error: #{error}\n\n#{@opts.to_s}"</span>
-63: <span class="ruby-identifier">exit</span>
-64: <span class="ruby-keyword kw">end</span>
+ <span class="ruby-comment cmt"># File lib/media_wiki/config.rb, line 62</span>
+62: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">abort</span>(<span class="ruby-identifier">error</span>)
+63: <span class="ruby-identifier">puts</span> <span class="ruby-node">"Error: #{error}\n\n#{@opts.to_s}"</span>
+64: <span class="ruby-identifier">exit</span>
+65: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
\ No newline at end of file