Permalink
Browse files

Add String#each to make Rack 0.9.1 compatible with Ruby 1.9

  • Loading branch information...
1 parent 33c1a76 commit b9afcd57f0b6dd70e4e1e550e2a16b26c39ba21e @rtomayko rtomayko committed Jan 31, 2009
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/sinatra/base.rb
View
@@ -948,3 +948,9 @@ def self.helpers(*extensions, &block)
Default.helpers(*extensions, &block)
end
end
+
+# Define String#each under 1.9 for Rack compatibility. This should be
+# removed once Rack is fully 1.9 compatible.
+class String
+ alias_method :each, :each_line unless ''.respond_to? :each
+end

0 comments on commit b9afcd5

Please sign in to comment.