thumb_fu 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/CHANGELOG +1 -0
  2. data/Rakefile +1 -1
  3. data/lib/thumb_fu.rb +8 -3
  4. data/thumb_fu.gemspec +1 -1
  5. metadata +1 -1
data/CHANGELOG CHANGED
@@ -1,3 +1,4 @@
1
+ v0.1.4. fixed image io
1
2
  v0.1.3. fixed not ready image
2
3
  v0.1.2. added README
3
4
  v0.1.1. fix thumb
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.3') do |p|
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"
@@ -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 << image
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).read
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(image)
51
+ Digest::MD5.hexdigest(image_data)
47
52
  end
48
53
 
49
54
  def not_ready_hashsum
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{thumb_fu}
5
- s.version = "0.1.3"
5
+ s.version = "0.1.4"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = [%q{Iskander HAziev}]
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: thumb_fu
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.3
5
+ version: 0.1.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - Iskander HAziev