Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adds custom footers.

  • Loading branch information...
commit a40bcafdab0ceec1ca27550b42ef93ec812db85e 1 parent 1a967e7
Michael Bleigh authored
Showing with 14 additions and 1 deletion.
  1. +1 −0  lib/censorstrike.rb
  2. +2 −1  message.html
  3. +11 −0 spec/censorstrike_spec.rb
View
1  lib/censorstrike.rb
@@ -32,6 +32,7 @@ def now
def render
response = Rack::Response.new([], 503, 'Content-Type' => 'text/html')
body = options[:message] ? options[:message] : File.read(options[:file])
+ body.gsub!("{{footer}}", options[:footer] || "")
response.write(body)
response.finish
end
View
3  message.html
@@ -53,7 +53,7 @@
<h1>We Stand With The Internet</h1>
<div id='main_message'>
- <p>We apologize, but our site's normal content will be unavailable until 8pm Eastern time today. We have joined with other communities including <a href='http://reddit.com'>Reddit</a> and <a href='http://wikipedia.org'>Wikipedia</a> in using this one day to send a clear message of protest against legislation that stands to threaten everything amazing that has been built on the internet.</p>
+ <p>Our site's normal content will be unavailable until 8pm Eastern time today. We have joined with other communities including <a href='http://reddit.com'>Reddit</a> and <a href='http://wikipedia.org'>Wikipedia</a> in using this one day to send a clear message of protest against legislation that stands to threaten everything amazing that has been built on the internet.</p>
<p>The Stop Online Piracy Act (SOPA) in the House of Representatives and the Protect Intellectual Property Act (PIPA) in the Senate pose a very real threat to the freedom, collaboration, and openness of the internet. While ostensibly aimed to curtail illegal activities by foreign websites, these bills contain provisions and measures that amount to legal enforcement without due process and, in some cases, could very well damage the infrastructure of the internet as a whole.</p>
@@ -61,5 +61,6 @@
</div>
<div id='small_message'>Do you have a website? Join the protest, <a href='http://github.com/intridea/censorstrike'>add this message</a> to your own pages!</div>
+ {{footer}}
</body>
</html>
View
11 spec/censorstrike_spec.rb
@@ -28,5 +28,16 @@
get '/'
last_response.body.should == 'Down with censorship!'
end
+
+ it 'should not contain {{footer}}' do
+ get '/'
+ last_response.body.should_not be_include("{{footer}}")
+ end
+
+ it 'should be able to have a custom footer' do
+ options.merge!(:footer => "custom footer")
+ get '/'
+ last_response.body.should be_include("custom footer")
+ end
end
end

0 comments on commit a40bcaf

Please sign in to comment.
Something went wrong with that request. Please try again.