mediawiktory 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (158) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +18 -0
  3. data/CONTRIBUTING.md +16 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +5 -5
  6. data/examples/query_generator.rb +1 -1
  7. data/lib/mediawiktory.rb +2 -1
  8. data/lib/mediawiktory/action.rb +9 -0
  9. data/lib/mediawiktory/client.rb +27 -2
  10. data/lib/mediawiktory/generated/abusefilters.rb +3 -3
  11. data/lib/mediawiktory/generated/abuselog.rb +2 -2
  12. data/lib/mediawiktory/generated/allcategories.rb +2 -2
  13. data/lib/mediawiktory/generated/alldeletedrevisions.rb +4 -4
  14. data/lib/mediawiktory/generated/allfileusages.rb +2 -2
  15. data/lib/mediawiktory/generated/allimages.rb +4 -4
  16. data/lib/mediawiktory/generated/alllinks.rb +3 -3
  17. data/lib/mediawiktory/generated/allmessages.rb +2 -2
  18. data/lib/mediawiktory/generated/allpages.rb +8 -8
  19. data/lib/mediawiktory/generated/allredirects.rb +3 -3
  20. data/lib/mediawiktory/generated/alltransclusions.rb +3 -3
  21. data/lib/mediawiktory/generated/allusers.rb +5 -5
  22. data/lib/mediawiktory/generated/backlinks.rb +3 -3
  23. data/lib/mediawiktory/generated/blocks.rb +3 -3
  24. data/lib/mediawiktory/generated/categories.rb +3 -3
  25. data/lib/mediawiktory/generated/categorymembers.rb +5 -5
  26. data/lib/mediawiktory/generated/checktoken.rb +1 -1
  27. data/lib/mediawiktory/generated/checkuser.rb +1 -1
  28. data/lib/mediawiktory/generated/checkuserlog.rb +1 -1
  29. data/lib/mediawiktory/generated/close-open-topic.rb +1 -1
  30. data/lib/mediawiktory/generated/contenttranslation.rb +1 -1
  31. data/lib/mediawiktory/generated/contenttranslationlangtrend.rb +1 -1
  32. data/lib/mediawiktory/generated/contributors.rb +4 -4
  33. data/lib/mediawiktory/generated/coordinates.rb +2 -2
  34. data/lib/mediawiktory/generated/cxpublish.rb +1 -1
  35. data/lib/mediawiktory/generated/delete.rb +1 -1
  36. data/lib/mediawiktory/generated/deletedrevisions.rb +3 -3
  37. data/lib/mediawiktory/generated/deletedrevs.rb +3 -3
  38. data/lib/mediawiktory/generated/deleteeducation.rb +1 -1
  39. data/lib/mediawiktory/generated/duplicatefiles.rb +1 -1
  40. data/lib/mediawiktory/generated/echomarkread.rb +1 -1
  41. data/lib/mediawiktory/generated/echomarkseen.rb +1 -1
  42. data/lib/mediawiktory/generated/edit-header.rb +1 -1
  43. data/lib/mediawiktory/generated/edit-post.rb +1 -1
  44. data/lib/mediawiktory/generated/edit-topic-summary.rb +1 -1
  45. data/lib/mediawiktory/generated/edit.rb +4 -4
  46. data/lib/mediawiktory/generated/editlist.rb +2 -2
  47. data/lib/mediawiktory/generated/embeddedin.rb +3 -3
  48. data/lib/mediawiktory/generated/enlist.rb +2 -2
  49. data/lib/mediawiktory/generated/expandtemplates.rb +1 -1
  50. data/lib/mediawiktory/generated/extlinks.rb +1 -1
  51. data/lib/mediawiktory/generated/extracts.rb +1 -1
  52. data/lib/mediawiktory/generated/exturlusage.rb +3 -3
  53. data/lib/mediawiktory/generated/featuredfeed.rb +2 -2
  54. data/lib/mediawiktory/generated/feedcontributions.rb +3 -3
  55. data/lib/mediawiktory/generated/feedrecentchanges.rb +2 -2
  56. data/lib/mediawiktory/generated/feedwatchlist.rb +3 -3
  57. data/lib/mediawiktory/generated/filearchive.rb +2 -2
  58. data/lib/mediawiktory/generated/filerepoinfo.rb +1 -1
  59. data/lib/mediawiktory/generated/fileusage.rb +3 -3
  60. data/lib/mediawiktory/generated/flow-parsoid-utils.rb +2 -2
  61. data/lib/mediawiktory/generated/gadgetcategories.rb +1 -1
  62. data/lib/mediawiktory/generated/gadgets.rb +1 -1
  63. data/lib/mediawiktory/generated/geosearch.rb +4 -4
  64. data/lib/mediawiktory/generated/globalallusers.rb +4 -4
  65. data/lib/mediawiktory/generated/globalblocks.rb +2 -2
  66. data/lib/mediawiktory/generated/globalgroups.rb +1 -1
  67. data/lib/mediawiktory/generated/globalusage.rb +1 -1
  68. data/lib/mediawiktory/generated/globaluserinfo.rb +1 -1
  69. data/lib/mediawiktory/generated/globaluserrights.rb +2 -2
  70. data/lib/mediawiktory/generated/imageinfo.rb +1 -1
  71. data/lib/mediawiktory/generated/images.rb +1 -1
  72. data/lib/mediawiktory/generated/imageusage.rb +3 -3
  73. data/lib/mediawiktory/generated/import.rb +2 -2
  74. data/lib/mediawiktory/generated/info.rb +2 -2
  75. data/lib/mediawiktory/generated/iwbacklinks.rb +2 -2
  76. data/lib/mediawiktory/generated/iwlinks.rb +2 -2
  77. data/lib/mediawiktory/generated/jsonconfig.rb +1 -1
  78. data/lib/mediawiktory/generated/langbacklinks.rb +2 -2
  79. data/lib/mediawiktory/generated/langlinks.rb +2 -2
  80. data/lib/mediawiktory/generated/links.rb +2 -2
  81. data/lib/mediawiktory/generated/linkshere.rb +3 -3
  82. data/lib/mediawiktory/generated/listpages.rb +3 -3
  83. data/lib/mediawiktory/generated/lists.rb +2 -2
  84. data/lib/mediawiktory/generated/liststudents.rb +1 -1
  85. data/lib/mediawiktory/generated/lock-topic.rb +1 -1
  86. data/lib/mediawiktory/generated/logevents.rb +5 -5
  87. data/lib/mediawiktory/generated/managetags.rb +1 -1
  88. data/lib/mediawiktory/generated/mobileview.rb +3 -3
  89. data/lib/mediawiktory/generated/moderate-post.rb +1 -1
  90. data/lib/mediawiktory/generated/moderate-topic.rb +1 -1
  91. data/lib/mediawiktory/generated/move.rb +1 -1
  92. data/lib/mediawiktory/generated/new-topic.rb +1 -1
  93. data/lib/mediawiktory/generated/notifications.rb +3 -3
  94. data/lib/mediawiktory/generated/oldreviewedpages.rb +4 -4
  95. data/lib/mediawiktory/generated/opensearch.rb +3 -3
  96. data/lib/mediawiktory/generated/options.rb +1 -1
  97. data/lib/mediawiktory/generated/pageimages.rb +1 -1
  98. data/lib/mediawiktory/generated/pageswithprop.rb +2 -2
  99. data/lib/mediawiktory/generated/pageterms.rb +1 -1
  100. data/lib/mediawiktory/generated/pagetriageaction.rb +1 -1
  101. data/lib/mediawiktory/generated/paraminfo.rb +3 -3
  102. data/lib/mediawiktory/generated/parse.rb +3 -3
  103. data/lib/mediawiktory/generated/prefixsearch.rb +1 -1
  104. data/lib/mediawiktory/generated/protect.rb +1 -1
  105. data/lib/mediawiktory/generated/protectedtitles.rb +4 -4
  106. data/lib/mediawiktory/generated/querypage.rb +1 -1
  107. data/lib/mediawiktory/generated/random.rb +2 -2
  108. data/lib/mediawiktory/generated/recentchanges.rb +6 -6
  109. data/lib/mediawiktory/generated/redirects.rb +3 -3
  110. data/lib/mediawiktory/generated/refresheducation.rb +1 -1
  111. data/lib/mediawiktory/generated/reply.rb +1 -1
  112. data/lib/mediawiktory/generated/reviewactivity.rb +1 -1
  113. data/lib/mediawiktory/generated/revisiondelete.rb +4 -4
  114. data/lib/mediawiktory/generated/revisions.rb +4 -4
  115. data/lib/mediawiktory/generated/rollback.rb +1 -1
  116. data/lib/mediawiktory/generated/search.rb +4 -4
  117. data/lib/mediawiktory/generated/setglobalaccountstatus.rb +2 -2
  118. data/lib/mediawiktory/generated/siteinfo.rb +2 -2
  119. data/lib/mediawiktory/generated/sitematrix.rb +4 -4
  120. data/lib/mediawiktory/generated/stabilize.rb +1 -1
  121. data/lib/mediawiktory/generated/stashedit.rb +2 -2
  122. data/lib/mediawiktory/generated/stashimageinfo.rb +1 -1
  123. data/lib/mediawiktory/generated/strikevote.rb +1 -1
  124. data/lib/mediawiktory/generated/tag.rb +1 -1
  125. data/lib/mediawiktory/generated/tags.rb +1 -1
  126. data/lib/mediawiktory/generated/templatedata.rb +1 -1
  127. data/lib/mediawiktory/generated/templates.rb +2 -2
  128. data/lib/mediawiktory/generated/titleblacklist.rb +1 -1
  129. data/lib/mediawiktory/generated/tokens.rb +1 -1
  130. data/lib/mediawiktory/generated/transcludedin.rb +3 -3
  131. data/lib/mediawiktory/generated/undelete.rb +1 -1
  132. data/lib/mediawiktory/generated/upload.rb +1 -1
  133. data/lib/mediawiktory/generated/usercontribs.rb +4 -4
  134. data/lib/mediawiktory/generated/userinfo.rb +1 -1
  135. data/lib/mediawiktory/generated/userrights.rb +2 -2
  136. data/lib/mediawiktory/generated/users.rb +2 -2
  137. data/lib/mediawiktory/generated/videoinfo.rb +1 -1
  138. data/lib/mediawiktory/generated/view-header.rb +1 -1
  139. data/lib/mediawiktory/generated/view-post-history.rb +1 -1
  140. data/lib/mediawiktory/generated/view-post.rb +1 -1
  141. data/lib/mediawiktory/generated/view-topic-history.rb +1 -1
  142. data/lib/mediawiktory/generated/view-topic-summary.rb +1 -1
  143. data/lib/mediawiktory/generated/view-topic.rb +1 -1
  144. data/lib/mediawiktory/generated/view-topiclist.rb +3 -3
  145. data/lib/mediawiktory/generated/visualeditor.rb +2 -2
  146. data/lib/mediawiktory/generated/watchlist.rb +5 -5
  147. data/lib/mediawiktory/generated/watchlistraw.rb +4 -4
  148. data/lib/mediawiktory/generated/wikibase.rb +1 -1
  149. data/lib/mediawiktory/generated/wikisets.rb +1 -1
  150. data/lib/mediawiktory/generated/zeroconfig.rb +1 -1
  151. data/lib/mediawiktory/mw_module.rb +6 -2
  152. data/lib/mediawiktory/page.rb +46 -0
  153. data/lib/mediawiktory/query.rb +21 -23
  154. data/lib/mediawiktory/version.rb +4 -1
  155. data/script/lib/parameter.rb +2 -5
  156. metadata +6 -4
  157. data/Gemfile.lock +0 -63
  158. data/lib/mediawiktory/array_with_keys.rb +0 -41
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3dbe24768ed1be0926f57bb4cd72e07e098c59b6
4
- data.tar.gz: 230b1128fb7ae5b854d714dc564d7d60aaa6be08
3
+ metadata.gz: 3e4652318560b8eec98eb6888985fff574f6889d
4
+ data.tar.gz: f3ef76a2903851dd1b2ff3701faa687ea660fb72
5
5
  SHA512:
6
- metadata.gz: e2a9446d6a9a39c21d2b8f7fa3569a60c33e79607356929af29164201485ef892f84f60c7954713a7e27bf6f29d271f5454909234f69b39e2ada503a09d54142
7
- data.tar.gz: 7ec9c4d535a690d2906a64cf81d401ab3bd1198a014a316180d11b7fced7270c9f4fb4eb1d5b3b80d9706d6b42bb29c1ae23ee9960235a955c288035ebc220db
6
+ metadata.gz: 7ddfc4dd9d04c9c84064c578406ce0d558ce665ab1b128c44311146b39b6dc0f0019080d1bde801c7b7cda554f7ac8c29c197401d8e0b7ae55af3dc70de867e5
7
+ data.tar.gz: 2ba01693d9c89a00dabd34650e6e966b20dd705c15c1822b85e398c5c9d322296585d9ea662a72637387508b105a8ceff75fef61bc0749c3f2e7d4565511cb7b
@@ -0,0 +1,18 @@
1
+ # MediaWiktory Changelog
2
+
3
+ # 0.0.2 (21.11.2015)
4
+
5
+ * `Page` class for grouping records in `Query::Response`;
6
+ * `User-Agent` header support;
7
+ * Enums handling changed to symbols (were strings before);
8
+ * Correct behavior on empty pagelist when using generator (@smostovoy);
9
+ * Raise on errors in response (@smostovoy);
10
+ * Access to warnings in response (@smostovoy);
11
+ * Domain redirects transparent handling,
12
+ http://en.wikipedia.org -> https://en.wikipedia.org (@smostovoy).
13
+
14
+ # 0.0.1 (30.11.2015)
15
+
16
+ Initial!
17
+
18
+
@@ -0,0 +1,16 @@
1
+ # Contributing to MediaWiktory
2
+
3
+ Currently, MediaWiktory at early stages of development (aka "young yet
4
+ useful"). Currenty problems and roadmap can be found at
5
+ [GitHub Issues](https://github.com/molybdenum-99/mediawiktory/issues) and
6
+ are grouped into milestones.
7
+
8
+ Therefore, the big picture of "what next" is:
9
+ * more documentation for generated MediaWiki wrappers (both YARD and
10
+ on-the-fly accessible from code);
11
+ * more validations and cleaner errors;
12
+ * simplification of frequent and common tasks.
13
+
14
+ You can join MediaWiktory development by usual fork-commit-pull request
15
+ process, or by providing your own cases and problems you'd like to solve
16
+ with it.
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Victor 'Zverok' Shepelev and contributors.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -1,5 +1,4 @@
1
- **Warning! Even 0.0.1 unrealeased yet! Possible first release date
2
- is Dec 3, 2015**
1
+ # MediaWiktory, The MediaWiki Client
3
2
 
4
3
  **MediaWiktory** is MediaWiki API client that doesn't suck. No, seriously.
5
4
 
@@ -94,10 +93,11 @@ response = client.
94
93
 
95
94
  ...but it should be done without flexibility loss.
96
95
 
97
- ## Author
96
+ ## Authors
98
97
 
99
- [Victor Shepelev](http://zverok.github.io)
98
+ * [Victor Shepelev](https://zverok.github.io) [@zverok](https://github.com/zverok);
99
+ * Sergey Mostovoy [@smostovoy](https://github.com/smostovoy).
100
100
 
101
101
  ## License
102
102
 
103
- MIT.
103
+ [MIT](https://github.com/molybdenum-99/mediawiktory/blob/master/LICENSE.txt)
@@ -7,7 +7,7 @@ require 'pp'
7
7
  c = Client.new('https://en.wikipedia.org/w/api.php')
8
8
  res = c.query.
9
9
  generator(categorymembers: {title: 'Category:Countries_in_South_America', limit: 50}).
10
- prop(revisions: {prop: ['content']}).
10
+ prop(revisions: {prop: :content}).
11
11
  perform
12
12
 
13
13
  res.continue! while res.continue?
@@ -1,8 +1,9 @@
1
1
  require 'addressable/uri'
2
2
  require 'faraday'
3
+ require 'faraday_middleware'
3
4
 
4
5
  module MediaWiktory
5
- %w[client mw_module action].each do |mod|
6
+ %w[version client mw_module action].each do |mod|
6
7
  require_relative "mediawiktory/#{mod}"
7
8
  end
8
9
 
@@ -10,6 +10,7 @@ module MediaWiktory
10
10
  super(**values)
11
11
  end
12
12
 
13
+ # FIXME: should be initialize_copy
13
14
  def dup
14
15
  self.class.new(client, to_h)
15
16
  end
@@ -33,6 +34,7 @@ module MediaWiktory
33
34
  def initialize(action, raw)
34
35
  @action = action
35
36
  @raw = Hashie::Mash.new(raw)
37
+ raise RequestError, @raw.error.info unless @raw.error.nil?
36
38
  end
37
39
 
38
40
  def initialize_copy(other)
@@ -43,6 +45,13 @@ module MediaWiktory
43
45
  def to_h
44
46
  raw.to_h
45
47
  end
48
+
49
+ def warnings
50
+ @raw.warnings
51
+ end
52
+ end
53
+
54
+ class RequestError < StandardError
46
55
  end
47
56
  end
48
57
  end
@@ -2,11 +2,30 @@ require_relative 'generated/actions_mixin'
2
2
 
3
3
  module MediaWiktory
4
4
  class Client
5
+ # Default MediaWiktory User-Agent header.
6
+ #
7
+ # You can set yours as an option to {#initialize}
8
+ UA = "MediaWiktory/#{MediaWiktory::VERSION} (https://github.com/molybdenum-99/mediawiktory; zverok.offline@gmail.com)"
9
+
10
+ class << self
11
+ # User agent getter/setter.
12
+ #
13
+ # Default value is {UA}.
14
+ #
15
+ # You can also use per-instance option, see {#initialize}
16
+ attr_accessor :user_agent
17
+ end
18
+
5
19
  attr_reader :url
6
20
 
7
- def initialize(url)
21
+ def initialize(url, **options)
8
22
  @url = Addressable::URI.parse(url)
9
- @faraday = Faraday.new(url)
23
+ @faraday = Faraday.new(url) do |f|
24
+ f.request :url_encoded
25
+ f.use FaradayMiddleware::FollowRedirects, limit: 5
26
+ f.adapter Faraday.default_adapter
27
+ end
28
+ @faraday.headers.merge!(headers(options))
10
29
  end
11
30
 
12
31
  def get(params)
@@ -18,5 +37,11 @@ module MediaWiktory
18
37
  end
19
38
 
20
39
  include ActionsMixin
40
+
41
+ private
42
+
43
+ def headers(options)
44
+ {'User-Agent' => options[:user_agent] || options[:ua] || self.class.user_agent || UA}
45
+ end
21
46
  end
22
47
  end
@@ -4,9 +4,9 @@ module MediaWiktory
4
4
  prefix "abf"
5
5
  param :startid, Params::Integer
6
6
  param :endid, Params::Integer
7
- param :dir, Params::Enum["newer", "older"]
8
- param :show, Params::List[Params::Enum["enabled", "!enabled", "deleted", "!deleted", "private", "!private"]]
7
+ param :dir, Params::Enum[:newer, :older]
8
+ param :show, Params::List[Params::Enum[:enabled, :"!enabled", :deleted, :"!deleted", :private, :"!private"]]
9
9
  param :limit, Params::IntegerOrMax
10
- param :prop, Params::List[Params::Enum["id", "description", "pattern", "actions", "hits", "comments", "lasteditor", "lastedittime", "status", "private"]]
10
+ param :prop, Params::List[Params::Enum[:id, :description, :pattern, :actions, :hits, :comments, :lasteditor, :lastedittime, :status, :private]]
11
11
  end
12
12
  end
@@ -4,11 +4,11 @@ module MediaWiktory
4
4
  prefix "afl"
5
5
  param :start, Params::Timestamp
6
6
  param :end, Params::Timestamp
7
- param :dir, Params::Enum["newer", "older"]
7
+ param :dir, Params::Enum[:newer, :older]
8
8
  param :user, Params::String
9
9
  param :title, Params::String
10
10
  param :filter, Params::List[Params::String]
11
11
  param :limit, Params::IntegerOrMax
12
- param :prop, Params::List[Params::Enum["ids", "filter", "user", "ip", "title", "action", "details", "result", "timestamp", "hidden", "revid"]]
12
+ param :prop, Params::List[Params::Enum[:ids, :filter, :user, :ip, :title, :action, :details, :result, :timestamp, :hidden, :revid]]
13
13
  end
14
14
  end
@@ -6,10 +6,10 @@ module MediaWiktory
6
6
  param :continue, Params::String
7
7
  param :to, Params::String
8
8
  param :prefix, Params::String
9
- param :dir, Params::Enum["ascending", "descending"]
9
+ param :dir, Params::Enum[:ascending, :descending]
10
10
  param :min, Params::Integer
11
11
  param :max, Params::Integer
12
12
  param :limit, Params::IntegerOrMax
13
- param :prop, Params::List[Params::Enum["size", "hidden"]]
13
+ param :prop, Params::List[Params::Enum[:size, :hidden]]
14
14
  end
15
15
  end
@@ -2,7 +2,7 @@ module MediaWiktory
2
2
  class Alldeletedrevisions < MWModule
3
3
  symbol :alldeletedrevisions
4
4
  prefix "adr"
5
- param :prop, Params::List[Params::Enum["ids", "flags", "timestamp", "user", "userid", "size", "sha1", "contentmodel", "comment", "parsedcomment", "content", "tags", "parsetree"]]
5
+ param :prop, Params::List[Params::Enum[:ids, :flags, :timestamp, :user, :userid, :size, :sha1, :contentmodel, :comment, :parsedcomment, :content, :tags, :parsetree]]
6
6
  param :limit, Params::IntegerOrMax
7
7
  param :expandtemplates, Params::Boolean
8
8
  param :generatexml, Params::Boolean
@@ -10,12 +10,12 @@ module MediaWiktory
10
10
  param :section, Params::String
11
11
  param :diffto, Params::String
12
12
  param :difftotext, Params::String
13
- param :contentformat, Params::Enum["application/json", "text/x-wiki", "text/javascript", "text/css", "text/plain"]
13
+ param :contentformat, Params::Enum[:"application/json", :"text/x-wiki", :"text/javascript", :"text/css", :"text/plain"]
14
14
  param :user, Params::String
15
- param :namespace, Params::List[Params::Enum["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "100", "101", "108", "109", "118", "119", "2300", "2301", "2302", "2303", "710", "711", "446", "447", "2600", "828", "829"]]
15
+ param :namespace, Params::List[Params::Enum[:"0", :"1", :"2", :"3", :"4", :"5", :"6", :"7", :"8", :"9", :"10", :"11", :"12", :"13", :"14", :"15", :"100", :"101", :"108", :"109", :"118", :"119", :"2300", :"2301", :"2302", :"2303", :"710", :"711", :"446", :"447", :"2600", :"828", :"829"]]
16
16
  param :start, Params::Timestamp
17
17
  param :end, Params::Timestamp
18
- param :dir, Params::Enum["newer", "older"]
18
+ param :dir, Params::Enum[:newer, :older]
19
19
  param :from, Params::String
20
20
  param :to, Params::String
21
21
  param :prefix, Params::String
@@ -7,8 +7,8 @@ module MediaWiktory
7
7
  param :to, Params::String
8
8
  param :prefix, Params::String
9
9
  param :unique, Params::Boolean
10
- param :prop, Params::List[Params::Enum["ids", "title"]]
10
+ param :prop, Params::List[Params::Enum[:ids, :title]]
11
11
  param :limit, Params::IntegerOrMax
12
- param :dir, Params::Enum["ascending", "descending"]
12
+ param :dir, Params::Enum[:ascending, :descending]
13
13
  end
14
14
  end
@@ -2,21 +2,21 @@ module MediaWiktory
2
2
  class Allimages < MWModule
3
3
  symbol :allimages
4
4
  prefix "ai"
5
- param :sort, Params::Enum["name", "timestamp"]
6
- param :dir, Params::Enum["ascending", "descending", "newer", "older"]
5
+ param :sort, Params::Enum[:name, :timestamp]
6
+ param :dir, Params::Enum[:ascending, :descending, :newer, :older]
7
7
  param :from, Params::String
8
8
  param :to, Params::String
9
9
  param :continue, Params::String
10
10
  param :start, Params::Timestamp
11
11
  param :end, Params::Timestamp
12
- param :prop, Params::List[Params::Enum["timestamp", "user", "userid", "comment", "parsedcomment", "canonicaltitle", "url", "size", "dimensions", "sha1", "mime", "mediatype", "metadata", "commonmetadata", "extmetadata", "bitdepth"]]
12
+ param :prop, Params::List[Params::Enum[:timestamp, :user, :userid, :comment, :parsedcomment, :canonicaltitle, :url, :size, :dimensions, :sha1, :mime, :mediatype, :metadata, :commonmetadata, :extmetadata, :bitdepth]]
13
13
  param :prefix, Params::String
14
14
  param :minsize, Params::Integer
15
15
  param :maxsize, Params::Integer
16
16
  param :sha1, Params::String
17
17
  param :sha1base36, Params::String
18
18
  param :user, Params::String
19
- param :filterbots, Params::Enum["all", "bots", "nobots"]
19
+ param :filterbots, Params::Enum[:all, :bots, :nobots]
20
20
  param :mime, Params::List[Params::String]
21
21
  param :limit, Params::IntegerOrMax
22
22
  end
@@ -7,9 +7,9 @@ module MediaWiktory
7
7
  param :to, Params::String
8
8
  param :prefix, Params::String
9
9
  param :unique, Params::Boolean
10
- param :prop, Params::List[Params::Enum["ids", "title"]]
11
- param :namespace, Params::Enum["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "100", "101", "108", "109", "118", "119", "2300", "2301", "2302", "2303", "710", "711", "446", "447", "2600", "828", "829"]
10
+ param :prop, Params::List[Params::Enum[:ids, :title]]
11
+ param :namespace, Params::Enum[:"0", :"1", :"2", :"3", :"4", :"5", :"6", :"7", :"8", :"9", :"10", :"11", :"12", :"13", :"14", :"15", :"100", :"101", :"108", :"109", :"118", :"119", :"2300", :"2301", :"2302", :"2303", :"710", :"711", :"446", :"447", :"2600", :"828", :"829"]
12
12
  param :limit, Params::IntegerOrMax
13
- param :dir, Params::Enum["ascending", "descending"]
13
+ param :dir, Params::Enum[:ascending, :descending]
14
14
  end
15
15
  end
@@ -3,13 +3,13 @@ module MediaWiktory
3
3
  symbol :allmessages
4
4
  prefix "am"
5
5
  param :messages, Params::List[Params::String]
6
- param :prop, Params::List[Params::Enum["default"]]
6
+ param :prop, Params::List[Params::Enum[:default]]
7
7
  param :enableparser, Params::Boolean
8
8
  param :nocontent, Params::Boolean
9
9
  param :includelocal, Params::Boolean
10
10
  param :args, Params::List[Params::String]
11
11
  param :filter, Params::String
12
- param :customised, Params::Enum["all", "modified", "unmodified"]
12
+ param :customised, Params::Enum[:all, :modified, :unmodified]
13
13
  param :lang, Params::String
14
14
  param :from, Params::String
15
15
  param :to, Params::String
@@ -6,16 +6,16 @@ module MediaWiktory
6
6
  param :continue, Params::String
7
7
  param :to, Params::String
8
8
  param :prefix, Params::String
9
- param :namespace, Params::Enum["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "100", "101", "108", "109", "118", "119", "2300", "2301", "2302", "2303", "710", "711", "446", "447", "2600", "828", "829"]
10
- param :filterredir, Params::Enum["all", "redirects", "nonredirects"]
9
+ param :namespace, Params::Enum[:"0", :"1", :"2", :"3", :"4", :"5", :"6", :"7", :"8", :"9", :"10", :"11", :"12", :"13", :"14", :"15", :"100", :"101", :"108", :"109", :"118", :"119", :"2300", :"2301", :"2302", :"2303", :"710", :"711", :"446", :"447", :"2600", :"828", :"829"]
10
+ param :filterredir, Params::Enum[:all, :redirects, :nonredirects]
11
11
  param :minsize, Params::Integer
12
12
  param :maxsize, Params::Integer
13
- param :prtype, Params::List[Params::Enum["edit", "move", "upload"]]
14
- param :prlevel, Params::List[Params::Enum["autoconfirmed", "templateeditor", "sysop", "superprotect"]]
15
- param :prfiltercascade, Params::Enum["cascading", "noncascading", "all"]
13
+ param :prtype, Params::List[Params::Enum[:edit, :move, :upload]]
14
+ param :prlevel, Params::List[Params::Enum[:autoconfirmed, :templateeditor, :sysop, :superprotect]]
15
+ param :prfiltercascade, Params::Enum[:cascading, :noncascading, :all]
16
16
  param :limit, Params::IntegerOrMax
17
- param :dir, Params::Enum["ascending", "descending"]
18
- param :filterlanglinks, Params::Enum["withlanglinks", "withoutlanglinks", "all"]
19
- param :prexpiry, Params::Enum["indefinite", "definite", "all"]
17
+ param :dir, Params::Enum[:ascending, :descending]
18
+ param :filterlanglinks, Params::Enum[:withlanglinks, :withoutlanglinks, :all]
19
+ param :prexpiry, Params::Enum[:indefinite, :definite, :all]
20
20
  end
21
21
  end
@@ -7,9 +7,9 @@ module MediaWiktory
7
7
  param :to, Params::String
8
8
  param :prefix, Params::String
9
9
  param :unique, Params::Boolean
10
- param :prop, Params::List[Params::Enum["ids", "title", "fragment", "interwiki"]]
11
- param :namespace, Params::Enum["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "100", "101", "108", "109", "118", "119", "2300", "2301", "2302", "2303", "710", "711", "446", "447", "2600", "828", "829"]
10
+ param :prop, Params::List[Params::Enum[:ids, :title, :fragment, :interwiki]]
11
+ param :namespace, Params::Enum[:"0", :"1", :"2", :"3", :"4", :"5", :"6", :"7", :"8", :"9", :"10", :"11", :"12", :"13", :"14", :"15", :"100", :"101", :"108", :"109", :"118", :"119", :"2300", :"2301", :"2302", :"2303", :"710", :"711", :"446", :"447", :"2600", :"828", :"829"]
12
12
  param :limit, Params::IntegerOrMax
13
- param :dir, Params::Enum["ascending", "descending"]
13
+ param :dir, Params::Enum[:ascending, :descending]
14
14
  end
15
15
  end
@@ -7,9 +7,9 @@ module MediaWiktory
7
7
  param :to, Params::String
8
8
  param :prefix, Params::String
9
9
  param :unique, Params::Boolean
10
- param :prop, Params::List[Params::Enum["ids", "title"]]
11
- param :namespace, Params::Enum["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "100", "101", "108", "109", "118", "119", "2300", "2301", "2302", "2303", "710", "711", "446", "447", "2600", "828", "829"]
10
+ param :prop, Params::List[Params::Enum[:ids, :title]]
11
+ param :namespace, Params::Enum[:"0", :"1", :"2", :"3", :"4", :"5", :"6", :"7", :"8", :"9", :"10", :"11", :"12", :"13", :"14", :"15", :"100", :"101", :"108", :"109", :"118", :"119", :"2300", :"2301", :"2302", :"2303", :"710", :"711", :"446", :"447", :"2600", :"828", :"829"]
12
12
  param :limit, Params::IntegerOrMax
13
- param :dir, Params::Enum["ascending", "descending"]
13
+ param :dir, Params::Enum[:ascending, :descending]
14
14
  end
15
15
  end
@@ -5,11 +5,11 @@ module MediaWiktory
5
5
  param :from, Params::String
6
6
  param :to, Params::String
7
7
  param :prefix, Params::String
8
- param :dir, Params::Enum["ascending", "descending"]
9
- param :group, Params::List[Params::Enum["bot", "sysop", "bureaucrat", "reviewer", "steward", "accountcreator", "import", "transwiki", "ipblock-exempt", "oversight", "founder", "rollbacker", "autoreviewer", "researcher", "filemover", "checkuser", "templateeditor", "massmessage-sender", "abusefilter", "epcoordinator", "eponline", "epcampus", "epinstructor", "suppress", "flow-bot", "confirmed"]]
10
- param :excludegroup, Params::List[Params::Enum["bot", "sysop", "bureaucrat", "reviewer", "steward", "accountcreator", "import", "transwiki", "ipblock-exempt", "oversight", "founder", "rollbacker", "autoreviewer", "researcher", "filemover", "checkuser", "templateeditor", "massmessage-sender", "abusefilter", "epcoordinator", "eponline", "epcampus", "epinstructor", "suppress", "flow-bot", "confirmed"]]
11
- param :rights, Params::List[Params::Enum["apihighlimits", "applychangetags", "autoconfirmed", "autopatrol", "bigdelete", "block", "blockemail", "bot", "browsearchive", "changetags", "createaccount", "createpage", "createtalk", "delete", "deletedhistory", "deletedtext", "deletelogentry", "deleterevision", "edit", "editcontentmodel", "editinterface", "editprotected", "editmyoptions", "editmyprivateinfo", "editmyusercss", "editmyuserjs", "editmywatchlist", "editsemiprotected", "editusercssjs", "editusercss", "edituserjs", "hideuser", "import", "importupload", "ipblock-exempt", "managechangetags", "markbotedits", "mergehistory", "minoredit", "move", "movefile", "move-categorypages", "move-rootuserpages", "move-subpages", "nominornewtalk", "noratelimit", "override-export-depth", "pagelang", "passwordreset", "patrol", "patrolmarks", "protect", "proxyunbannable", "purge", "read", "reupload", "reupload-own", "reupload-shared", "rollback", "sendemail", "siteadmin", "suppressionlog", "suppressredirect", "suppressrevision", "unblockself", "undelete", "unwatchedpages", "upload", "upload_by_url", "userrights", "userrights-interwiki", "viewmyprivateinfo", "viewmywatchlist", "viewsuppressed", "writeapi", "spamblacklistlog", "tboverride", "tboverride-account", "titleblacklistlog", "gadgets-edit", "gadgets-definition-edit", "renameuser", "nuke", "massmessage", "gather-hidelist", "usermerge", "review", "validate", "autoreview", "autoreviewrestore", "unreviewedpages", "movestable", "stablesettings", "templateeditor", "superprotect", "editeditorprotected", "flow-edit-post", "flow-suppress", "flow-hide", "flow-delete", "transcode-reset", "transcode-status", "globalblock", "globalblock-whitelist", "globalblock-exempt", "securepoll-create-poll", "torunblocked", "skipcaptcha", "override-antispoof", "centralauth-merge", "centralauth-unmerge", "centralauth-lock", "centralauth-oversight", "globalgrouppermissions", "globalgroupmembership", "centralauth-autoaccount", "centralauth-rename", "centralauth-usermerge", "viewdeletedfile", "collectionsaveasuserpage", "collectionsaveascommunitypage", "abusefilter-modify", "abusefilter-log-detail", "abusefilter-view", "abusefilter-log", "abusefilter-modify-restricted", "abusefilter-revert", "abusefilter-view-private", "abusefilter-log-private", "abusefilter-hidden-log", "abusefilter-hide-log", "abusefilter-modify-global", "moodbar-admin", "mf-uploadbutton", "vipsscaler-test", "ep-org", "ep-course", "ep-token", "ep-enroll", "ep-remstudent", "ep-online", "ep-campus", "ep-instructor", "ep-beonline", "ep-becampus", "ep-beinstructor", "ep-bereviewer", "ep-remreviewer", "ep-bulkdelorgs", "ep-bulkdelcourses", "ep-remarticle", "ep-addstudent", "flow-lock", "flow-create-board", "mwoauthproposeconsumer", "mwoauthupdateownconsumer", "mwoauthmanageconsumer", "mwoauthsuppress", "mwoauthviewsuppressed", "mwoauthviewprivate", "mwoauthmanagemygrants", "checkuser", "checkuser-log"]]
12
- param :prop, Params::List[Params::Enum["blockinfo", "groups", "implicitgroups", "rights", "editcount", "registration"]]
8
+ param :dir, Params::Enum[:ascending, :descending]
9
+ param :group, Params::List[Params::Enum[:bot, :sysop, :bureaucrat, :reviewer, :steward, :accountcreator, :import, :transwiki, :"ipblock-exempt", :oversight, :founder, :rollbacker, :autoreviewer, :researcher, :filemover, :checkuser, :templateeditor, :"massmessage-sender", :abusefilter, :epcoordinator, :eponline, :epcampus, :epinstructor, :suppress, :"flow-bot", :confirmed]]
10
+ param :excludegroup, Params::List[Params::Enum[:bot, :sysop, :bureaucrat, :reviewer, :steward, :accountcreator, :import, :transwiki, :"ipblock-exempt", :oversight, :founder, :rollbacker, :autoreviewer, :researcher, :filemover, :checkuser, :templateeditor, :"massmessage-sender", :abusefilter, :epcoordinator, :eponline, :epcampus, :epinstructor, :suppress, :"flow-bot", :confirmed]]
11
+ param :rights, Params::List[Params::Enum[:apihighlimits, :applychangetags, :autoconfirmed, :autopatrol, :bigdelete, :block, :blockemail, :bot, :browsearchive, :changetags, :createaccount, :createpage, :createtalk, :delete, :deletedhistory, :deletedtext, :deletelogentry, :deleterevision, :edit, :editcontentmodel, :editinterface, :editprotected, :editmyoptions, :editmyprivateinfo, :editmyusercss, :editmyuserjs, :editmywatchlist, :editsemiprotected, :editusercssjs, :editusercss, :edituserjs, :hideuser, :import, :importupload, :"ipblock-exempt", :managechangetags, :markbotedits, :mergehistory, :minoredit, :move, :movefile, :"move-categorypages", :"move-rootuserpages", :"move-subpages", :nominornewtalk, :noratelimit, :"override-export-depth", :pagelang, :passwordreset, :patrol, :patrolmarks, :protect, :proxyunbannable, :purge, :read, :reupload, :"reupload-own", :"reupload-shared", :rollback, :sendemail, :siteadmin, :suppressionlog, :suppressredirect, :suppressrevision, :unblockself, :undelete, :unwatchedpages, :upload, :upload_by_url, :userrights, :"userrights-interwiki", :viewmyprivateinfo, :viewmywatchlist, :viewsuppressed, :writeapi, :spamblacklistlog, :tboverride, :"tboverride-account", :titleblacklistlog, :"gadgets-edit", :"gadgets-definition-edit", :renameuser, :nuke, :massmessage, :"gather-hidelist", :usermerge, :review, :validate, :autoreview, :autoreviewrestore, :unreviewedpages, :movestable, :stablesettings, :templateeditor, :superprotect, :editeditorprotected, :"flow-edit-post", :"flow-suppress", :"flow-hide", :"flow-delete", :"transcode-reset", :"transcode-status", :globalblock, :"globalblock-whitelist", :"globalblock-exempt", :"securepoll-create-poll", :torunblocked, :skipcaptcha, :"override-antispoof", :"centralauth-merge", :"centralauth-unmerge", :"centralauth-lock", :"centralauth-oversight", :globalgrouppermissions, :globalgroupmembership, :"centralauth-autoaccount", :"centralauth-rename", :"centralauth-usermerge", :viewdeletedfile, :collectionsaveasuserpage, :collectionsaveascommunitypage, :"abusefilter-modify", :"abusefilter-log-detail", :"abusefilter-view", :"abusefilter-log", :"abusefilter-modify-restricted", :"abusefilter-revert", :"abusefilter-view-private", :"abusefilter-log-private", :"abusefilter-hidden-log", :"abusefilter-hide-log", :"abusefilter-modify-global", :"moodbar-admin", :"mf-uploadbutton", :"vipsscaler-test", :"ep-org", :"ep-course", :"ep-token", :"ep-enroll", :"ep-remstudent", :"ep-online", :"ep-campus", :"ep-instructor", :"ep-beonline", :"ep-becampus", :"ep-beinstructor", :"ep-bereviewer", :"ep-remreviewer", :"ep-bulkdelorgs", :"ep-bulkdelcourses", :"ep-remarticle", :"ep-addstudent", :"flow-lock", :"flow-create-board", :mwoauthproposeconsumer, :mwoauthupdateownconsumer, :mwoauthmanageconsumer, :mwoauthsuppress, :mwoauthviewsuppressed, :mwoauthviewprivate, :mwoauthmanagemygrants, :checkuser, :"checkuser-log"]]
12
+ param :prop, Params::List[Params::Enum[:blockinfo, :groups, :implicitgroups, :rights, :editcount, :registration]]
13
13
  param :limit, Params::IntegerOrMax
14
14
  param :witheditsonly, Params::Boolean
15
15
  param :activeusers, Params::Boolean
@@ -5,9 +5,9 @@ module MediaWiktory
5
5
  param :title, Params::String
6
6
  param :pageid, Params::Integer
7
7
  param :continue, Params::String
8
- param :namespace, Params::List[Params::Enum["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "100", "101", "108", "109", "118", "119", "2300", "2301", "2302", "2303", "710", "711", "446", "447", "2600", "828", "829"]]
9
- param :dir, Params::Enum["ascending", "descending"]
10
- param :filterredir, Params::Enum["all", "redirects", "nonredirects"]
8
+ param :namespace, Params::List[Params::Enum[:"0", :"1", :"2", :"3", :"4", :"5", :"6", :"7", :"8", :"9", :"10", :"11", :"12", :"13", :"14", :"15", :"100", :"101", :"108", :"109", :"118", :"119", :"2300", :"2301", :"2302", :"2303", :"710", :"711", :"446", :"447", :"2600", :"828", :"829"]]
9
+ param :dir, Params::Enum[:ascending, :descending]
10
+ param :filterredir, Params::Enum[:all, :redirects, :nonredirects]
11
11
  param :limit, Params::IntegerOrMax
12
12
  param :redirect, Params::Boolean
13
13
  end
@@ -4,13 +4,13 @@ module MediaWiktory
4
4
  prefix "bk"
5
5
  param :start, Params::Timestamp
6
6
  param :end, Params::Timestamp
7
- param :dir, Params::Enum["newer", "older"]
7
+ param :dir, Params::Enum[:newer, :older]
8
8
  param :ids, Params::List[Params::Integer]
9
9
  param :users, Params::List[Params::String]
10
10
  param :ip, Params::String
11
11
  param :limit, Params::IntegerOrMax
12
- param :prop, Params::List[Params::Enum["id", "user", "userid", "by", "byid", "timestamp", "expiry", "reason", "range", "flags"]]
13
- param :show, Params::List[Params::Enum["account", "!account", "temp", "!temp", "ip", "!ip", "range", "!range"]]
12
+ param :prop, Params::List[Params::Enum[:id, :user, :userid, :by, :byid, :timestamp, :expiry, :reason, :range, :flags]]
13
+ param :show, Params::List[Params::Enum[:account, :"!account", :temp, :"!temp", :ip, :"!ip", :range, :"!range"]]
14
14
  param :continue, Params::String
15
15
  end
16
16
  end
@@ -2,11 +2,11 @@ module MediaWiktory
2
2
  class Categories < MWModule
3
3
  symbol :categories
4
4
  prefix "cl"
5
- param :prop, Params::List[Params::Enum["sortkey", "timestamp", "hidden"]]
6
- param :show, Params::List[Params::Enum["hidden", "!hidden"]]
5
+ param :prop, Params::List[Params::Enum[:sortkey, :timestamp, :hidden]]
6
+ param :show, Params::List[Params::Enum[:hidden, :"!hidden"]]
7
7
  param :limit, Params::IntegerOrMax
8
8
  param :continue, Params::String
9
9
  param :categories, Params::List[Params::String]
10
- param :dir, Params::Enum["ascending", "descending"]
10
+ param :dir, Params::Enum[:ascending, :descending]
11
11
  end
12
12
  end