url2png 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/lib/url2png/config.rb +14 -14
  3. data/url2png.gemspec +2 -2
  4. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.3
1
+ 0.3.4
@@ -1,28 +1,28 @@
1
1
  module Url2png
2
2
  extend self
3
-
3
+
4
4
  # modes
5
5
  MODES = %w{production placehold dummy}
6
-
6
+
7
7
  def config c = {}
8
8
  # mandatory
9
9
  self.api_key = c[:api_key]
10
10
  self.private_key = c[:private_key]
11
-
11
+
12
12
  # optional
13
13
  self.mode = c[:mode] if c[:mode]
14
14
  self.api_version = c[:api_version] if c[:api_version]
15
15
  end
16
-
16
+
17
17
  def api_key=api_key
18
18
  @api_key=api_key
19
19
  end
20
-
20
+
21
21
  def api_key
22
22
  raise 'Url2png error: No public key defined!' if @api_key.nil?
23
23
  @api_key
24
24
  end
25
-
25
+
26
26
  def private_key=private_key
27
27
  @private_key = private_key
28
28
  end
@@ -31,32 +31,32 @@ module Url2png
31
31
  raise 'Url2png error: No private key defined!' if @private_key.nil?
32
32
  @private_key
33
33
  end
34
-
34
+
35
35
  def mode=mode
36
36
  raise "Url2png error: Invalid mode, only #{ MODES.join(', ') } are allowed" unless MODES.include?(mode.to_s)
37
- @mode = mode
37
+ @mode = mode.to_s
38
38
  end
39
39
 
40
40
  def mode
41
41
  @mode ||= 'production' # default: production
42
42
  end
43
-
43
+
44
44
  def api_version=api_version
45
45
  @api_version = api_version || 'v6' # set default to latest open version
46
46
  end
47
-
47
+
48
48
  def api_version
49
49
  @api_version || 'v6' #default: v6
50
50
  end
51
-
51
+
52
52
  def default_size=default_size
53
53
  @default_size = default_size || "400x400"
54
54
  end
55
-
55
+
56
56
  def default_size
57
57
  @default_size || "400x400"
58
58
  end
59
-
59
+
60
60
  def token param
61
61
  case self.api_version
62
62
  when 'v6'
@@ -65,4 +65,4 @@ module Url2png
65
65
  Digest::MD5.hexdigest("#{self.private_key}+#{param}")
66
66
  end
67
67
  end
68
- end
68
+ end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "url2png"
8
- s.version = "0.3.3"
8
+ s.version = "0.3.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["robinhoudmeyers", "wout fierens", "fuzzyalej", "ceritium", "lukemelia"]
12
- s.date = "2012-09-19"
12
+ s.date = "2012-10-08"
13
13
  s.description = "Generate screenshots from websites almost instantly at any preferred size using ruby and the url2png.com API"
14
14
  s.email = "houdmeyers@gmail.com"
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: url2png
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2012-09-19 00:00:00.000000000 Z
16
+ date: 2012-10-08 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: rspec
@@ -137,7 +137,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
137
137
  version: '0'
138
138
  segments:
139
139
  - 0
140
- hash: -1028293372536442791
140
+ hash: -2433164738939015678
141
141
  required_rubygems_version: !ruby/object:Gem::Requirement
142
142
  none: false
143
143
  requirements: