Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

stop erubis from printing its version number all the time #1

Merged
merged 2 commits into from

3 participants

@grosser

(please release as patch so I can get rid of this git-gem dependency)

@grosser

@joloudov If you want to save the work simply add me to rubygems/github and I'll do it myself :)

@joloudov joloudov merged commit 51bc0bf into joloudov:master
@jaredbeck

Thanks guys, this output was so annoying!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 8 additions and 2 deletions.
  1. +7 −1 lib/rails_xss/erubis.rb
  2. +1 −1  rails/init.rb
View
8 lib/rails_xss/erubis.rb
@@ -1,4 +1,10 @@
-require 'erubis/helpers/rails_helper'
+# stop erubis from printing it's version number all the time
+old_stdout = $stdout
+File.open("/dev/null", "w") do |f|
+ $stdout = f
+ require 'erubis/helpers/rails_helper'
+ $stdout = old_stdout
+end
module RailsXss
class Erubis < ::Erubis::Eruby
View
2  rails/init.rb
@@ -1,5 +1,5 @@
unless $gems_rake_task
- if Rails.version <= "2.3.7"
+ if Gem::Version.new(Rails.version) <= Gem::Version.new("2.3.7")
$stderr.puts "rails_xss requires Rails 2.3.8 or later. Please upgrade to enable automatic HTML safety."
else
require 'rails_xss'
Something went wrong with that request. Please try again.