Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Git forgot to push this to github for a longlong time

  • Loading branch information...
commit 40e4e4bfb84a1539c5894fe4d5fe7490ba5faa91 1 parent eedf869
Pascal pascalbetz authored
2  CHANGES
... ... @@ -1,3 +1,5 @@
  1 +0.2.11
  2 + * Fixed a bug where content (images were not returned anymore). Thanks to PietHadermann for reporting this embarrassing bug!
1 3 0.2.10 (11. Jun 2010)
2 4 * Applied fixes from technoirlabs
3 5 0.2.8 (16. Jun 2009)
4 README
@@ -40,10 +40,6 @@ job.write_file(job.fetch(:custom), '/tmp/test.jpg')
40 40 # if you have a job ID then you can use this to get a Job object and then use the fetch_xyz methods
41 41 wt.job_status(JOB_ID)
42 42
43   -# check the status of your account
44   -wt.status
45   -
46   -
47 43 # generate a Easythumb URL
48 44 et = Easythumb.new('YOUR_API_KEY', 'YOUR_USER_ID')
49 45 # This returns an URL which you can directly use in your webpage
2  lib/rwebthumb.rb
@@ -2,4 +2,4 @@
2 2 require 'rwebthumb/base'
3 3 require 'rwebthumb/job'
4 4 require 'rwebthumb/webthumb'
5   -require 'rwebthumb/easythumb'
  5 +require 'rwebthumb/easythumb'
6 lib/rwebthumb/base.rb
@@ -35,9 +35,13 @@ def do_request(xml)
35 35 case response
36 36 when Net::HTTPOK :
37 37 case response.content_type.downcase
38   - when 'text/xml' then REXML::Document.new(response.body)
  38 + when 'text/xml'
  39 + REXML::Document.new(response.body)
  40 + when 'text/plain'
  41 + raise WebthumbException.new("Unsupported content type #{response.content_type}: Body was: #{response.body}")
39 42 when 'image/jpg', 'image/jpeg', 'image/png', 'archive/zip'
40 43 raise WebthumbException.new("No data returned though content type is #{response.content_type}") if response.body.length == 0
  44 + response.body
41 45 else
42 46 raise WebthumbException.new("Unsupported content type #{response.content_type}")
43 47 end
2  lib/rwebthumb/job.rb
@@ -82,7 +82,7 @@ def fetch(size = :small)
82 82 # *name: a filename
83 83 # Will return a File object
84 84 def write_file(data, name)
85   - raise WebthumbException.new('NO data given') if data == nil || data.size == 0
  85 + raise WebthumbException.new('No data given') if data == nil || data.size == 0
86 86 File.open(name, 'wb+') do |file|
87 87 file.write(data)
88 88 file.close
2  simplificator-rwebthumb.gemspec
... ... @@ -1,6 +1,6 @@
1 1 Gem::Specification.new do |s|
2 2 s.name = %q{simplificator-rwebthumb}
3   - s.version = "0.2.10"
  3 + s.version = "0.2.12"
4 4 s.date = %q{2008-09-03}
5 5 s.authors = ["Simplificator GmbH"]
6 6 s.email = %q{info@simplificator.com}

0 comments on commit 40e4e4b

Please sign in to comment.
Something went wrong with that request. Please try again.