Skip to content
This repository has been archived by the owner on Jul 8, 2019. It is now read-only.

Commit

Permalink
More rdoc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
zargony committed Feb 28, 2009
1 parent aff9cc7 commit 7f429e7
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/css_naked.rb
@@ -1,7 +1,13 @@
#
# This Rails plugin overrides the stylesheet_link_tag helper and modifies
# it to skip outputting stylesheet link tags on css naked day. Css naked
# day is an annual event where websites remove all css from their site to
# promote web standards. See http://naked.dustindiaz.com for more info.
#
module CssNaked
module ViewHelpers
class << self
def included (base)
def included (base) # :nodoc:
base.class_eval do
alias_method_chain :stylesheet_link_tag, :css_naked
end
Expand All @@ -15,12 +21,12 @@ def included (base)
# See also http://naked.dustindiaz.com/
@@css_naked_date = Date.new(2009, 4, 9).to_time(:utc).freeze

# Returns true if today is a CSS-naked-day
# Returns true if today is a css naked day
def css_naked?
Time.current >= @@css_naked_date - 12.hours && Time.current <= @@css_naked_date + 35.hours
end

# Modified stylesheet_link_tag that does nothing on CSS-naked-day
# Modified stylesheet_link_tag that does nothing on css naked day
def stylesheet_link_tag_with_css_naked (*args)
stylesheet_link_tag_without_css_naked(*args) unless css_naked?
end
Expand Down

0 comments on commit 7f429e7

Please sign in to comment.