url_to_png 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: f74c5f3aeff7f96ce17a812854f92602191ef70e
4
- data.tar.gz: b593d84ba8c137946781d63028c037f60f7e6dd9
3
+ metadata.gz: d81861a1f621b291283d664ffcd2d96490030f80
4
+ data.tar.gz: 72c84d01477c8f09b47d0870c5c9e7b74ec957ce
5
5
  SHA512:
6
- metadata.gz: 9a8c012d4970d6f661b135bd55a3c69c2652fed6887f8d1c0f4e0cf728200ff5e4c3ead4f1c61064047cbdc2849cce348d59f4303f54db9e14cf49b1fc3ecdc3
7
- data.tar.gz: 46789312d417b1e8a0454159f9d16e45a1830e2f6981f70e8453b39f55b2330b8e34090799771ec9d7560bf8df878451fc0fba0999511cf9d82d1dd53744c849
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 philisophical thing; it's just that I didn't bother. So maybe all kinds of things are broken. Who knows?
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?
@@ -30,7 +30,7 @@ module UrlToPng
30
30
 
31
31
 
32
32
  def defaults
33
- Configuration.from(base_url: 'api.url2png.com')
33
+ Configuration.new(base_url: 'api.url2png.com')
34
34
  end
35
35
 
36
36
  def connection
@@ -1,19 +1,18 @@
1
1
  require 'faraday'
2
2
 
3
3
  module UrlToPng
4
- class Configuration < Faraday::Options.new(
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
- QUERY_OPTIONS.inject({}) do |hash, item|
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
@@ -1,3 +1,3 @@
1
1
  module UrlToPng
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
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.9.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.2
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.9.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.9.0
26
+ version: 0.8.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: faraday_middleware
29
29
  requirement: !ruby/object:Gem::Requirement