mediawiki_api 0.8.1 → 0.9.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c7983b65785de6109edd0991f6e27a03c19d6bed4d4d666dfc172c1a4c0dd6b1
4
- data.tar.gz: 237e9d95810e7cbba9c07f5d50f16c3b5c08dd23741005abba538eb63335d02f
3
+ metadata.gz: b62379a3d8c9db42e6eef936b187f5e7ec8580d85470e06664aa77b61f84231a
4
+ data.tar.gz: 510e690f5ea8d2c9bd4ce6b494de54eb9b4ef055394b3cd28ff1808ee5887b74
5
5
  SHA512:
6
- metadata.gz: 2b0a4f757321496466e9cc3aff484cbeb37b0daf187ec058a8d42231cf306ccd5a33dc9dc0d1738dc1e98833a3e2891197eb71fc2a77f97b1adbe5bdbcdd5458
7
- data.tar.gz: 27a6dcf2d01a5f1a0cb62011eca87bcd92a64ae5df939100e68db101a9057418d888f7465179a8d583c8c11e13d8a6e3dd55c274cf70563144970d6c111f6657
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
- TargetRubyVersion: 2.5
5
+ SuggestExtensions: false
6
+ TargetRubyVersion: 2.6
3
7
  StyleGuideCopsOnly: true
8
+ NewCops: enable
4
9
 
5
- Metrics/LineLength:
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
- Style/DotPosition:
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.oauth_access_token("user_oauth_token") # INSTEAD of logging in, will make all actions as the user authenticated via OAuth
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
@@ -1,6 +1,7 @@
1
1
  require 'faraday'
2
- require 'faraday_middleware'
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.use FaradayMiddleware::FollowRedirects
28
+ faraday.response :follow_redirects
28
29
  faraday.adapter Faraday.default_adapter
29
30
  end
30
31
 
@@ -89,7 +89,7 @@ module MediawikiApi
89
89
  if !obj.is_a?(Hash) || env.nil? || env.empty? || !obj.include?(env.first)
90
90
  obj
91
91
  else
92
- open_envelope(obj[env.first], env[1..-1])
92
+ open_envelope(obj[env.first], env[1..])
93
93
  end
94
94
  end
95
95
 
@@ -1,4 +1,4 @@
1
1
  # MediaWiki Ruby API
2
2
  module MediawikiApi
3
- VERSION = '0.8.1'
3
+ VERSION = '0.9.0'
4
4
  end
@@ -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.5.0'
26
+ spec.required_ruby_version = '>= 2.6.0'
27
27
 
28
- spec.add_runtime_dependency 'faraday', '~> 1'
29
- # These dependencies will float to whatever `faraday` resolves to
30
- # and are not needed for faraday 2 when we migrate to 2.X
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 'faraday_middleware'
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.8.1
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: 2023-10-29 00:00:00.000000000 Z
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: '1'
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: '1'
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: faraday_middleware
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.5.0
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.4.21
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.