Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Git forgot to push this to github for a longlong time

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