Skip to content
Redact words from your ******* rails app
Ruby
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
tasks
test
README
Rakefile
init.rb
install.rb
uninstall.rb

README

the Redacter by Justin Camerer (Programmed on December 16th, 2007)
===============================================================================

The Redacter is a very simplistic plugin for Rails that will obfuscate words
and phrases after all of the Rails processing magic has happened.

Usage:

  Controller:
  class SecretsController
		redact 'top', 'secret', 'words and phrases'
  end

  View:
	<h1>The Top Secret Controller</h1>
	<p>No one should be able to see these words and phrases.</p>

	Rendered View:
	<h1>The XXX XXXXXX Controller</h1>
	<p>No one should be able to see these XXXXXXXXXXXXXXXXX.</p>


Implementation Details:

	This plugin ensures that anything generated by the view or controller of
	a model will be obfuscated because it is implemented with an "after_filter"
	on the appropriate controller.

	The actually redacting of the words could have been done much more
	simply (Ex 1.1), but would have ran much less efficiently. By combining all
	of the words being searched for, the input can be redacted in a single pass.
	Redacter::Redacter#redact in lib/redacter.rb reflects this algorigthm.

    Ex 1.1
    words.each do {|word| input.gsub!(word, 'X' * word.length) }
Something went wrong with that request. Please try again.