mediawiktory 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -0
- data/CONTRIBUTING.md +16 -0
- data/LICENSE.txt +22 -0
- data/README.md +5 -5
- data/examples/query_generator.rb +1 -1
- data/lib/mediawiktory.rb +2 -1
- data/lib/mediawiktory/action.rb +9 -0
- data/lib/mediawiktory/client.rb +27 -2
- data/lib/mediawiktory/generated/abusefilters.rb +3 -3
- data/lib/mediawiktory/generated/abuselog.rb +2 -2
- data/lib/mediawiktory/generated/allcategories.rb +2 -2
- data/lib/mediawiktory/generated/alldeletedrevisions.rb +4 -4
- data/lib/mediawiktory/generated/allfileusages.rb +2 -2
- data/lib/mediawiktory/generated/allimages.rb +4 -4
- data/lib/mediawiktory/generated/alllinks.rb +3 -3
- data/lib/mediawiktory/generated/allmessages.rb +2 -2
- data/lib/mediawiktory/generated/allpages.rb +8 -8
- data/lib/mediawiktory/generated/allredirects.rb +3 -3
- data/lib/mediawiktory/generated/alltransclusions.rb +3 -3
- data/lib/mediawiktory/generated/allusers.rb +5 -5
- data/lib/mediawiktory/generated/backlinks.rb +3 -3
- data/lib/mediawiktory/generated/blocks.rb +3 -3
- data/lib/mediawiktory/generated/categories.rb +3 -3
- data/lib/mediawiktory/generated/categorymembers.rb +5 -5
- data/lib/mediawiktory/generated/checktoken.rb +1 -1
- data/lib/mediawiktory/generated/checkuser.rb +1 -1
- data/lib/mediawiktory/generated/checkuserlog.rb +1 -1
- data/lib/mediawiktory/generated/close-open-topic.rb +1 -1
- data/lib/mediawiktory/generated/contenttranslation.rb +1 -1
- data/lib/mediawiktory/generated/contenttranslationlangtrend.rb +1 -1
- data/lib/mediawiktory/generated/contributors.rb +4 -4
- data/lib/mediawiktory/generated/coordinates.rb +2 -2
- data/lib/mediawiktory/generated/cxpublish.rb +1 -1
- data/lib/mediawiktory/generated/delete.rb +1 -1
- data/lib/mediawiktory/generated/deletedrevisions.rb +3 -3
- data/lib/mediawiktory/generated/deletedrevs.rb +3 -3
- data/lib/mediawiktory/generated/deleteeducation.rb +1 -1
- data/lib/mediawiktory/generated/duplicatefiles.rb +1 -1
- data/lib/mediawiktory/generated/echomarkread.rb +1 -1
- data/lib/mediawiktory/generated/echomarkseen.rb +1 -1
- data/lib/mediawiktory/generated/edit-header.rb +1 -1
- data/lib/mediawiktory/generated/edit-post.rb +1 -1
- data/lib/mediawiktory/generated/edit-topic-summary.rb +1 -1
- data/lib/mediawiktory/generated/edit.rb +4 -4
- data/lib/mediawiktory/generated/editlist.rb +2 -2
- data/lib/mediawiktory/generated/embeddedin.rb +3 -3
- data/lib/mediawiktory/generated/enlist.rb +2 -2
- data/lib/mediawiktory/generated/expandtemplates.rb +1 -1
- data/lib/mediawiktory/generated/extlinks.rb +1 -1
- data/lib/mediawiktory/generated/extracts.rb +1 -1
- data/lib/mediawiktory/generated/exturlusage.rb +3 -3
- data/lib/mediawiktory/generated/featuredfeed.rb +2 -2
- data/lib/mediawiktory/generated/feedcontributions.rb +3 -3
- data/lib/mediawiktory/generated/feedrecentchanges.rb +2 -2
- data/lib/mediawiktory/generated/feedwatchlist.rb +3 -3
- data/lib/mediawiktory/generated/filearchive.rb +2 -2
- data/lib/mediawiktory/generated/filerepoinfo.rb +1 -1
- data/lib/mediawiktory/generated/fileusage.rb +3 -3
- data/lib/mediawiktory/generated/flow-parsoid-utils.rb +2 -2
- data/lib/mediawiktory/generated/gadgetcategories.rb +1 -1
- data/lib/mediawiktory/generated/gadgets.rb +1 -1
- data/lib/mediawiktory/generated/geosearch.rb +4 -4
- data/lib/mediawiktory/generated/globalallusers.rb +4 -4
- data/lib/mediawiktory/generated/globalblocks.rb +2 -2
- data/lib/mediawiktory/generated/globalgroups.rb +1 -1
- data/lib/mediawiktory/generated/globalusage.rb +1 -1
- data/lib/mediawiktory/generated/globaluserinfo.rb +1 -1
- data/lib/mediawiktory/generated/globaluserrights.rb +2 -2
- data/lib/mediawiktory/generated/imageinfo.rb +1 -1
- data/lib/mediawiktory/generated/images.rb +1 -1
- data/lib/mediawiktory/generated/imageusage.rb +3 -3
- data/lib/mediawiktory/generated/import.rb +2 -2
- data/lib/mediawiktory/generated/info.rb +2 -2
- data/lib/mediawiktory/generated/iwbacklinks.rb +2 -2
- data/lib/mediawiktory/generated/iwlinks.rb +2 -2
- data/lib/mediawiktory/generated/jsonconfig.rb +1 -1
- data/lib/mediawiktory/generated/langbacklinks.rb +2 -2
- data/lib/mediawiktory/generated/langlinks.rb +2 -2
- data/lib/mediawiktory/generated/links.rb +2 -2
- data/lib/mediawiktory/generated/linkshere.rb +3 -3
- data/lib/mediawiktory/generated/listpages.rb +3 -3
- data/lib/mediawiktory/generated/lists.rb +2 -2
- data/lib/mediawiktory/generated/liststudents.rb +1 -1
- data/lib/mediawiktory/generated/lock-topic.rb +1 -1
- data/lib/mediawiktory/generated/logevents.rb +5 -5
- data/lib/mediawiktory/generated/managetags.rb +1 -1
- data/lib/mediawiktory/generated/mobileview.rb +3 -3
- data/lib/mediawiktory/generated/moderate-post.rb +1 -1
- data/lib/mediawiktory/generated/moderate-topic.rb +1 -1
- data/lib/mediawiktory/generated/move.rb +1 -1
- data/lib/mediawiktory/generated/new-topic.rb +1 -1
- data/lib/mediawiktory/generated/notifications.rb +3 -3
- data/lib/mediawiktory/generated/oldreviewedpages.rb +4 -4
- data/lib/mediawiktory/generated/opensearch.rb +3 -3
- data/lib/mediawiktory/generated/options.rb +1 -1
- data/lib/mediawiktory/generated/pageimages.rb +1 -1
- data/lib/mediawiktory/generated/pageswithprop.rb +2 -2
- data/lib/mediawiktory/generated/pageterms.rb +1 -1
- data/lib/mediawiktory/generated/pagetriageaction.rb +1 -1
- data/lib/mediawiktory/generated/paraminfo.rb +3 -3
- data/lib/mediawiktory/generated/parse.rb +3 -3
- data/lib/mediawiktory/generated/prefixsearch.rb +1 -1
- data/lib/mediawiktory/generated/protect.rb +1 -1
- data/lib/mediawiktory/generated/protectedtitles.rb +4 -4
- data/lib/mediawiktory/generated/querypage.rb +1 -1
- data/lib/mediawiktory/generated/random.rb +2 -2
- data/lib/mediawiktory/generated/recentchanges.rb +6 -6
- data/lib/mediawiktory/generated/redirects.rb +3 -3
- data/lib/mediawiktory/generated/refresheducation.rb +1 -1
- data/lib/mediawiktory/generated/reply.rb +1 -1
- data/lib/mediawiktory/generated/reviewactivity.rb +1 -1
- data/lib/mediawiktory/generated/revisiondelete.rb +4 -4
- data/lib/mediawiktory/generated/revisions.rb +4 -4
- data/lib/mediawiktory/generated/rollback.rb +1 -1
- data/lib/mediawiktory/generated/search.rb +4 -4
- data/lib/mediawiktory/generated/setglobalaccountstatus.rb +2 -2
- data/lib/mediawiktory/generated/siteinfo.rb +2 -2
- data/lib/mediawiktory/generated/sitematrix.rb +4 -4
- data/lib/mediawiktory/generated/stabilize.rb +1 -1
- data/lib/mediawiktory/generated/stashedit.rb +2 -2
- data/lib/mediawiktory/generated/stashimageinfo.rb +1 -1
- data/lib/mediawiktory/generated/strikevote.rb +1 -1
- data/lib/mediawiktory/generated/tag.rb +1 -1
- data/lib/mediawiktory/generated/tags.rb +1 -1
- data/lib/mediawiktory/generated/templatedata.rb +1 -1
- data/lib/mediawiktory/generated/templates.rb +2 -2
- data/lib/mediawiktory/generated/titleblacklist.rb +1 -1
- data/lib/mediawiktory/generated/tokens.rb +1 -1
- data/lib/mediawiktory/generated/transcludedin.rb +3 -3
- data/lib/mediawiktory/generated/undelete.rb +1 -1
- data/lib/mediawiktory/generated/upload.rb +1 -1
- data/lib/mediawiktory/generated/usercontribs.rb +4 -4
- data/lib/mediawiktory/generated/userinfo.rb +1 -1
- data/lib/mediawiktory/generated/userrights.rb +2 -2
- data/lib/mediawiktory/generated/users.rb +2 -2
- data/lib/mediawiktory/generated/videoinfo.rb +1 -1
- data/lib/mediawiktory/generated/view-header.rb +1 -1
- data/lib/mediawiktory/generated/view-post-history.rb +1 -1
- data/lib/mediawiktory/generated/view-post.rb +1 -1
- data/lib/mediawiktory/generated/view-topic-history.rb +1 -1
- data/lib/mediawiktory/generated/view-topic-summary.rb +1 -1
- data/lib/mediawiktory/generated/view-topic.rb +1 -1
- data/lib/mediawiktory/generated/view-topiclist.rb +3 -3
- data/lib/mediawiktory/generated/visualeditor.rb +2 -2
- data/lib/mediawiktory/generated/watchlist.rb +5 -5
- data/lib/mediawiktory/generated/watchlistraw.rb +4 -4
- data/lib/mediawiktory/generated/wikibase.rb +1 -1
- data/lib/mediawiktory/generated/wikisets.rb +1 -1
- data/lib/mediawiktory/generated/zeroconfig.rb +1 -1
- data/lib/mediawiktory/mw_module.rb +6 -2
- data/lib/mediawiktory/page.rb +46 -0
- data/lib/mediawiktory/query.rb +21 -23
- data/lib/mediawiktory/version.rb +4 -1
- data/script/lib/parameter.rb +2 -5
- metadata +6 -4
- data/Gemfile.lock +0 -63
- data/lib/mediawiktory/array_with_keys.rb +0 -41
@@ -1,41 +0,0 @@
|
|
1
|
-
module MediaWiktory
|
2
|
-
# FIXME: maybe, its a wrongdoing
|
3
|
-
# But for now, I cant invent wiser structure for MediaWiki's
|
4
|
-
# {'numericpageid' => {page}} hash
|
5
|
-
#
|
6
|
-
# Having it as a hash complicates code (most time you just need a list
|
7
|
-
# of pages), dropping keys completely and using only values seem to
|
8
|
-
# have its own drawbacks.
|
9
|
-
#
|
10
|
-
class ArrayWithKeys < Array
|
11
|
-
def self.from_hash(hash)
|
12
|
-
new(hash.values, hash.keys)
|
13
|
-
end
|
14
|
-
|
15
|
-
attr_reader :keys
|
16
|
-
|
17
|
-
def initialize(values, keys)
|
18
|
-
super(values)
|
19
|
-
@keys = keys
|
20
|
-
end
|
21
|
-
|
22
|
-
def [](key)
|
23
|
-
case key
|
24
|
-
when Fixnum
|
25
|
-
super
|
26
|
-
else
|
27
|
-
idx = @keys.index(key)
|
28
|
-
idx && super(idx)
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
def push(value, key)
|
33
|
-
super(value)
|
34
|
-
@keys.push(key)
|
35
|
-
end
|
36
|
-
|
37
|
-
def to_h
|
38
|
-
keys.zip(self).to_h
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|