magnum-pi 0.2.7 → 0.2.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YjhiNGQ1NzExZGM1YjhjN2UwYjM1OGYwMGU4MDA0ZGE4ZWQ4MTA0Zg==
4
+ YWE5Y2ZlZmRhNGRiZDA0YjllZDYxNTRjOTVkYWY5YWM1MWY1NDdiYw==
5
5
  data.tar.gz: !binary |-
6
- M2JmZTE5ZDI1MTJiMWIyYzNiYTUxMDkwOTM1Zjk0YzRjZDYxMWI2Mw==
6
+ M2EyZmFmYjc1NTZkNjcwNTBjNDYwNDg2MGFiYmIyZThmODAwYjg0Yg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YzBkMTg3NmM3MTE0NzA2YWI1NjI0MjQ5M2YxZmY3NGE2YjVmYmI2ZDRjMzY4
10
- YjJhZjBjMzYxZWZjZjg5ODQ0NmZlMmU5YmJiMzNlMjhiNWRkZDc2Y2RlYmZi
11
- N2ZlNjM2YmRiM2E1ZDhjYjMwNTg0NTdiOTQyMzE3N2YxYzhjZjI=
9
+ YmQ4NWIzNTFjYzhiYmJkN2NmNDc4MGNiZjZlZjk2ODMxZGNjYWNjMjJkZTE4
10
+ ODIwZDcyMjU1NDVjMjNmNWQyNWYwYzdjMzY1MGQwZjMwZjM5OGUwYzY2ZTQw
11
+ ZDgxNGZlMDljYzgxNGJhNTMwNzA0ODIxMjk5M2Q1YTE0MTA4MWY=
12
12
  data.tar.gz: !binary |-
13
- MmU3NDJkNjI5ZTBhOWE3ZGU3MzgyNTY1YTgxMzBmYWY4MTk1MjkyMTRjNWJm
14
- YWU2MDM1NTI3ODdhM2JlODJmYmY1YTUwZWU0YzQ4ZmE5ZDBiOTRkZmVmNGMy
15
- ZjNkZWUwZGQzZWNhMzhkNTAzN2Y2YTAxMWZjMjk4MjExMTlhYWM=
13
+ NTg1NTM2ODU3NzY2NjBiNjFmYjI5NTA3Mzc2ODkzNjlhOGI0OWJiNTIzOTc2
14
+ YmFjNGY4ZWI2NGQxZDVjN2I3MWJjNjEyYTg2ZTg0NzVlOGZkMmFkMzIzNDNl
15
+ NTE1MzlkZDc1NjNmNTRmZjBjYTljNjc3MDIzZGIxNjM0ZmRhOWE=
@@ -1,5 +1,9 @@
1
1
  = MagnumPI CHANGELOG
2
2
 
3
+ == Version 0.2.8 (August 14, 2014)
4
+
5
+ * Corrected parameters when downloading with POST requests
6
+
3
7
  == Version 0.2.7 (August 14, 2014)
4
8
 
5
9
  * Using one user-agent only
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.7
1
+ 0.2.8
@@ -19,7 +19,13 @@ module MagnumPI
19
19
  FileUtils.mkdir_p File.dirname(target)
20
20
  file = File.open target, "w"
21
21
  begin
22
- request = Typhoeus::Request.new url, :method => method, :params => params, :headers => {"User-Agent" => agent.user_agent}
22
+ options = {:method => method, :headers => {"User-Agent" => agent.user_agent}}
23
+ if method.to_s.downcase == "get"
24
+ options[:params] = params
25
+ else
26
+ options[:body] = params
27
+ end
28
+ request = Typhoeus::Request.new url, options
23
29
  request.on_headers {|response| raise "Failed to download #{target}" unless (response.response_code / 200) == 1}
24
30
  request.on_body {|chunk| file.write chunk.force_encoding("UTF-8")}
25
31
  request.run
@@ -1,7 +1,7 @@
1
1
  module MagnumPI
2
2
  MAJOR = 0
3
3
  MINOR = 2
4
- TINY = 7
4
+ TINY = 8
5
5
 
6
6
  VERSION = [MAJOR, MINOR, TINY].join(".")
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: magnum-pi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Engel