mediawiki_api 0.8.1 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +9 -4
- data/README.md +5 -1
- data/lib/mediawiki_api/client.rb +3 -2
- data/lib/mediawiki_api/response.rb +1 -1
- data/lib/mediawiki_api/version.rb +1 -1
- data/mediawiki_api.gemspec +5 -5
- metadata +37 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b62379a3d8c9db42e6eef936b187f5e7ec8580d85470e06664aa77b61f84231a
|
4
|
+
data.tar.gz: 510e690f5ea8d2c9bd4ce6b494de54eb9b4ef055394b3cd28ff1808ee5887b74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e9d1d43095b11d1741dacb0d277961f7880ac31ae2979a09acbe187969b69083ff8b99d929c0deff1e8f2eaf4ee1171ecd65b63438ee766cd77252584fa8f3f
|
7
|
+
data.tar.gz: 698a6310751aa185f48da78e4eb0c18453c1fef663186a9829a756497878e341f37cd9869bd9861260c5336d5a61f4f966830ff55c1dabb34c14db95023bb503
|
data/.rubocop.yml
CHANGED
@@ -1,8 +1,13 @@
|
|
1
|
+
# require: rubocop-rspec # make specs compliant one day
|
2
|
+
# until then:
|
3
|
+
|
1
4
|
AllCops:
|
2
|
-
|
5
|
+
SuggestExtensions: false
|
6
|
+
TargetRubyVersion: 2.6
|
3
7
|
StyleGuideCopsOnly: true
|
8
|
+
NewCops: enable
|
4
9
|
|
5
|
-
|
10
|
+
Layout/LineLength:
|
6
11
|
Max: 100
|
7
12
|
|
8
13
|
Metrics/MethodLength:
|
@@ -11,7 +16,7 @@ Metrics/MethodLength:
|
|
11
16
|
Style/Alias:
|
12
17
|
Enabled: false
|
13
18
|
|
14
|
-
|
19
|
+
Layout/DotPosition:
|
15
20
|
EnforcedStyle: trailing
|
16
21
|
|
17
22
|
Style/SignalException:
|
@@ -24,5 +29,5 @@ Style/TrivialAccessors:
|
|
24
29
|
ExactNameMatch: true
|
25
30
|
|
26
31
|
# See https://github.com/bbatsov/rubocop/issues/4637
|
27
|
-
SpaceAroundOperators:
|
32
|
+
Layout/SpaceAroundOperators:
|
28
33
|
Enabled: false
|
data/README.md
CHANGED
@@ -26,7 +26,7 @@ require "mediawiki_api"
|
|
26
26
|
|
27
27
|
client = MediawikiApi::Client.new "http://127.0.0.1:8080/w/api.php"
|
28
28
|
client.log_in "username", "password" # default Vagrant username and password are "Admin", "vagrant"
|
29
|
-
client.
|
29
|
+
client.set_oauth_access_token("user_oauth_token") # INSTEAD of logging in, will make all actions as the user authenticated via OAuth
|
30
30
|
client.create_account "username", "password" # will not work on wikis that require CAPTCHA, like Wikipedia
|
31
31
|
client.create_page "title", "content"
|
32
32
|
client.get_wikitext "title"
|
@@ -66,6 +66,10 @@ See https://www.mediawiki.org/wiki/Gerrit
|
|
66
66
|
|
67
67
|
## Release notes
|
68
68
|
|
69
|
+
### 0.9.0 2024-05-06
|
70
|
+
- Upgraded underlying Faraday gem to 2.x (> 2.7.0)
|
71
|
+
- Updated required Ruby to 2.6.x
|
72
|
+
|
69
73
|
### 0.8.0 2023-10-26
|
70
74
|
- Add `oauth_access_token`, allowing authenticated actions on behalf of users via [Wikimedia's OAuth service](https://www.mediawiki.org/wiki/OAuth/For_Developers). Obtaining the access token is up to this gem's user. In Ruby, one can use the `[oauth2](https://gitlab.com/oauth-xx/oauth2/)` gem. A working example can be seen in the source code of [the Luthor tool](https://gitlab.wikimedia.org/toolforge-repos/luthor/-/blob/master/app/controllers/usage_controller.rb).
|
71
75
|
- New maintainer: @abartov
|
data/lib/mediawiki_api/client.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'faraday'
|
2
|
-
require '
|
2
|
+
require 'faraday/multipart'
|
3
3
|
require 'faraday-cookie_jar'
|
4
|
+
require 'faraday/follow_redirects'
|
4
5
|
require 'json'
|
5
6
|
|
6
7
|
require 'mediawiki_api/exceptions'
|
@@ -24,7 +25,7 @@ module MediawikiApi
|
|
24
25
|
faraday.request :url_encoded
|
25
26
|
faraday.response :logger if log
|
26
27
|
faraday.use :cookie_jar, jar: @cookies
|
27
|
-
faraday.
|
28
|
+
faraday.response :follow_redirects
|
28
29
|
faraday.adapter Faraday.default_adapter
|
29
30
|
end
|
30
31
|
|
data/mediawiki_api.gemspec
CHANGED
@@ -23,13 +23,13 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.test_files = spec.files.grep(/^(test|spec|features)/)
|
24
24
|
spec.require_paths = ['lib']
|
25
25
|
|
26
|
-
spec.required_ruby_version = '>= 2.
|
26
|
+
spec.required_ruby_version = '>= 2.6.0'
|
27
27
|
|
28
|
-
spec.add_runtime_dependency 'faraday', '
|
29
|
-
|
30
|
-
|
28
|
+
spec.add_runtime_dependency 'faraday', '>= 2.7.0'
|
29
|
+
spec.add_runtime_dependency 'faraday-multipart'
|
30
|
+
spec.add_runtime_dependency 'faraday-retry'
|
31
31
|
spec.add_runtime_dependency 'faraday-cookie_jar'
|
32
|
-
spec.add_runtime_dependency '
|
32
|
+
spec.add_runtime_dependency 'faraday-follow_redirects'
|
33
33
|
|
34
34
|
# Most developer dependencies can float to latest, but stick to RSpec 3
|
35
35
|
# since that would likely introduce breaking changes (bundler, rubocop
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mediawiki_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Amir Aharoni
|
@@ -14,22 +14,50 @@ authors:
|
|
14
14
|
autorequire:
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
|
-
date:
|
17
|
+
date: 2024-05-07 00:00:00.000000000 Z
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
20
20
|
name: faraday
|
21
21
|
requirement: !ruby/object:Gem::Requirement
|
22
22
|
requirements:
|
23
|
-
- - "
|
23
|
+
- - ">="
|
24
24
|
- !ruby/object:Gem::Version
|
25
|
-
version:
|
25
|
+
version: 2.7.0
|
26
26
|
type: :runtime
|
27
27
|
prerelease: false
|
28
28
|
version_requirements: !ruby/object:Gem::Requirement
|
29
29
|
requirements:
|
30
|
-
- - "
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 2.7.0
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: faraday-multipart
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
40
|
+
type: :runtime
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: faraday-retry
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
31
52
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
53
|
+
version: '0'
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
33
61
|
- !ruby/object:Gem::Dependency
|
34
62
|
name: faraday-cookie_jar
|
35
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -45,7 +73,7 @@ dependencies:
|
|
45
73
|
- !ruby/object:Gem::Version
|
46
74
|
version: '0'
|
47
75
|
- !ruby/object:Gem::Dependency
|
48
|
-
name:
|
76
|
+
name: faraday-follow_redirects
|
49
77
|
requirement: !ruby/object:Gem::Requirement
|
50
78
|
requirements:
|
51
79
|
- - ">="
|
@@ -230,14 +258,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
230
258
|
requirements:
|
231
259
|
- - ">="
|
232
260
|
- !ruby/object:Gem::Version
|
233
|
-
version: 2.
|
261
|
+
version: 2.6.0
|
234
262
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
235
263
|
requirements:
|
236
264
|
- - ">="
|
237
265
|
- !ruby/object:Gem::Version
|
238
266
|
version: '0'
|
239
267
|
requirements: []
|
240
|
-
rubygems_version: 3.
|
268
|
+
rubygems_version: 3.5.7
|
241
269
|
signing_key:
|
242
270
|
specification_version: 4
|
243
271
|
summary: A library for interacting with MediaWiki API from Ruby.
|