Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

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

Merged
merged 2 commits into from over 1 year ago

3 participants

Michael Grosser Jared Beck Denis Joloudov
Michael Grosser

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

Michael Grosser

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

Denis Joloudov joloudov merged commit 51bc0bf into from August 28, 2012
Denis Joloudov joloudov closed this August 28, 2012
Jared Beck

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.
8  lib/rails_xss/erubis.rb
... ...
@@ -1,4 +1,10 @@
1  
-require 'erubis/helpers/rails_helper'
  1
+# stop erubis from printing it's version number all the time
  2
+old_stdout = $stdout
  3
+File.open("/dev/null", "w") do |f|
  4
+  $stdout = f
  5
+  require 'erubis/helpers/rails_helper'
  6
+  $stdout = old_stdout
  7
+end
2 8
 
3 9
 module RailsXss
4 10
   class Erubis < ::Erubis::Eruby
2  rails/init.rb
... ...
@@ -1,5 +1,5 @@
1 1
 unless $gems_rake_task
2  
-  if Rails.version <= "2.3.7"
  2
+  if Gem::Version.new(Rails.version) <= Gem::Version.new("2.3.7")
3 3
     $stderr.puts "rails_xss requires Rails 2.3.8 or later. Please upgrade to enable automatic HTML safety."
4 4
   else
5 5
     require 'rails_xss'
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.