Created
January 19, 2012 11:07
-
-
Save dcarley/1639440 to your computer and use it in GitHub Desktop.
Comparison of foo.is_a?(Array) and [foo].flatten in ERB templates.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% if not nocache.empty? -%> | |
# Disable caching for certain locations. | |
if (req.url ~ "<%= [nocache].flatten.join('" || | |
req.url ~ "') -%>") { | |
return(pass); | |
} | |
<% end -%> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% if not nocache.empty? -%> | |
# Disable caching for certain locations. | |
<% if nocache.is_a?(Array) -%> | |
if (req.url ~ "<%= nocache.join('" || | |
req.url ~ "') -%>") { | |
<% else -%> | |
if (req.url ~ "<%= nocache -%> ") { | |
<% end -%> | |
return(pass); | |
} | |
<% end -%> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
forwarders { <%= cobbler_dns_forwarders.is_a?(Array) ? cobbler_dns_forwarders.join("; ") : cobbler_dns_forwarders -%>; }; | |
forwarders { <%= [cobbler_dns_forwarders].flatten.join("; ") -%>; }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment