steamcannon-deltacloud-core 0.0.7.1-java → 0.0.7.2-java

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,37 +15,46 @@
15
15
  # License for the specific language governing permissions and limitations
16
16
  # under the License.
17
17
 
18
- #--
19
- # based on the example from http://macournoyer.com/blog/2009/06/04/pusher-and-async-with-thin/
20
- #--
21
- require 'eventmachine'
22
- class BlobStream
23
- AsyncResponse = [-1, {}, []].freeze
24
- def self.call(env, credentials, params)
25
- body = DeferrableBody.new
26
- #Get the headers out asap. Don't specify a content-type let
27
- #the client guess and if they can't they SHOULD default to
28
- #'application/octet-stream' anyway as per:
29
- #http://www.w3.org/Protocols/rfc2616/rfc2616-sec7.html#sec7.2.1
30
- EM.next_tick { env['async.callback'].call [200, {'Content-Type' => "#{params['content_type']}", 'Content-Length' => "#{params['content_length']}"}, body] }
31
- #call the driver from here. the driver method yields for every chunk of blob it receives. We then
32
- #use body.call to write that chunk as received.
33
- driver.blob_data(credentials, params[:bucket], params[:blob], params) {|chunk| body.call ["#{chunk}"]} #close blob_data block
34
- body.succeed
35
- AsyncResponse # Tells Thin to not close the connection and continue it's work on other request
18
+ begin
19
+ require 'eventmachine'
20
+ #--
21
+ # based on the example from http://macournoyer.com/blog/2009/06/04/pusher-and-async-with-thin/
22
+ #--
23
+ class BlobStream
24
+ AsyncResponse = [-1, {}, []].freeze
25
+ def self.call(env, credentials, params)
26
+ body = DeferrableBody.new
27
+ #Get the headers out asap. Don't specify a content-type let
28
+ #the client guess and if they can't they SHOULD default to
29
+ #'application/octet-stream' anyway as per:
30
+ #http://www.w3.org/Protocols/rfc2616/rfc2616-sec7.html#sec7.2.1
31
+ EM.next_tick { env['async.callback'].call [200, {'Content-Type' => "#{params['content_type']}", 'Content-Length' => "#{params['content_length']}"}, body] }
32
+ #call the driver from here. the driver method yields for every chunk of blob it receives. We then
33
+ #use body.call to write that chunk as received.
34
+ driver.blob_data(credentials, params[:bucket], params[:blob], params) {|chunk| body.call ["#{chunk}"]} #close blob_data block
35
+ body.succeed
36
+ AsyncResponse # Tells Thin to not close the connection and continue it's work on other request
37
+ end
36
38
  end
37
- end
38
39
 
39
- class DeferrableBody
40
- include EventMachine::Deferrable
40
+ class DeferrableBody
41
+ include EventMachine::Deferrable
41
42
 
42
- def call(body)
43
- body.each do |chunk|
44
- @body_callback.call(chunk)
43
+ def call(body)
44
+ body.each do |chunk|
45
+ @body_callback.call(chunk)
46
+ end
45
47
  end
46
- end
47
48
 
48
- def each(&blk)
49
- @body_callback = blk
49
+ def each(&blk)
50
+ @body_callback = blk
51
+ end
52
+ end
53
+ rescue LoadError => e
54
+ # EventMachine isn't available, disable blob streaming
55
+ class BlobStream
56
+ def self.call(env, credentials, params)
57
+ raise NotImplementedError.new("Blob streaming is only supported under Thin")
58
+ end
50
59
  end
51
60
  end
metadata CHANGED
@@ -6,8 +6,8 @@ version: !ruby/object:Gem::Version
6
6
  - 0
7
7
  - 0
8
8
  - 7
9
- - 1
10
- version: 0.0.7.1
9
+ - 2
10
+ version: 0.0.7.2
11
11
  platform: java
12
12
  authors:
13
13
  - Red Hat, Inc.
@@ -15,13 +15,14 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-10-09 00:00:00 -04:00
18
+ date: 2010-10-11 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: rake
23
23
  prerelease: false
24
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
25
26
  requirements:
26
27
  - - ">="
27
28
  - !ruby/object:Gem::Version
@@ -36,6 +37,7 @@ dependencies:
36
37
  name: haml
37
38
  prerelease: false
38
39
  requirement: &id002 !ruby/object:Gem::Requirement
40
+ none: false
39
41
  requirements:
40
42
  - - ">="
41
43
  - !ruby/object:Gem::Version
@@ -50,6 +52,7 @@ dependencies:
50
52
  name: sinatra
51
53
  prerelease: false
52
54
  requirement: &id003 !ruby/object:Gem::Requirement
55
+ none: false
53
56
  requirements:
54
57
  - - ">="
55
58
  - !ruby/object:Gem::Version
@@ -64,6 +67,7 @@ dependencies:
64
67
  name: rack
65
68
  prerelease: false
66
69
  requirement: &id004 !ruby/object:Gem::Requirement
70
+ none: false
67
71
  requirements:
68
72
  - - ">="
69
73
  - !ruby/object:Gem::Version
@@ -78,6 +82,7 @@ dependencies:
78
82
  name: rack-accept
79
83
  prerelease: false
80
84
  requirement: &id005 !ruby/object:Gem::Requirement
85
+ none: false
81
86
  requirements:
82
87
  - - ~>
83
88
  - !ruby/object:Gem::Version
@@ -92,6 +97,7 @@ dependencies:
92
97
  name: json
93
98
  prerelease: false
94
99
  requirement: &id006 !ruby/object:Gem::Requirement
100
+ none: false
95
101
  requirements:
96
102
  - - ">="
97
103
  - !ruby/object:Gem::Version
@@ -106,6 +112,7 @@ dependencies:
106
112
  name: compass
107
113
  prerelease: false
108
114
  requirement: &id007 !ruby/object:Gem::Requirement
115
+ none: false
109
116
  requirements:
110
117
  - - ">="
111
118
  - !ruby/object:Gem::Version
@@ -120,6 +127,7 @@ dependencies:
120
127
  name: nokogiri
121
128
  prerelease: false
122
129
  requirement: &id008 !ruby/object:Gem::Requirement
130
+ none: false
123
131
  requirements:
124
132
  - - ">="
125
133
  - !ruby/object:Gem::Version
@@ -134,6 +142,7 @@ dependencies:
134
142
  name: rack-test
135
143
  prerelease: false
136
144
  requirement: &id009 !ruby/object:Gem::Requirement
145
+ none: false
137
146
  requirements:
138
147
  - - ">="
139
148
  - !ruby/object:Gem::Version
@@ -148,6 +157,7 @@ dependencies:
148
157
  name: cucumber
149
158
  prerelease: false
150
159
  requirement: &id010 !ruby/object:Gem::Requirement
160
+ none: false
151
161
  requirements:
152
162
  - - ">="
153
163
  - !ruby/object:Gem::Version
@@ -162,6 +172,7 @@ dependencies:
162
172
  name: rcov
163
173
  prerelease: false
164
174
  requirement: &id011 !ruby/object:Gem::Requirement
175
+ none: false
165
176
  requirements:
166
177
  - - ">="
167
178
  - !ruby/object:Gem::Version
@@ -324,6 +335,13 @@ files:
324
335
  - public/stylesheets/compiled/application.css
325
336
  - public/stylesheets/compiled/screen.css
326
337
  - bin/deltacloudd
338
+ - tests/images_test.rb
339
+ - tests/instances_test.rb
340
+ - tests/url_for_test.rb
341
+ - tests/hardware_profiles_test.rb
342
+ - tests/instance_states_test.rb
343
+ - tests/realms_test.rb
344
+ - tests/api_test.rb
327
345
  - COPYING
328
346
  has_rdoc: true
329
347
  homepage: http://www.deltacloud.org
@@ -335,6 +353,7 @@ rdoc_options: []
335
353
  require_paths:
336
354
  - lib
337
355
  required_ruby_version: !ruby/object:Gem::Requirement
356
+ none: false
338
357
  requirements:
339
358
  - - ">="
340
359
  - !ruby/object:Gem::Version
@@ -344,6 +363,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
344
363
  - 1
345
364
  version: 1.8.1
346
365
  required_rubygems_version: !ruby/object:Gem::Requirement
366
+ none: false
347
367
  requirements:
348
368
  - - ">="
349
369
  - !ruby/object:Gem::Version
@@ -353,7 +373,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
353
373
  requirements: []
354
374
 
355
375
  rubyforge_project:
356
- rubygems_version: 1.3.6
376
+ rubygems_version: 1.3.7
357
377
  signing_key:
358
378
  specification_version: 3
359
379
  summary: Deltacloud REST API