simplificator-rwebthumb 0.2.10 → 0.2.11

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/README CHANGED
@@ -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
data/lib/rwebthumb.rb CHANGED
@@ -3,3 +3,15 @@ require 'rwebthumb/base'
3
3
  require 'rwebthumb/job'
4
4
  require 'rwebthumb/webthumb'
5
5
  require 'rwebthumb/easythumb'
6
+
7
+
8
+ key = '7c822c5ce4f80fd66209e8f657ce6577'
9
+
10
+ include Simplificator::Webthumb
11
+
12
+ # Creating a Webthumb Object. This is used as your main access point.
13
+ wt = Webthumb.new(key)
14
+
15
+ # Create a new thumbnail job
16
+ job = wt.thumbnail(:url => 'http://simplificator.com')
17
+ job.write_file(job.fetch_when_complete(:large), '/tmp/test.jpg')
@@ -35,9 +35,13 @@ module Simplificator
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
data/lib/rwebthumb/job.rb CHANGED
@@ -82,7 +82,7 @@ module Simplificator
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
metadata CHANGED
@@ -1,12 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simplificator-rwebthumb
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 2
8
- - 10
9
- version: 0.2.10
4
+ version: 0.2.11
10
5
  platform: ruby
11
6
  authors:
12
7
  - Simplificator GmbH
@@ -18,7 +13,7 @@ date: 2008-09-03 00:00:00 +02:00
18
13
  default_executable:
19
14
  dependencies: []
20
15
 
21
- description: "rwebthumb provides a ruby interface for the webthumb.bluga.net. "
16
+ description: rwebthumb provides a ruby interface for the webthumb.bluga.net.
22
17
  email: info@simplificator.com
23
18
  executables: []
24
19
 
@@ -38,10 +33,8 @@ files:
38
33
  - lib/rwebthumb/easythumb.rb
39
34
  - README
40
35
  - init.rb
41
- has_rdoc: true
36
+ has_rdoc: false
42
37
  homepage: http://simplificator.com/
43
- licenses: []
44
-
45
38
  post_install_message:
46
39
  rdoc_options: []
47
40
 
@@ -51,22 +44,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
51
44
  requirements:
52
45
  - - ">="
53
46
  - !ruby/object:Gem::Version
54
- segments:
55
- - 0
56
47
  version: "0"
48
+ version:
57
49
  required_rubygems_version: !ruby/object:Gem::Requirement
58
50
  requirements:
59
51
  - - ">="
60
52
  - !ruby/object:Gem::Version
61
- segments:
62
- - 0
63
53
  version: "0"
54
+ version:
64
55
  requirements: []
65
56
 
66
57
  rubyforge_project:
67
- rubygems_version: 1.3.6
58
+ rubygems_version: 1.3.1
68
59
  signing_key:
69
- specification_version: 3
60
+ specification_version: 2
70
61
  summary: rwebthumb provides a ruby interface for the webthumb.bluga.net
71
62
  test_files: []
72
63