thumb_fu 0.1.3 → 0.1.4
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/CHANGELOG +1 -0
- data/Rakefile +1 -1
- data/lib/thumb_fu.rb +8 -3
- data/thumb_fu.gemspec +1 -1
- metadata +1 -1
data/CHANGELOG
CHANGED
data/Rakefile
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'rake'
|
3
3
|
require 'echoe'
|
4
|
-
Echoe.new('thumb_fu', '0.1.
|
4
|
+
Echoe.new('thumb_fu', '0.1.4') do |p|
|
5
5
|
p.description = "Generate a page thumbnail using www.bitpixels.com"
|
6
6
|
p.url = "http://github.com/23ninja/thumb_fu"
|
7
7
|
p.author = "Iskander HAziev"
|
data/lib/thumb_fu.rb
CHANGED
@@ -17,13 +17,18 @@ module ThumbFu
|
|
17
17
|
|
18
18
|
def image
|
19
19
|
generate unless generated?
|
20
|
+
@image.seek(0)
|
20
21
|
@image
|
21
22
|
end
|
22
23
|
|
24
|
+
def image_data
|
25
|
+
image.read
|
26
|
+
end
|
27
|
+
|
23
28
|
def save(path)
|
24
29
|
return false unless ready?
|
25
30
|
open(path, 'wb') do |file|
|
26
|
-
file <<
|
31
|
+
file << image_data
|
27
32
|
end
|
28
33
|
end
|
29
34
|
|
@@ -33,7 +38,7 @@ module ThumbFu
|
|
33
38
|
|
34
39
|
protected
|
35
40
|
def generate
|
36
|
-
@image = open(url)
|
41
|
+
@image = open(url)
|
37
42
|
rescue
|
38
43
|
false
|
39
44
|
end
|
@@ -43,7 +48,7 @@ module ThumbFu
|
|
43
48
|
end
|
44
49
|
|
45
50
|
def image_hashsum
|
46
|
-
Digest::MD5.hexdigest(
|
51
|
+
Digest::MD5.hexdigest(image_data)
|
47
52
|
end
|
48
53
|
|
49
54
|
def not_ready_hashsum
|
data/thumb_fu.gemspec
CHANGED