url2png 0.0.5 → 0.0.6

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.5
1
+ 0.0.6
@@ -1,7 +1,7 @@
1
1
  module Url2png
2
2
  module Config
3
3
 
4
- def self.api_url protocol = 'http://'
4
+ def self.api_url protocol
5
5
  Thread.current[:url2png_url] ||= "#{ protocol }api.url2png.com"
6
6
  end
7
7
 
@@ -18,6 +18,8 @@ module Url2png
18
18
  end
19
19
 
20
20
  def site_image_url url, options = {}
21
+ options[:protocol] ||= 'http://'
22
+
21
23
  dim = Url2png::Dimensions.parse(options)
22
24
 
23
25
  # escape the url
@@ -27,7 +29,7 @@ module Url2png
27
29
  token = Digest::MD5.hexdigest("#{ Url2png::Config.shared_secret }+#{ safe_url }")
28
30
 
29
31
  # build image url
30
- File.join(Url2png::Config.api_url(request.protocol), Url2png::Config.api_version, Url2png::Config.public_key, token, dim[:size], safe_url)
32
+ File.join(Url2png::Config.api_url(options[:protocol]), Url2png::Config.api_version, Url2png::Config.public_key, token, dim[:size], safe_url)
31
33
  end
32
34
 
33
35
  end
data/url2png.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{url2png}
8
- s.version = "0.0.5"
8
+ s.version = "0.0.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["wout fierens"]
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 5
9
- version: 0.0.5
8
+ - 6
9
+ version: 0.0.6
10
10
  platform: ruby
11
11
  authors:
12
12
  - wout fierens
@@ -131,7 +131,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
131
131
  requirements:
132
132
  - - ">="
133
133
  - !ruby/object:Gem::Version
134
- hash: -2135920408617122627
134
+ hash: -4384475011927731947
135
135
  segments:
136
136
  - 0
137
137
  version: "0"