commons_upload 0.0.2 → 0.0.3

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: 49f54cf8e7563157f096ce7534eae3f9ff9cd6ef
4
- data.tar.gz: 3ddf3d8c44c68e7ec03d2699878f5d9b6a274470
3
+ metadata.gz: ec4c4489abecc8ff21164e7dbe44b616bca91f15
4
+ data.tar.gz: 286fbc7b885b0477bdd56c253836f1177289d750
5
5
  SHA512:
6
- metadata.gz: 5e83ca21a0fd9979a619c2c29446de3d1149304489f67e6fe0ef7ae994ac26a74366c3e5c1f08faba7e71eb74892e0b691e6a8c2c1fd674f8bc5efc0f752c858
7
- data.tar.gz: a337d2448e8975d0dbc45258a5a5a2598d28ad10c9a548dc37ad01b800126e1e9cf621fcec3e942c6cd8808ca2534ad538fbe9a991f403d72514da31e0a7aa52
6
+ metadata.gz: 0c24fe067e0e7a51f74bc37a969c6d3d3722e13cf4d421f8a6c7db23036eb516d9dd67a099a31e825c3e64490cac44ba0c70d460e27f4edbe3d90aaddfecebf8
7
+ data.tar.gz: 111b64c829ac4f7b1bc5cc6bf472ef569a9baace915c67da5c53b92eea6f7b3f8c52ac4b7e9dfca97774f5e7375b054603c875bd86d986c09d72284d6ac1b938
@@ -1,9 +1,14 @@
1
1
  require 'commons_upload/version'
2
2
 
3
3
  module CommonsUpload
4
- def self.license(language_code, file_name)
4
+ def self.license(file_name)
5
5
  require 'date'
6
+
6
7
  date = Date.today.to_s
8
+
9
+ category = ENV['LANGUAGE_SCREENSHOT_CATEGORY']
10
+ language_code = ENV['LANGUAGE_SCREENSHOT_CODE']
11
+
7
12
  "=={{int:filedesc}}==
8
13
  {{Information
9
14
  |description={{en|1=#{file_name}}}
@@ -18,13 +23,12 @@ module CommonsUpload
18
23
  =={{int:license-header}}==
19
24
  {{Wikipedia-screenshot}}
20
25
 
21
- [[Category:VisualEditor automatic screenshots/#{language_code}]]"
26
+ [[Category:#{category}/#{language_code}]]"
22
27
  end
23
28
 
24
29
  def self.image(file_path, client)
25
- language_code = ENV['LANGUAGE_SCREENSHOT_CODE']
26
30
  file_name = File.basename(file_path, '')
27
- file_license = license(language_code, file_name)
31
+ file_license = license(file_name)
28
32
 
29
33
  client.upload_image(file_name, file_path, file_license, true)
30
34
  sleep 5 # Restriction in bot speed: https://commons.wikimedia.org/wiki/Commons:Bots#Bot_speed
@@ -1,3 +1,3 @@
1
1
  module CommonsUpload
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  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: 0.0.2
4
+ version: 0.0.3
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: 2015-02-23 00:00:00.000000000 Z
13
+ date: 2015-06-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: mediawiki_api