mediawiki_api 0.1.2 → 0.1.3

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: 41c2dd44c6fc40c892dba0f16d889db55f0f3ae9
4
- data.tar.gz: 2d5c82f2aae43baadb25ecc82be9555eeee75815
3
+ metadata.gz: d8395abe251559d9bdf235ea57ac6f03e53bc6f0
4
+ data.tar.gz: ad8ff2632ce626ee44fbaee68e0188ed2a7da3b8
5
5
  SHA512:
6
- metadata.gz: 5645e2743b93f1143741a47dc05e9b19ee2508c8aa916bff6302d6e87e9de045e4996f59f803d69847eb5d91e6511737a2ed973358864810eff6140f074d2a4a
7
- data.tar.gz: c5a9ecafd25845f3849efec516e45edd26dfb52469dcc838eaf431db440d6709977d831487abc8afb1c1238ddf305c3cd150ba23368f417de5eb51676d5086ff
6
+ metadata.gz: c93261cc228782ebac21aa2193824dcc65aa739eb254ec55ba0e7a217ee6f754e964f47f6faf543ccc36d7805dc67b084c9f28a3a16441c017532ca4998ab1cb
7
+ data.tar.gz: 724a2f1c2d41578427ed0bae7ed3bef54541d406f014bf274e45eccc9a8a6267bee9ca48538e740a4a8b2c4a51389b73dc3cd0bf08b78a7d3df1094b6a78e33f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mediawiki_api (0.1.1)
4
+ mediawiki_api (0.1.2)
5
5
  faraday (~> 0.9, >= 0.9.0)
6
6
  faraday-cookie_jar (~> 0.0, >= 0.0.6)
7
7
 
@@ -17,6 +17,7 @@ module MediawikiApi
17
17
 
18
18
  def initialize(url, log=false)
19
19
  @conn = Faraday.new(url: url) do |faraday|
20
+ faraday.request :multipart
20
21
  faraday.request :url_encoded
21
22
  if log then
22
23
  faraday.response :logger
@@ -71,6 +72,11 @@ module MediawikiApi
71
72
  resp = @conn.post "", { action: "delete", title: title, reason: reason, token: token, format: "json" }
72
73
  end
73
74
 
75
+ def upload_image(filename ,path , comment, ignorewarnings)
76
+ token = get_token "edit"
77
+ @conn.post "", { action: "upload", filename: filename, file: Faraday::UploadIO.new(path, 'image/png'), token: token, comment: comment, ignorewarnings: ignorewarnings, format: "json"}
78
+ end
79
+
74
80
  def get_wikitext(title)
75
81
  resp = @conn.get "/w/index.php", { action: "raw", title: title }
76
82
  end
@@ -1,3 +1,3 @@
1
1
  module MediawikiApi
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
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.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amir Aharoni
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2014-04-11 00:00:00.000000000 Z
15
+ date: 2014-06-28 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: faraday