mediawiki-butt 0.10.2 → 0.11.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
  SHA1:
3
- metadata.gz: c6cd0d3fee9b80b873fbedeed12ccff083b43cc1
4
- data.tar.gz: 4435690ca4f67a835b4614ce3227b39465508011
3
+ metadata.gz: d76590d42cd5826b880c92e0d98bbcc2fe43bfd3
4
+ data.tar.gz: 38c94f748647bf2a34854275e5f6fd55bc434020
5
5
  SHA512:
6
- metadata.gz: e2b1d77056b00567590ab6ab33b625aac183698a9754a9bdc1672af8eb7804a11e99119d0f88a74c2e516b2bff155c2116499eab8dd89eee81e5cb63fba6cf79
7
- data.tar.gz: 9eaadab494bf91434b38aae43a4edcd39a8901d7e7229577de383c4bb6ae5af0fe75167a54a96cb66c81e03e2ce0dba22b9fd26928ee2e279680df04ffd35402
6
+ metadata.gz: 9aef8ba17d16a6fa67a6a2c617df2336bd40359d8d03df9bc15d0b2bc49c97eae87538f3e092d1c93ebfc43aa108e6257b9524e74c85a0fa9bd8568d01422eaf
7
+ data.tar.gz: a45cb96bffa3a92d81ef765649349fc5142f577f6a1bbca3309b78f3b0d9078ed9f56b52eaadcbaebaf82df7eff1e4c4cc5e658abfd7ca637d6e819115c3acf4
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
  ## Version 0
3
+ ### Version 0.11.0
4
+ * Fix get_mostcategories_page typo (Mostca**c**tegories) (#24).
5
+ * Significant rewrite of the README, arguably the most important part of this version.
6
+ * New Utils module for replicating some of MediaWiki's utilities. Right now this only includes the `#encode_url` method, a Ruby version of the JavaScript method `mw.util.rawurlencode` (#21).
7
+ * Recent Changes responses are no longer printed on every request (#19).
8
+
3
9
  ### Version 0.10.2
4
10
  * Update to Ruby 2.3 and HTTPClient 2.7
5
11
  * All values in Constants, including the keys and values in the NAMESPACES constant, are now frozen objects.
@@ -45,7 +45,7 @@ module MediaWiki
45
45
  # @since 0.10.0
46
46
  # @see #get_querypage
47
47
  def get_mostcategories_page(limit = 500)
48
- get_querypage('Mostcactegories', limit)
48
+ get_querypage('Mostcategories', limit)
49
49
  end
50
50
 
51
51
  # @since 0.10.0
@@ -41,7 +41,6 @@ module MediaWiki
41
41
 
42
42
  response = post(params)
43
43
  ret = []
44
- p response
45
44
  response['query']['recentchanges'].each do |change|
46
45
  old_length = change['oldlen']
47
46
  new_length = change['newlen']
@@ -0,0 +1,19 @@
1
+ module MediaWiki
2
+ # Util class similar to MediaWiki's non-API util methods. This is not required automatically by
3
+ # requiring 'mediawiki-butt' or 'mediawiki/butt'; you must require it explicitly.
4
+ class Utils
5
+ # Encodes the URL like mw.util.rawurlencode JS.
6
+ # @todo Perhaps write a StringUtility method for better gsubs?
7
+ # @param str [String] The string to replace (typically a page title).
8
+ # @return [String] The encoded string.
9
+ def self.encode_url(str)
10
+ str.gsub!(/!/,'%21') || str
11
+ str.gsub!(/'/,'%27') || str
12
+ str.gsub!(/\(/,'%28') || str
13
+ str.gsub!(/\)/,'%29') || str
14
+ str.gsub!(/\*/,'%2A') || str
15
+ str.gsub!(/~/,'%7E') || str
16
+ return str
17
+ end
18
+ end
19
+ 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.2
4
+ version: 0.11.0
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: 2016-01-23 00:00:00.000000000 Z
12
+ date: 2016-03-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httpclient
@@ -70,6 +70,7 @@ files:
70
70
  - lib/mediawiki/query/properties/pages.rb
71
71
  - lib/mediawiki/query/properties/properties.rb
72
72
  - lib/mediawiki/query/query.rb
73
+ - lib/mediawiki/utils.rb
73
74
  homepage: https://github.com/ftb-gamepedia/mediawiki-butt-ruby
74
75
  licenses:
75
76
  - CC-BY-NC-ND-4.0