Permalink
Browse files

Fix for Ruby > 1.9

  • Loading branch information...
1 parent fc89f70 commit c3e4f1e5dd6a615c42551bf9f133a70f9065e308 @netmilk netmilk committed Nov 19, 2013
Showing with 3 additions and 3 deletions.
  1. +3 −3 ruby.html
View
@@ -1,14 +1,14 @@
<section name="ruby" class="ruby">
<p class="ioDesc">Request</p>
- <pre class="incoming"><code class="language-ruby">require 'rubygems'
+ <pre class="incoming"><code class="language-ruby">require 'rubygems' if RUBY_VERSION < '1.9'
require 'rest_client'
<% if @body and @contentType is "application/x-www-form-urlencoded": %>
values = CGI::escape(<%= @helpers.escape @body %>)
<% else if @body and @contentType is "application/json": %>
values = <%= @helpers.escape @body %>
<% else if @method isnt 'GET' and (@contentType is "text/html" or @contentType is "text/plain"): %>
-values = <%= @helpers.escape @body %>
-<% else if @body and @body: %>
+values = <%= @helpers.escape(@body or '') %>
+<% else if @body: %>
values = <%= @helpers.escape @body %>
<% end %>

0 comments on commit c3e4f1e

Please sign in to comment.