mediawiki-butt 0.10.0 → 0.10.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/mediawiki/query/lists/log/protect.rb +107 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ddfec6f472aa4fe3d28f9f2d8524caa2e0b6eb4c
|
4
|
+
data.tar.gz: be269251011a8d5b94806bfab13e8e7450813bd9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b22a8038e2dee7a8612ed9e2695b370a71e00dfd507799cfe360fa28d748395868c8bd7786826a3cb6594b4a82f292b76a66045fe2a807d9e2b8965975ac7260
|
7
|
+
data.tar.gz: 1c87b00f96917ca054b624883cd24d482756976d2932b6af63a75d81e05f2407865da74e6be148b4631734323a3a10a3c93ebb8fbc3e0dd252198326572d1467
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Changelog
|
2
2
|
## Version 0
|
3
|
+
### Version 0.10.1
|
4
|
+
* Add the accidentally forgotten protect.rb file to the list of files for the gemspec.
|
5
|
+
|
3
6
|
### Version 0.10.0
|
4
7
|
* Remove all incorrectly splatted method arguments, so account creation reasons and edit summaries work now (#12).
|
5
8
|
* Support a bunch of more Lists (#17). All of the old methods still exist in various submodules. The new methods are:
|
@@ -0,0 +1,107 @@
|
|
1
|
+
module MediaWiki
|
2
|
+
module Query
|
3
|
+
module Lists
|
4
|
+
module Log
|
5
|
+
module Protect
|
6
|
+
# Gets protect/modify logs.
|
7
|
+
# @param user [String] See {MediaWiki::Query::Lists::Log#get_log}
|
8
|
+
# @param title [String] See {MediaWiki::Query::Lists::Log#get_log}
|
9
|
+
# @param start [DateTime] See {MediaWiki::Query::Lists::Log#get_log}
|
10
|
+
# @param stop [DateTime] See {MediaWiki::Query::Lists::Log#get_log}
|
11
|
+
# @param limit [Int] See {MediaWiki::Query::Lists::Log#get_log}
|
12
|
+
# @see {MediaWiki::Query::Lists::Log#get_log}
|
13
|
+
# @see https://www.mediawiki.org/wiki/API:Logevents MediaWiki
|
14
|
+
# Logevents API Docs
|
15
|
+
# @since 0.10.0
|
16
|
+
# @return [Array<Hash>] The events, containing the following keys: id,
|
17
|
+
# title, description, user, comment, timestamp, details.
|
18
|
+
def get_modify_protection_log(user = nil, title = nil, start = nil,
|
19
|
+
stop = nil, limit = 500)
|
20
|
+
response = get_log('protect/modify', user, title, start, stop,
|
21
|
+
limit)
|
22
|
+
|
23
|
+
ret = []
|
24
|
+
response['query']['logevents'].each do |log|
|
25
|
+
ret << get_protect(log)
|
26
|
+
end
|
27
|
+
|
28
|
+
ret
|
29
|
+
end
|
30
|
+
|
31
|
+
# Gets protect/move_prot logs.
|
32
|
+
# @param user [String] See {MediaWiki::Query::Lists::Log#get_log}
|
33
|
+
# @param title [String] See {MediaWiki::Query::Lists::Log#get_log}
|
34
|
+
# @param start [DateTime] See {MediaWiki::Query::Lists::Log#get_log}
|
35
|
+
# @param stop [DateTime] See {MediaWiki::Query::Lists::Log#get_log}
|
36
|
+
# @param limit [Int] See {MediaWiki::Query::Lists::Log#get_log}
|
37
|
+
# @see {MediaWiki::Query::Lists::Log#get_log}
|
38
|
+
# @see https://www.mediawiki.org/wiki/API:Logevents MediaWiki
|
39
|
+
# Logevents API Docs
|
40
|
+
# @since 0.10.0
|
41
|
+
# @return [Array<Hash>] The events, containing the following keys: id,
|
42
|
+
# title, old_title, user, comment, timestamp.
|
43
|
+
def get_move_protected_log(user = nil, title = nil, start = nil,
|
44
|
+
stop = nil, limit = 500)
|
45
|
+
resp = get_log('protect/move_prot', user, title, start, stop, limit)
|
46
|
+
|
47
|
+
ret = []
|
48
|
+
resp['query']['logevents'].each do |log|
|
49
|
+
ret << get_protectmoveprot(log)
|
50
|
+
end
|
51
|
+
|
52
|
+
ret
|
53
|
+
end
|
54
|
+
|
55
|
+
# Gets protect/protect logs.
|
56
|
+
# @param user [String] See {MediaWiki::Query::Lists::Log#get_log}
|
57
|
+
# @param title [String] See {MediaWiki::Query::Lists::Log#get_log}
|
58
|
+
# @param start [DateTime] See {MediaWiki::Query::Lists::Log#get_log}
|
59
|
+
# @param stop [DateTime] See {MediaWiki::Query::Lists::Log#get_log}
|
60
|
+
# @param limit [Int] See {MediaWiki::Query::Lists::Log#get_log}
|
61
|
+
# @see {MediaWiki::Query::Lists::Log#get_log}
|
62
|
+
# @see https://www.mediawiki.org/wiki/API:Logevents MediaWiki
|
63
|
+
# Logevents API Docs
|
64
|
+
# @since 0.10.0
|
65
|
+
# @return [Array<Hash>] The events, containing the following keys: id,
|
66
|
+
# title, description, user, comment, timestamp, details.
|
67
|
+
def get_protect_log(user = nil, title = nil, start = nil, stop = nil,
|
68
|
+
limit = 500)
|
69
|
+
response = get_log('protect/protect', user, title, start, stop,
|
70
|
+
limit)
|
71
|
+
|
72
|
+
ret = []
|
73
|
+
response['query']['logevents'].each do |log|
|
74
|
+
ret << get_protect(log)
|
75
|
+
end
|
76
|
+
|
77
|
+
ret
|
78
|
+
end
|
79
|
+
|
80
|
+
# Gets protect/unprotect logs.
|
81
|
+
# @param user [String] See {MediaWiki::Query::Lists::Log#get_log}
|
82
|
+
# @param title [String] See {MediaWiki::Query::Lists::Log#get_log}
|
83
|
+
# @param start [DateTime] See {MediaWiki::Query::Lists::Log#get_log}
|
84
|
+
# @param stop [DateTime] See {MediaWiki::Query::Lists::Log#get_log}
|
85
|
+
# @param limit [Int] See {MediaWiki::Query::Lists::Log#get_log}
|
86
|
+
# @see {MediaWiki::Query::Lists::Log#get_log}
|
87
|
+
# @see https://www.mediawiki.org/wiki/API:Logevents MediaWiki
|
88
|
+
# Logevents API Docs
|
89
|
+
# @since 0.10.0
|
90
|
+
# @return [Array<Hash>] The events, containing the following keys: id,
|
91
|
+
# title, user, comment, timestamp.
|
92
|
+
def get_unprotect_log(user = nil, title = nil, start = nil,
|
93
|
+
stop = nil, limit = 500)
|
94
|
+
resp = get_log('protect/unprotect', user, title, start, stop, limit)
|
95
|
+
|
96
|
+
ret = []
|
97
|
+
resp['query']['logevents'].each do |log|
|
98
|
+
ret << get_protectunprotect(log)
|
99
|
+
end
|
100
|
+
|
101
|
+
ret
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mediawiki-butt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eli Foster
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2016-01-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httpclient
|
@@ -53,6 +53,7 @@ files:
|
|
53
53
|
- lib/mediawiki/query/lists/log/move.rb
|
54
54
|
- lib/mediawiki/query/lists/log/newusers.rb
|
55
55
|
- lib/mediawiki/query/lists/log/patrol.rb
|
56
|
+
- lib/mediawiki/query/lists/log/protect.rb
|
56
57
|
- lib/mediawiki/query/lists/log/rights.rb
|
57
58
|
- lib/mediawiki/query/lists/log/upload.rb
|
58
59
|
- lib/mediawiki/query/lists/miscellaneous.rb
|