url2pdf 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/url2pdf.rb +2 -5
- data/lib/url2pdf/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0d3c17f6af88fd44e7fd5195ec018c02fed76c8
|
4
|
+
data.tar.gz: 8d7ce6ae365383ca697c3e555c992ca6a59c61c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 143bc652e03ecadb96d78b280d2ab8907f5c6f4a30443ad18e3f1d6e7c5835f749536a0f4d83f8c6d55ce02ecaab5e18f6bd2edb5d2c4b66102c568258316be7
|
7
|
+
data.tar.gz: f22c5190fe0b9b08a69c35dbfdf6c67ed9f5719d1c2abca115531579216761b4b041cad381eead2bce4546bd6e02e3b073a2c682cd68476ce56cd3816ec29774
|
data/lib/url2pdf.rb
CHANGED
@@ -19,11 +19,8 @@ module Url2pdf
|
|
19
19
|
uri = URI(full_url)
|
20
20
|
params = URI.decode_www_form(uri.query || "") << ['icanhazpdf', @api_key]
|
21
21
|
uri.query = URI.encode_www_form(params)
|
22
|
-
|
23
|
-
encoded_url
|
24
|
-
encoded_url += "&margin=#{options[:margin]}" if options.has_key?(:margin)
|
25
|
-
encoded_url += "&orientation=#{options[:orientation]}" if options.has_key?(:orientation)
|
26
|
-
|
22
|
+
options_as_query_string = URI.encode_www_form(options.delete_if {|k,v| v.nil?})
|
23
|
+
encoded_url = "#{@service_options[:server_url] || DEFAULT_PDF_SERVICE_URL}?url=#{Rack::Utils.escape(uri)}&#{options_as_query_string}"
|
27
24
|
HTTParty.get(encoded_url, timeout: @service_options[:timeout] || DEFAULT_HTTP_TIMEOUT)
|
28
25
|
end
|
29
26
|
end
|
data/lib/url2pdf/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: url2pdf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nic Pillinger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|