mediawiki-gateway 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. data/.gitignore +3 -0
  2. data/README +12 -0
  3. data/Rakefile +40 -0
  4. data/VERSION +1 -0
  5. data/config/hosts.yml +17 -0
  6. data/doc/classes/MediaWiki.html +189 -0
  7. data/doc/classes/MediaWiki/Config.html +269 -0
  8. data/doc/classes/MediaWiki/Gateway.html +952 -0
  9. data/doc/created.rid +1 -0
  10. data/doc/files/README_txt.html +117 -0
  11. data/doc/files/media_wiki/config_rb.html +108 -0
  12. data/doc/files/media_wiki/gateway_rb.html +113 -0
  13. data/doc/files/media_wiki/utils_rb.html +101 -0
  14. data/doc/files/script/create_page_rb.html +115 -0
  15. data/doc/files/script/delete_book_rb.html +108 -0
  16. data/doc/files/script/export_xml_rb.html +114 -0
  17. data/doc/files/script/get_page_rb.html +114 -0
  18. data/doc/files/script/import_xml_rb.html +114 -0
  19. data/doc/files/script/undelete_page_rb.html +101 -0
  20. data/doc/files/script/upload_commons_rb.html +109 -0
  21. data/doc/files/script/upload_file_rb.html +115 -0
  22. data/doc/fr_class_index.html +29 -0
  23. data/doc/fr_file_index.html +38 -0
  24. data/doc/fr_method_index.html +49 -0
  25. data/doc/index.html +24 -0
  26. data/doc/rdoc-style.css +208 -0
  27. data/lib/media_wiki.rb +3 -0
  28. data/lib/media_wiki/config.rb +69 -0
  29. data/lib/media_wiki/gateway.rb +307 -0
  30. data/lib/media_wiki/utils.rb +18 -0
  31. data/mediawiki-gateway.gemspec +88 -0
  32. data/script/create_page.rb +14 -0
  33. data/script/delete_book.rb +14 -0
  34. data/script/export_xml.rb +14 -0
  35. data/script/get_page.rb +12 -0
  36. data/script/import_xml.rb +14 -0
  37. data/script/run_fake_media_wiki.rb +8 -0
  38. data/script/undelete_page.rb +15 -0
  39. data/script/upload_commons.rb +42 -0
  40. data/script/upload_file.rb +14 -0
  41. data/spec/fake_media_wiki/api_pages.rb +131 -0
  42. data/spec/fake_media_wiki/app.rb +262 -0
  43. data/spec/fake_media_wiki/query_handling.rb +112 -0
  44. data/spec/gateway_spec.old +535 -0
  45. data/spec/gateway_spec.rb +653 -0
  46. data/spec/import-test-data.xml +68 -0
  47. metadata +115 -0
@@ -0,0 +1,101 @@
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>File: undelete_page.rb</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="fileHeader">
50
+ <h1>undelete_page.rb</h1>
51
+ <table class="header-table">
52
+ <tr class="top-aligned-row">
53
+ <td><strong>Path:</strong></td>
54
+ <td>script/undelete_page.rb
55
+ </td>
56
+ </tr>
57
+ <tr class="top-aligned-row">
58
+ <td><strong>Last Update:</strong></td>
59
+ <td>Thu Aug 05 17:26:12 +1000 2010</td>
60
+ </tr>
61
+ </table>
62
+ </div>
63
+ <!-- banner header -->
64
+
65
+ <div id="bodyContent">
66
+
67
+
68
+
69
+ <div id="contextContent">
70
+
71
+
72
+
73
+ </div>
74
+
75
+
76
+ </div>
77
+
78
+
79
+ <!-- if includes -->
80
+
81
+ <div id="section">
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+
90
+ <!-- if method_list -->
91
+
92
+
93
+ </div>
94
+
95
+
96
+ <div id="validator-badges">
97
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
98
+ </div>
99
+
100
+ </body>
101
+ </html>
@@ -0,0 +1,109 @@
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>File: upload_commons.rb</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="fileHeader">
50
+ <h1>upload_commons.rb</h1>
51
+ <table class="header-table">
52
+ <tr class="top-aligned-row">
53
+ <td><strong>Path:</strong></td>
54
+ <td>script/upload_commons.rb
55
+ </td>
56
+ </tr>
57
+ <tr class="top-aligned-row">
58
+ <td><strong>Last Update:</strong></td>
59
+ <td>Sun Aug 15 20:58:44 +1000 2010</td>
60
+ </tr>
61
+ </table>
62
+ </div>
63
+ <!-- banner header -->
64
+
65
+ <div id="bodyContent">
66
+
67
+
68
+
69
+ <div id="contextContent">
70
+
71
+
72
+ <div id="requires-list">
73
+ <h3 class="section-bar">Required files</h3>
74
+
75
+ <div class="name-list">
76
+ <a href="../media_wiki/gateway_rb.html">media_wiki/gateway</a>&nbsp;&nbsp;
77
+ <a href="../media_wiki/config_rb.html">media_wiki/config</a>&nbsp;&nbsp;
78
+ </div>
79
+ </div>
80
+
81
+ </div>
82
+
83
+
84
+ </div>
85
+
86
+
87
+ <!-- if includes -->
88
+
89
+ <div id="section">
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+ <!-- if method_list -->
99
+
100
+
101
+ </div>
102
+
103
+
104
+ <div id="validator-badges">
105
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
106
+ </div>
107
+
108
+ </body>
109
+ </html>
@@ -0,0 +1,115 @@
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>File: upload_file.rb</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="fileHeader">
50
+ <h1>upload_file.rb</h1>
51
+ <table class="header-table">
52
+ <tr class="top-aligned-row">
53
+ <td><strong>Path:</strong></td>
54
+ <td>script/upload_file.rb
55
+ </td>
56
+ </tr>
57
+ <tr class="top-aligned-row">
58
+ <td><strong>Last Update:</strong></td>
59
+ <td>Sun Aug 15 18:38:25 +1000 2010</td>
60
+ </tr>
61
+ </table>
62
+ </div>
63
+ <!-- banner header -->
64
+
65
+ <div id="bodyContent">
66
+
67
+
68
+
69
+ <div id="contextContent">
70
+
71
+ <div id="description">
72
+ <p>
73
+ Sample script for fetching a page&#8216;s current contents in Wiki markup
74
+ </p>
75
+
76
+ </div>
77
+
78
+ <div id="requires-list">
79
+ <h3 class="section-bar">Required files</h3>
80
+
81
+ <div class="name-list">
82
+ <a href="../media_wiki/gateway_rb.html">media_wiki/gateway</a>&nbsp;&nbsp;
83
+ <a href="../media_wiki/config_rb.html">media_wiki/config</a>&nbsp;&nbsp;
84
+ </div>
85
+ </div>
86
+
87
+ </div>
88
+
89
+
90
+ </div>
91
+
92
+
93
+ <!-- if includes -->
94
+
95
+ <div id="section">
96
+
97
+
98
+
99
+
100
+
101
+
102
+
103
+
104
+ <!-- if method_list -->
105
+
106
+
107
+ </div>
108
+
109
+
110
+ <div id="validator-badges">
111
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
112
+ </div>
113
+
114
+ </body>
115
+ </html>
@@ -0,0 +1,29 @@
1
+
2
+ <?xml version="1.0" encoding="iso-8859-1"?>
3
+ <!DOCTYPE html
4
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
5
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
6
+
7
+ <!--
8
+
9
+ Classes
10
+
11
+ -->
12
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
13
+ <head>
14
+ <title>Classes</title>
15
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
16
+ <link rel="stylesheet" href="rdoc-style.css" type="text/css" />
17
+ <base target="docwin" />
18
+ </head>
19
+ <body>
20
+ <div id="index">
21
+ <h1 class="section-bar">Classes</h1>
22
+ <div id="index-entries">
23
+ <a href="classes/MediaWiki.html">MediaWiki</a><br />
24
+ <a href="classes/MediaWiki/Config.html">MediaWiki::Config</a><br />
25
+ <a href="classes/MediaWiki/Gateway.html">MediaWiki::Gateway</a><br />
26
+ </div>
27
+ </div>
28
+ </body>
29
+ </html>
@@ -0,0 +1,38 @@
1
+
2
+ <?xml version="1.0" encoding="iso-8859-1"?>
3
+ <!DOCTYPE html
4
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
5
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
6
+
7
+ <!--
8
+
9
+ Files
10
+
11
+ -->
12
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
13
+ <head>
14
+ <title>Files</title>
15
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
16
+ <link rel="stylesheet" href="rdoc-style.css" type="text/css" />
17
+ <base target="docwin" />
18
+ </head>
19
+ <body>
20
+ <div id="index">
21
+ <h1 class="section-bar">Files</h1>
22
+ <div id="index-entries">
23
+ <a href="files/README_txt.html">README.txt</a><br />
24
+ <a href="files/media_wiki/config_rb.html">media_wiki/config.rb</a><br />
25
+ <a href="files/media_wiki/gateway_rb.html">media_wiki/gateway.rb</a><br />
26
+ <a href="files/media_wiki/utils_rb.html">media_wiki/utils.rb</a><br />
27
+ <a href="files/script/create_page_rb.html">script/create_page.rb</a><br />
28
+ <a href="files/script/delete_book_rb.html">script/delete_book.rb</a><br />
29
+ <a href="files/script/export_xml_rb.html">script/export_xml.rb</a><br />
30
+ <a href="files/script/get_page_rb.html">script/get_page.rb</a><br />
31
+ <a href="files/script/import_xml_rb.html">script/import_xml.rb</a><br />
32
+ <a href="files/script/undelete_page_rb.html">script/undelete_page.rb</a><br />
33
+ <a href="files/script/upload_commons_rb.html">script/upload_commons.rb</a><br />
34
+ <a href="files/script/upload_file_rb.html">script/upload_file.rb</a><br />
35
+ </div>
36
+ </div>
37
+ </body>
38
+ </html>
@@ -0,0 +1,49 @@
1
+
2
+ <?xml version="1.0" encoding="iso-8859-1"?>
3
+ <!DOCTYPE html
4
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
5
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
6
+
7
+ <!--
8
+
9
+ Methods
10
+
11
+ -->
12
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
13
+ <head>
14
+ <title>Methods</title>
15
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
16
+ <link rel="stylesheet" href="rdoc-style.css" type="text/css" />
17
+ <base target="docwin" />
18
+ </head>
19
+ <body>
20
+ <div id="index">
21
+ <h1 class="section-bar">Methods</h1>
22
+ <div id="index-entries">
23
+ <a href="classes/MediaWiki/Config.html#M000023">abort (MediaWiki::Config)</a><br />
24
+ <a href="classes/MediaWiki/Gateway.html#M000007">create (MediaWiki::Gateway)</a><br />
25
+ <a href="classes/MediaWiki/Gateway.html#M000008">delete (MediaWiki::Gateway)</a><br />
26
+ <a href="classes/MediaWiki/Gateway.html#M000014">export (MediaWiki::Gateway)</a><br />
27
+ <a href="classes/MediaWiki/Gateway.html#M000016">extensions (MediaWiki::Gateway)</a><br />
28
+ <a href="classes/MediaWiki/Gateway.html#M000005">get (MediaWiki::Gateway)</a><br />
29
+ <a href="classes/MediaWiki/Gateway.html#M000021">get_response (MediaWiki::Gateway)</a><br />
30
+ <a href="classes/MediaWiki/Gateway.html#M000018">get_token (MediaWiki::Gateway)</a><br />
31
+ <a href="classes/MediaWiki/Gateway.html#M000019">get_undelete_token (MediaWiki::Gateway)</a><br />
32
+ <a href="classes/MediaWiki/Gateway.html#M000013">import (MediaWiki::Gateway)</a><br />
33
+ <a href="classes/MediaWiki/Gateway.html#M000010">list (MediaWiki::Gateway)</a><br />
34
+ <a href="classes/MediaWiki/Gateway.html#M000004">login (MediaWiki::Gateway)</a><br />
35
+ <a href="classes/MediaWiki/Gateway.html#M000020">make_api_request (MediaWiki::Gateway)</a><br />
36
+ <a href="classes/MediaWiki/Gateway.html#M000015">namespaces_by_prefix (MediaWiki::Gateway)</a><br />
37
+ <a href="classes/MediaWiki/Gateway.html#M000003">new (MediaWiki::Gateway)</a><br />
38
+ <a href="classes/MediaWiki/Config.html#M000022">new (MediaWiki::Config)</a><br />
39
+ <a href="classes/MediaWiki/Gateway.html#M000006">render (MediaWiki::Gateway)</a><br />
40
+ <a href="classes/MediaWiki/Gateway.html#M000011">search (MediaWiki::Gateway)</a><br />
41
+ <a href="classes/MediaWiki/Gateway.html#M000017">semantic_query (MediaWiki::Gateway)</a><br />
42
+ <a href="classes/MediaWiki/Gateway.html#M000009">undelete (MediaWiki::Gateway)</a><br />
43
+ <a href="classes/MediaWiki/Gateway.html#M000012">upload (MediaWiki::Gateway)</a><br />
44
+ <a href="classes/MediaWiki.html#M000001">version (MediaWiki)</a><br />
45
+ <a href="classes/MediaWiki.html#M000002">wiki_to_uri (MediaWiki)</a><br />
46
+ </div>
47
+ </div>
48
+ </body>
49
+ </html>