mediawiki-gateway 0.4.1 → 0.4.2
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.
- data/lib/media_wiki.rb +1 -1
- data/lib/media_wiki/gateway.rb +5 -4
- data/mediawiki-gateway.gemspec +4 -28
- data/script/README +14 -0
- data/script/download_batch.rb +15 -0
- metadata +6 -30
- data/doc/classes/MediaWiki.html +0 -381
- data/doc/classes/MediaWiki/APIError.html +0 -186
- data/doc/classes/MediaWiki/Config.html +0 -269
- data/doc/classes/MediaWiki/Exception.html +0 -122
- data/doc/classes/MediaWiki/Gateway.html +0 -1737
- data/doc/classes/MediaWiki/Unauthorized.html +0 -120
- data/doc/created.rid +0 -1
- data/doc/files/README.html +0 -164
- data/doc/files/lib/media_wiki/config_rb.html +0 -109
- data/doc/files/lib/media_wiki/exception_rb.html +0 -101
- data/doc/files/lib/media_wiki/gateway_rb.html +0 -113
- data/doc/files/lib/media_wiki/utils_rb.html +0 -101
- data/doc/files/script/create_page_rb.html +0 -114
- data/doc/files/script/delete_batch_rb.html +0 -108
- data/doc/files/script/export_xml_rb.html +0 -114
- data/doc/files/script/get_page_rb.html +0 -114
- data/doc/files/script/import_xml_rb.html +0 -114
- data/doc/files/script/run_fake_media_wiki_rb.html +0 -117
- data/doc/files/script/search_content_rb.html +0 -114
- data/doc/files/script/upload_commons_rb.html +0 -114
- data/doc/files/script/upload_file_rb.html +0 -114
- data/doc/fr_class_index.html +0 -32
- data/doc/fr_file_index.html +0 -40
- data/doc/fr_method_index.html +0 -68
- data/doc/index.html +0 -24
- data/doc/rdoc-style.css +0 -208
@@ -1,186 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
-
<!DOCTYPE html
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
-
|
6
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
-
<head>
|
8
|
-
<title>Class: MediaWiki::APIError</title>
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
-
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
-
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
-
<script type="text/javascript">
|
13
|
-
// <![CDATA[
|
14
|
-
|
15
|
-
function popupCode( url ) {
|
16
|
-
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
-
}
|
18
|
-
|
19
|
-
function toggleCode( id ) {
|
20
|
-
if ( document.getElementById )
|
21
|
-
elem = document.getElementById( id );
|
22
|
-
else if ( document.all )
|
23
|
-
elem = eval( "document.all." + id );
|
24
|
-
else
|
25
|
-
return false;
|
26
|
-
|
27
|
-
elemStyle = elem.style;
|
28
|
-
|
29
|
-
if ( elemStyle.display != "block" ) {
|
30
|
-
elemStyle.display = "block"
|
31
|
-
} else {
|
32
|
-
elemStyle.display = "none"
|
33
|
-
}
|
34
|
-
|
35
|
-
return true;
|
36
|
-
}
|
37
|
-
|
38
|
-
// Make codeblocks hidden by default
|
39
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
-
|
41
|
-
// ]]>
|
42
|
-
</script>
|
43
|
-
|
44
|
-
</head>
|
45
|
-
<body>
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
<div id="classHeader">
|
50
|
-
<table class="header-table">
|
51
|
-
<tr class="top-aligned-row">
|
52
|
-
<td><strong>Class</strong></td>
|
53
|
-
<td class="class-name-in-header">MediaWiki::APIError</td>
|
54
|
-
</tr>
|
55
|
-
<tr class="top-aligned-row">
|
56
|
-
<td><strong>In:</strong></td>
|
57
|
-
<td>
|
58
|
-
<a href="../../files/lib/media_wiki/exception_rb.html">
|
59
|
-
lib/media_wiki/exception.rb
|
60
|
-
</a>
|
61
|
-
<br />
|
62
|
-
</td>
|
63
|
-
</tr>
|
64
|
-
|
65
|
-
<tr class="top-aligned-row">
|
66
|
-
<td><strong>Parent:</strong></td>
|
67
|
-
<td>
|
68
|
-
<a href="Exception.html">
|
69
|
-
MediaWiki::Exception
|
70
|
-
</a>
|
71
|
-
</td>
|
72
|
-
</tr>
|
73
|
-
</table>
|
74
|
-
</div>
|
75
|
-
<!-- banner header -->
|
76
|
-
|
77
|
-
<div id="bodyContent">
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
<div id="contextContent">
|
82
|
-
|
83
|
-
<div id="description">
|
84
|
-
<p>
|
85
|
-
Wrapper for errors returned by <a href="../MediaWiki.html">MediaWiki</a>
|
86
|
-
API. Possible codes are defined in <a
|
87
|
-
href="http://www.mediawiki.org/wiki/API:Errors_and_warnings">www.mediawiki.org/wiki/API:Errors_and_warnings</a>.
|
88
|
-
</p>
|
89
|
-
<p>
|
90
|
-
Warnings also throw errors with code ‘warning’, unless <a
|
91
|
-
href="Gateway.html#M000008">MediaWiki::Gateway#new</a> was called with
|
92
|
-
:ignorewarnings.
|
93
|
-
</p>
|
94
|
-
|
95
|
-
</div>
|
96
|
-
|
97
|
-
|
98
|
-
</div>
|
99
|
-
|
100
|
-
<div id="method-list">
|
101
|
-
<h3 class="section-bar">Methods</h3>
|
102
|
-
|
103
|
-
<div class="name-list">
|
104
|
-
<a href="#M000042">new</a>
|
105
|
-
</div>
|
106
|
-
</div>
|
107
|
-
|
108
|
-
</div>
|
109
|
-
|
110
|
-
|
111
|
-
<!-- if includes -->
|
112
|
-
|
113
|
-
<div id="section">
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
<div id="attribute-list">
|
120
|
-
<h3 class="section-bar">Attributes</h3>
|
121
|
-
|
122
|
-
<div class="name-list">
|
123
|
-
<table>
|
124
|
-
<tr class="top-aligned-row context-row">
|
125
|
-
<td class="context-item-name">code</td>
|
126
|
-
<td class="context-item-value"> [R] </td>
|
127
|
-
<td class="context-item-desc"></td>
|
128
|
-
</tr>
|
129
|
-
<tr class="top-aligned-row context-row">
|
130
|
-
<td class="context-item-name">info</td>
|
131
|
-
<td class="context-item-value"> [R] </td>
|
132
|
-
<td class="context-item-desc"></td>
|
133
|
-
</tr>
|
134
|
-
<tr class="top-aligned-row context-row">
|
135
|
-
<td class="context-item-name">message</td>
|
136
|
-
<td class="context-item-value"> [R] </td>
|
137
|
-
<td class="context-item-desc"></td>
|
138
|
-
</tr>
|
139
|
-
</table>
|
140
|
-
</div>
|
141
|
-
</div>
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
<!-- if method_list -->
|
146
|
-
<div id="methods">
|
147
|
-
<h3 class="section-bar">Public Class methods</h3>
|
148
|
-
|
149
|
-
<div id="method-M000042" class="method-detail">
|
150
|
-
<a name="M000042"></a>
|
151
|
-
|
152
|
-
<div class="method-heading">
|
153
|
-
<a href="#M000042" class="method-signature">
|
154
|
-
<span class="method-name">new</span><span class="method-args">(code, info)</span>
|
155
|
-
</a>
|
156
|
-
</div>
|
157
|
-
|
158
|
-
<div class="method-description">
|
159
|
-
<p><a class="source-toggle" href="#"
|
160
|
-
onclick="toggleCode('M000042-source');return false;">[Source]</a></p>
|
161
|
-
<div class="method-source-code" id="M000042-source">
|
162
|
-
<pre>
|
163
|
-
<span class="ruby-comment cmt"># File lib/media_wiki/exception.rb, line 12</span>
|
164
|
-
12: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">code</span>, <span class="ruby-identifier">info</span>)
|
165
|
-
13: <span class="ruby-ivar">@code</span> = <span class="ruby-identifier">code</span>
|
166
|
-
14: <span class="ruby-ivar">@info</span> = <span class="ruby-identifier">info</span>
|
167
|
-
15: <span class="ruby-ivar">@message</span> = <span class="ruby-node">"API error: code '#{code}', info '#{info}'"</span>
|
168
|
-
16: <span class="ruby-keyword kw">end</span>
|
169
|
-
</pre>
|
170
|
-
</div>
|
171
|
-
</div>
|
172
|
-
</div>
|
173
|
-
|
174
|
-
|
175
|
-
</div>
|
176
|
-
|
177
|
-
|
178
|
-
</div>
|
179
|
-
|
180
|
-
|
181
|
-
<div id="validator-badges">
|
182
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
183
|
-
</div>
|
184
|
-
|
185
|
-
</body>
|
186
|
-
</html>
|
@@ -1,269 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
-
<!DOCTYPE html
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
-
|
6
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
-
<head>
|
8
|
-
<title>Class: MediaWiki::Config</title>
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
-
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
-
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
-
<script type="text/javascript">
|
13
|
-
// <![CDATA[
|
14
|
-
|
15
|
-
function popupCode( url ) {
|
16
|
-
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
-
}
|
18
|
-
|
19
|
-
function toggleCode( id ) {
|
20
|
-
if ( document.getElementById )
|
21
|
-
elem = document.getElementById( id );
|
22
|
-
else if ( document.all )
|
23
|
-
elem = eval( "document.all." + id );
|
24
|
-
else
|
25
|
-
return false;
|
26
|
-
|
27
|
-
elemStyle = elem.style;
|
28
|
-
|
29
|
-
if ( elemStyle.display != "block" ) {
|
30
|
-
elemStyle.display = "block"
|
31
|
-
} else {
|
32
|
-
elemStyle.display = "none"
|
33
|
-
}
|
34
|
-
|
35
|
-
return true;
|
36
|
-
}
|
37
|
-
|
38
|
-
// Make codeblocks hidden by default
|
39
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
-
|
41
|
-
// ]]>
|
42
|
-
</script>
|
43
|
-
|
44
|
-
</head>
|
45
|
-
<body>
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
<div id="classHeader">
|
50
|
-
<table class="header-table">
|
51
|
-
<tr class="top-aligned-row">
|
52
|
-
<td><strong>Class</strong></td>
|
53
|
-
<td class="class-name-in-header">MediaWiki::Config</td>
|
54
|
-
</tr>
|
55
|
-
<tr class="top-aligned-row">
|
56
|
-
<td><strong>In:</strong></td>
|
57
|
-
<td>
|
58
|
-
<a href="../../files/lib/media_wiki/config_rb.html">
|
59
|
-
lib/media_wiki/config.rb
|
60
|
-
</a>
|
61
|
-
<br />
|
62
|
-
</td>
|
63
|
-
</tr>
|
64
|
-
|
65
|
-
<tr class="top-aligned-row">
|
66
|
-
<td><strong>Parent:</strong></td>
|
67
|
-
<td>
|
68
|
-
Object
|
69
|
-
</td>
|
70
|
-
</tr>
|
71
|
-
</table>
|
72
|
-
</div>
|
73
|
-
<!-- banner header -->
|
74
|
-
|
75
|
-
<div id="bodyContent">
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
<div id="contextContent">
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
</div>
|
84
|
-
|
85
|
-
<div id="method-list">
|
86
|
-
<h3 class="section-bar">Methods</h3>
|
87
|
-
|
88
|
-
<div class="name-list">
|
89
|
-
<a href="#M000041">abort</a>
|
90
|
-
<a href="#M000040">new</a>
|
91
|
-
</div>
|
92
|
-
</div>
|
93
|
-
|
94
|
-
</div>
|
95
|
-
|
96
|
-
|
97
|
-
<!-- if includes -->
|
98
|
-
|
99
|
-
<div id="section">
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
<div id="attribute-list">
|
106
|
-
<h3 class="section-bar">Attributes</h3>
|
107
|
-
|
108
|
-
<div class="name-list">
|
109
|
-
<table>
|
110
|
-
<tr class="top-aligned-row context-row">
|
111
|
-
<td class="context-item-name">article</td>
|
112
|
-
<td class="context-item-value"> [R] </td>
|
113
|
-
<td class="context-item-desc"></td>
|
114
|
-
</tr>
|
115
|
-
<tr class="top-aligned-row context-row">
|
116
|
-
<td class="context-item-name">desc</td>
|
117
|
-
<td class="context-item-value"> [R] </td>
|
118
|
-
<td class="context-item-desc"></td>
|
119
|
-
</tr>
|
120
|
-
<tr class="top-aligned-row context-row">
|
121
|
-
<td class="context-item-name">file</td>
|
122
|
-
<td class="context-item-value"> [R] </td>
|
123
|
-
<td class="context-item-desc"></td>
|
124
|
-
</tr>
|
125
|
-
<tr class="top-aligned-row context-row">
|
126
|
-
<td class="context-item-name">pw</td>
|
127
|
-
<td class="context-item-value"> [R] </td>
|
128
|
-
<td class="context-item-desc"></td>
|
129
|
-
</tr>
|
130
|
-
<tr class="top-aligned-row context-row">
|
131
|
-
<td class="context-item-name">summary</td>
|
132
|
-
<td class="context-item-value"> [R] </td>
|
133
|
-
<td class="context-item-desc"></td>
|
134
|
-
</tr>
|
135
|
-
<tr class="top-aligned-row context-row">
|
136
|
-
<td class="context-item-name">target</td>
|
137
|
-
<td class="context-item-value"> [R] </td>
|
138
|
-
<td class="context-item-desc"></td>
|
139
|
-
</tr>
|
140
|
-
<tr class="top-aligned-row context-row">
|
141
|
-
<td class="context-item-name">url</td>
|
142
|
-
<td class="context-item-value"> [R] </td>
|
143
|
-
<td class="context-item-desc"></td>
|
144
|
-
</tr>
|
145
|
-
<tr class="top-aligned-row context-row">
|
146
|
-
<td class="context-item-name">user</td>
|
147
|
-
<td class="context-item-value"> [R] </td>
|
148
|
-
<td class="context-item-desc"></td>
|
149
|
-
</tr>
|
150
|
-
</table>
|
151
|
-
</div>
|
152
|
-
</div>
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
<!-- if method_list -->
|
157
|
-
<div id="methods">
|
158
|
-
<h3 class="section-bar">Public Class methods</h3>
|
159
|
-
|
160
|
-
<div id="method-M000040" class="method-detail">
|
161
|
-
<a name="M000040"></a>
|
162
|
-
|
163
|
-
<div class="method-heading">
|
164
|
-
<a href="#M000040" class="method-signature">
|
165
|
-
<span class="method-name">new</span><span class="method-args">(args, type = "read")</span>
|
166
|
-
</a>
|
167
|
-
</div>
|
168
|
-
|
169
|
-
<div class="method-description">
|
170
|
-
<p><a class="source-toggle" href="#"
|
171
|
-
onclick="toggleCode('M000040-source');return false;">[Source]</a></p>
|
172
|
-
<div class="method-source-code" id="M000040-source">
|
173
|
-
<pre>
|
174
|
-
<span class="ruby-comment cmt"># File lib/media_wiki/config.rb, line 10</span>
|
175
|
-
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>)
|
176
|
-
11: <span class="ruby-ivar">@summary</span> = <span class="ruby-value str">"Automated edit via MediaWiki::Gateway"</span>
|
177
|
-
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>
|
178
|
-
13: <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">banner</span> = <span class="ruby-value str">"Usage: [options]"</span>
|
179
|
-
14:
|
180
|
-
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>
|
181
|
-
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>)
|
182
|
-
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>
|
183
|
-
18: <span class="ruby-identifier">host</span> = <span class="ruby-identifier">yaml</span>[<span class="ruby-identifier">host_id</span>]
|
184
|
-
19: <span class="ruby-ivar">@url</span> = <span class="ruby-identifier">host</span>[<span class="ruby-value str">'url'</span>]
|
185
|
-
20: <span class="ruby-ivar">@pw</span> = <span class="ruby-identifier">host</span>[<span class="ruby-value str">'pw'</span>]
|
186
|
-
21: <span class="ruby-ivar">@user</span> = <span class="ruby-identifier">host</span>[<span class="ruby-value str">'user'</span>]
|
187
|
-
22: <span class="ruby-keyword kw">else</span>
|
188
|
-
23: <span class="ruby-identifier">raise</span> <span class="ruby-node">"Host #{host_id} not found in config/hosts.yml"</span>
|
189
|
-
24: <span class="ruby-keyword kw">end</span>
|
190
|
-
25: <span class="ruby-keyword kw">end</span>
|
191
|
-
26:
|
192
|
-
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>
|
193
|
-
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>
|
194
|
-
29: <span class="ruby-ivar">@desc</span> = <span class="ruby-identifier">desc</span>
|
195
|
-
30: <span class="ruby-keyword kw">end</span>
|
196
|
-
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>
|
197
|
-
32: <span class="ruby-ivar">@target</span> = <span class="ruby-identifier">target</span>
|
198
|
-
33: <span class="ruby-keyword kw">end</span>
|
199
|
-
34: <span class="ruby-keyword kw">else</span>
|
200
|
-
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>
|
201
|
-
36: <span class="ruby-ivar">@article</span> = <span class="ruby-identifier">article</span>
|
202
|
-
37: <span class="ruby-keyword kw">end</span>
|
203
|
-
38: <span class="ruby-keyword kw">end</span>
|
204
|
-
39:
|
205
|
-
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>
|
206
|
-
41: <span class="ruby-ivar">@user</span> = <span class="ruby-identifier">user</span>
|
207
|
-
42: <span class="ruby-keyword kw">end</span>
|
208
|
-
43:
|
209
|
-
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>
|
210
|
-
45: <span class="ruby-ivar">@pw</span> = <span class="ruby-identifier">pw</span>
|
211
|
-
46: <span class="ruby-keyword kw">end</span>
|
212
|
-
47:
|
213
|
-
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>
|
214
|
-
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>
|
215
|
-
50: <span class="ruby-ivar">@summary</span> = <span class="ruby-identifier">summary</span>
|
216
|
-
51: <span class="ruby-keyword kw">end</span>
|
217
|
-
52: <span class="ruby-keyword kw">end</span>
|
218
|
-
53:
|
219
|
-
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>
|
220
|
-
55: <span class="ruby-ivar">@url</span> = <span class="ruby-identifier">url</span>
|
221
|
-
56: <span class="ruby-keyword kw">end</span>
|
222
|
-
57: <span class="ruby-keyword kw">end</span>
|
223
|
-
58: <span class="ruby-ivar">@opts</span>.<span class="ruby-identifier">parse!</span>
|
224
|
-
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>
|
225
|
-
60: <span class="ruby-keyword kw">end</span>
|
226
|
-
</pre>
|
227
|
-
</div>
|
228
|
-
</div>
|
229
|
-
</div>
|
230
|
-
|
231
|
-
<h3 class="section-bar">Public Instance methods</h3>
|
232
|
-
|
233
|
-
<div id="method-M000041" class="method-detail">
|
234
|
-
<a name="M000041"></a>
|
235
|
-
|
236
|
-
<div class="method-heading">
|
237
|
-
<a href="#M000041" class="method-signature">
|
238
|
-
<span class="method-name">abort</span><span class="method-args">(error)</span>
|
239
|
-
</a>
|
240
|
-
</div>
|
241
|
-
|
242
|
-
<div class="method-description">
|
243
|
-
<p><a class="source-toggle" href="#"
|
244
|
-
onclick="toggleCode('M000041-source');return false;">[Source]</a></p>
|
245
|
-
<div class="method-source-code" id="M000041-source">
|
246
|
-
<pre>
|
247
|
-
<span class="ruby-comment cmt"># File lib/media_wiki/config.rb, line 62</span>
|
248
|
-
62: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">abort</span>(<span class="ruby-identifier">error</span>)
|
249
|
-
63: <span class="ruby-identifier">puts</span> <span class="ruby-node">"Error: #{error}\n\n#{@opts.to_s}"</span>
|
250
|
-
64: <span class="ruby-identifier">exit</span>
|
251
|
-
65: <span class="ruby-keyword kw">end</span>
|
252
|
-
</pre>
|
253
|
-
</div>
|
254
|
-
</div>
|
255
|
-
</div>
|
256
|
-
|
257
|
-
|
258
|
-
</div>
|
259
|
-
|
260
|
-
|
261
|
-
</div>
|
262
|
-
|
263
|
-
|
264
|
-
<div id="validator-badges">
|
265
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
266
|
-
</div>
|
267
|
-
|
268
|
-
</body>
|
269
|
-
</html>
|