Skip to content
Browse files

Get reasonable HTTP status code from Rails by requesting output as XML

  • Loading branch information...
1 parent f9c7b0f commit c7626806d98c1c828abeeb208160e8e5789c8a13 @karmi committed
Showing with 5 additions and 5 deletions.
  1. +2 −2 02_shapes_and_colors.rb
  2. +1 −1 07_interface.rb
  3. +1 −1 08_live_interface.rb
  4. +1 −1 09_uploader.rb
View
4 02_shapes_and_colors.rb
@@ -3,7 +3,7 @@
Shoes.app :width => 600, :height => 400 do
- background gradient('fff', lightblue)
+ background gradient('fff', red)
border black, :strokewidth => 6
fill crimson
@@ -15,7 +15,7 @@
:width => 100,
:height => 200,
:curve => 10,
- :fill => lightskyblue..white,
+ :fill => blue..white,
:stroke => cornflowerblue
stroke rgb(82, 138, 150)
View
2 07_interface.rb
@@ -12,7 +12,7 @@
stack do
background "#BE8"
- subtitle "Interface in Shoes", :stroke => '#14190e', :margin_left => 13
+ subtitle "Interface in Shoes", :stroke => '#14190e', :margin => [5, 10, 20, 10]
end
@params = {}
View
2 08_live_interface.rb
@@ -41,7 +41,7 @@
post_data = ''
@params.each { |key, value| post_data << "person[#{key}]" + '=' + CGI.escape(value.text) + '&' }
- @d = download("http://localhost:3000/people",
+ @d = download("http://localhost:3000/people.xml",
:method => 'POST',
:body => post_data) { |upload| @status.text = 'Received: ' + upload.response.headers['Status'] }
# ----------------------------------------------------------------------------------------------------------------
View
2 09_uploader.rb
@@ -25,7 +25,7 @@ def upload(path)
status.style(:weight =>'bold', :stroke => (response.code == '200' ? black : crimson) )
@files_uploaded << path
@progress_info.text = "#{@files_uploaded.size} of #{@files_total.size} uploaded"
- @progress_bar.fraction = (@files_uploaded.size.to_f / @files_total.size.to_f)
+ @progress_bar.fraction = ( @files_uploaded.size.to_f / @files_total.size.to_f)
end
end

0 comments on commit c762680

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