Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

hotfix for a bug caused by string handling rails ~3.0.6 and up; occur…

…red during any attempt to post to DR service
  • Loading branch information...
commit be4a6ebbc462274f53c6353e7c5a427a196a4fbf 1 parent e8e8d9d
@janxious janxious authored
Showing with 14 additions and 4 deletions.
  1. +3 −0  Changelog
  2. +2 −2 doc_raptor.gemspec
  3. +9 −2 lib/doc_raptor.rb
View
3  Changelog
@@ -1,5 +1,8 @@
= doc_raptor Change Log
+== doc_raptor 0.1.5
+* fix bug caused by activesupport safebuffers in rails ~3.0.6 and up
+
== doc_raptor 0.1.4
* add support for creating async jobs
View
4 doc_raptor.gemspec
@@ -2,8 +2,8 @@ Gem::Specification.new do |s|
s.name = %q{doc_raptor}
s.description = %q{Provides a simple ruby wrapper around the DocRaptor API}
s.summary = %q{Provides a simple ruby wrapper around the DocRaptor API}
- s.version = "0.1.4"
- s.date = %q{2011-06-24}
+ s.version = "0.1.5"
+ s.date = %q{2011-08-29}
s.authors = ["Michael Kuehl","Joel Meador","Chris Moore"]
s.email = %q{michael@expectedbehavior.com}
s.summary = %q{wrap up the api for DocRaptor nicely}
View
11 lib/doc_raptor.rb
@@ -28,8 +28,15 @@ def self.create(options = { })
if options[:async]
query[:output => 'json']
end
-
-
+
+ # HOTFIX
+ # convert safebuffers to plain old strings so the gsub'ing that has to occur
+ # for url encoding works
+ # Broken by: https://github.com/rails/rails/commit/1300c034775a5d52ad9141fdf5bbdbb9159df96a#activesupport/lib/active_support/core_ext/string/output_safety.rb
+ # Discussion: https://github.com/rails/rails/issues/1555
+ options.map{|k,v| options[k] = options[k].to_str if options[k].is_a?(ActiveSupport::SafeBuffer)}
+ # /HOTFIX
+
response = post("/docs", :body => {:doc => options}, :basic_auth => { :username => api_key }, :query => query)
if block_given?
Please sign in to comment.
Something went wrong with that request. Please try again.