mediawiki-butt 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fc7e6ec26beb5a87466af0dd75da94fecac69de3
4
- data.tar.gz: 61a5969d08c863a80bf8d76f1a3d61c0a0da4d75
3
+ metadata.gz: 6f656d4e90befce4bfef592c187829a7d713f882
4
+ data.tar.gz: 53d0bdd862b94dd38e9f37c977e0da4b0df728ca
5
5
  SHA512:
6
- metadata.gz: 8096b955d2b02aa44a4fe267cca4ad1a280ab3374a8c0074acee9d102e7b2eef766704c5b3c5463f6b461d2f661ee7166645607f90dcc47d55f721eb739b8d04
7
- data.tar.gz: c28a5db8c069352687b896934aa072bfe13dd31d6795ddc21b38d3e24f596bfe7ac8c157d9629521e2afff415b521e9018778a02aa4f06ecd557de45e768939b
6
+ metadata.gz: f0bfa18ec1ab7865eb3100ff54e73a729805cf6f06e2cd51c7c04775bea35283ee3501960ea7b848727a7f4e39f95637e1a91096b64c12e92052e374406a5d79
7
+ data.tar.gz: 42615b44eb28fcca27d8b4ee274af367a5bf7a263a92ab3690b9d4838c8b8885522e1bd4eb0939eda12bb3393efda12f4203c026953ae2e3f8b64c7d942dc9df
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
  ## Version 2
3
+ ### Version 2.0.1
4
+ * Fix NoMethodError in `get_templates_in_page` when called for pages with no templates (#61)
5
+ * Fix NoMethodError in `get_all_links_in_page` when called for pages with no links
6
+ * Fix NoMethodError in `get_other_langs_of_page` when called for pages with only 1 language (#33)
7
+
3
8
  ### Version 2.0.0
4
9
  **Breaking changes!**
5
10
  * Logical reversal of the redirect param for move (#58)
@@ -222,7 +222,8 @@ module MediaWiki
222
222
  query(params) do |return_val, query|
223
223
  pageid = query['pages'].keys.find { |id| id != '-1' }
224
224
  return unless pageid
225
- return_val.concat(query['pages'][pageid]['templates'].collect { |template| template['title'] })
225
+ templates = query['pages'][pageid].fetch('templates', [])
226
+ return_val.concat(templates.collect { |template| template['title'] })
226
227
  end
227
228
  end
228
229
 
@@ -265,7 +266,8 @@ module MediaWiki
265
266
  query(params) do |return_val, query|
266
267
  pageid = query['pages'].keys.find { |id| id != '-1' }
267
268
  return unless pageid
268
- query['pages'][pageid]['langlinks'].each do |l|
269
+ langlinks = query['pages'][pageid].fetch('langlinks', [])
270
+ langlinks.each do |l|
269
271
  return_val[l['lang'].to_sym] = {
270
272
  url: l['url'],
271
273
  langname: l['langname'],
@@ -292,7 +294,8 @@ module MediaWiki
292
294
  query(params) do |return_val, query|
293
295
  pageid = query['pages'].keys.find { |id| id != '-1' }
294
296
  return unless pageid
295
- return_val.concat(query['pages'][pageid]['links'].collect { |l| l['title'] })
297
+ links = query['pages'][pageid].fetch('links', [])
298
+ return_val.concat(links.collect { |l| l['title'] })
296
299
  end
297
300
  end
298
301
 
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: 2.0.0
4
+ version: 2.0.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: 2017-06-21 00:00:00.000000000 Z
12
+ date: 2017-06-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httpclient