commons_upload 1.2.0 → 1.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7cf6b77dfebf2c478815002c91d3d22dd702c72ddbb3ce3f0a2e9e7b651d6bdc
4
- data.tar.gz: 381e5abd2ee8a7e609bbb76c68dcf828e7f6dea9fbfc7b2b2aeab161f20bb622
3
+ metadata.gz: fcf446d0a37edea9a1620bcd2acb63a10a579df016a254d50519e3180ba63c7a
4
+ data.tar.gz: 055d0085c5f40933571e7c5974dd0dbeb293e1544d5996b20006efa5998e7dc1
5
5
  SHA512:
6
- metadata.gz: 847d1fef07ef519001a2f4117dfc5c7700429afa6dd614f3a6393506073a3ada88ebe9276a31333bdc8de9201c20a110472c14fdb13b6f51b55ebd263444fa02
7
- data.tar.gz: cb9d1e1e7b13c9caecb70610ea67ac7a85477a66e2ba1c4fda53f6b28b6ab57610460cdfb24c5689a7f4a6cb0282679497f9ccb001f2303352d7e5d11a3abc16
6
+ metadata.gz: a1cb19d0047716111e181519ccb403fa10a2cca853fc6e1721e2c6526b8b47001abb256e4593ea75991518f1167e06baee77925d807fad4b40e165c22411f354
7
+ data.tar.gz: da80294e362097fda270069a147b04e8b56188505334b8112431a852be460b3d1127e8d993f9ad731a8780fb598428139e50458aef845256dc32ce05af95cc2e
data/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # commons_upload
2
2
 
3
+ [![Build Status](https://travis-ci.org/amire80/commons_upload.svg?branch=master)](https://travis-ci.org/amire80/commons_upload)
4
+ [![Gem Version](https://badge.fury.io/rb/commons_upload.svg)](https://badge.fury.io/rb/commons_upload)
5
+
3
6
  This is a gem for uploading images to Wikimedia Commons.
4
7
  It uses the MediaWiki API and the mediawiki-api Ruby gem.
5
8
  It is currently intended for uploading auto-translated
@@ -45,6 +48,3 @@ To run the upload, do
45
48
  3. Commit your changes (`git commit -am 'Add some feature'`)
46
49
  4. Push to the branch (`git push origin my-new-feature`)
47
50
  5. Create new Pull Request
48
-
49
- [![Build Status](https://travis-ci.org/amire80/commons_upload.svg?branch=master)](https://travis-ci.org/amire80/commons_upload)
50
- [![Gem Version](https://badge.fury.io/rb/commons_upload.svg)](https://badge.fury.io/rb/commons_upload)
@@ -45,8 +45,9 @@ LICENSE
45
45
  )
46
46
  return 'OK'
47
47
  rescue MediawikiApi::ApiError => mwerr
48
- raise mwerr if mwerr.code != 'fileexists-no-change'
49
- return 'OK (file already uploaded)'
48
+ return 'exists: fileexists-no-change' if mwerr.code == 'fileexists-no-change'
49
+ return 'exists: fileexists-shared-forbidden' if mwerr.code == 'fileexists-shared-forbidden'
50
+ return "error: #{mwerr}"
50
51
  ensure
51
52
  edit(file_name, client) # update page content
52
53
  sleep 5 # Restriction in bot speed: https://commons.wikimedia.org/wiki/Commons:Bots#Bot_speed
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CommonsUpload
4
- VERSION = '1.2.0'.freeze
4
+ VERSION = '1.2.1'.freeze
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: commons_upload
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vikas Yaligar
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2018-03-13 00:00:00.000000000 Z
13
+ date: 2018-03-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: mediawiki_api