url_to_png 0.0.2 → 0.0.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 +4 -4
- data/README.md +1 -1
- data/lib/url_to_png/client.rb +1 -1
- data/lib/url_to_png/configuration.rb +13 -24
- data/lib/url_to_png/version.rb +1 -1
- data/url_to_png.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d81861a1f621b291283d664ffcd2d96490030f80
|
4
|
+
data.tar.gz: 72c84d01477c8f09b47d0870c5c9e7b74ec957ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fabca3e879ac53e75eac7f8044b7aa31fcbecb0fd11e292ec9f00989ac6a770588aa47ede6a87dcfa88d837ca020eb527042ee633fb515eb2c484ffd51404c5a
|
7
|
+
data.tar.gz: 276946c4306579b84cdd7f310158bb5a49c4e25ae806e91c34b9a3a4d3ba7cada55e7c94f22b6b4f38e9e329db53e613200b5e2d09ddce9c814ed0f7017ebc12
|
data/README.md
CHANGED
@@ -21,4 +21,4 @@ There are all kinds of options, and you can use your own Faraday middleware. I'm
|
|
21
21
|
|
22
22
|
## Tests
|
23
23
|
|
24
|
-
There are none! This is not like some
|
24
|
+
There are none! This is not like some philosophical thing; it's just that I didn't bother. So maybe all kinds of things are broken. Who knows?
|
data/lib/url_to_png/client.rb
CHANGED
@@ -1,19 +1,18 @@
|
|
1
1
|
require 'faraday'
|
2
2
|
|
3
3
|
module UrlToPng
|
4
|
-
class Configuration <
|
5
|
-
:api_key
|
6
|
-
:base_url
|
7
|
-
:connection,
|
8
|
-
:custom_css
|
9
|
-
:fullpage
|
10
|
-
:say_cheese
|
11
|
-
:secret_key
|
12
|
-
:thumbnail_max_width
|
13
|
-
:unique
|
14
|
-
:user_agent
|
15
|
-
:viewport
|
16
|
-
)
|
4
|
+
class Configuration < Hashie::Dash
|
5
|
+
property :api_key
|
6
|
+
property :base_url
|
7
|
+
property :connection, default: {}
|
8
|
+
property :custom_css
|
9
|
+
property :fullpage
|
10
|
+
property :say_cheese
|
11
|
+
property :secret_key
|
12
|
+
property :thumbnail_max_width
|
13
|
+
property :unique
|
14
|
+
property :user_agent
|
15
|
+
property :viewport
|
17
16
|
|
18
17
|
QUERY_OPTIONS = [
|
19
18
|
:custom_css,
|
@@ -25,22 +24,12 @@ module UrlToPng
|
|
25
24
|
:viewport
|
26
25
|
]
|
27
26
|
|
28
|
-
options connection: Faraday::ConnectionOptions
|
29
|
-
|
30
|
-
memoized(:connection) { self.class.options_for(:connection).new }
|
31
|
-
|
32
27
|
def configured?
|
33
28
|
!api_key.nil? && !secret_key.nil?
|
34
29
|
end
|
35
30
|
|
36
31
|
def query_hash
|
37
|
-
|
38
|
-
value = send(item)
|
39
|
-
if (value)
|
40
|
-
hash[item] = send(item)
|
41
|
-
end
|
42
|
-
hash
|
43
|
-
end
|
32
|
+
select{|key, value| QUERY_OPTIONS.include?(key)}
|
44
33
|
end
|
45
34
|
|
46
35
|
end
|
data/lib/url_to_png/version.rb
CHANGED
data/url_to_png.gemspec
CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
18
|
spec.require_paths = ["lib"]
|
19
19
|
|
20
|
-
spec.add_dependency 'faraday', ">= 0.
|
20
|
+
spec.add_dependency 'faraday', ">= 0.8.4"
|
21
21
|
spec.add_dependency 'faraday_middleware'
|
22
22
|
spec.add_dependency 'hashie'
|
23
23
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: url_to_png
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Isaac Cambron
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.8.4
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.8.4
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: faraday_middleware
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|