simplificator-rwebthumb 0.2.14 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/rwebthumb/job.rb +24 -1
  2. metadata +5 -5
@@ -51,12 +51,35 @@ module Simplificator
51
51
  def check_status
52
52
  response = do_request(build_status_xml())
53
53
  @status = REXML::XPath.first(response, '/webthumb/jobStatus/status').text == 'Complete' ? STATUS_PICKUP : STATUS_PROCESSING
54
+
54
55
  if pickup?
55
56
  @completion_time = response.attributes['completionTime']
57
+
58
+ if REXML::XPath.first(response,'/webthumb/jobStatus/status')
59
+ @pickup_url = REXML::XPath.first(response,'/webthumb/jobStatus/status').attributes['pickup']
60
+ @browser_width = (REXML::XPath.first(response,'/webthumb/jobStatus/status').attributes['browserWidth'] || "0").to_i
61
+ @browser_height = (REXML::XPath.first(response,'/webthumb/jobStatus/status').attributes['browserHeight'] || "0").to_i
62
+ end
56
63
  end
57
64
  @status
58
65
  end
59
-
66
+
67
+ # Returns the pickup url after a successful status request. You can use this to either download the zip file
68
+ # directly or use the zip file as the base name to derive the individual download paths.
69
+ def pickup_url
70
+ @pickup_url
71
+ end
72
+
73
+ # Returns the browser width after a successful status request.
74
+ def browser_width
75
+ @browser_width
76
+ end
77
+
78
+ # Returns the browser height after a successful status request.
79
+ def browser_height
80
+ @browser_height
81
+ end
82
+
60
83
  def fetch_when_complete(size = :small)
61
84
  while not pickup?
62
85
  sleep @duration_estimate
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simplificator-rwebthumb
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 2
9
- - 14
10
- version: 0.2.14
8
+ - 3
9
+ - 0
10
+ version: 0.3.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Simplificator GmbH
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-14 00:00:00 +02:00
18
+ date: 2008-09-03 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies: []
21
21