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
LOOKUP_CHAIN = [:params, :user, :session, :http, :default] | |
# hairy and cryptic | |
def self.set_by | |
lookup = LOOKUP_CHAIN.each | |
begin | |
meth = lookup.next | |
end while !(locale = send("by_#{meth}", meth) rescue nil); | |
locale | |
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
# cd into a matching gem directory. Pass a grep compatible | |
# regular expression. If you don't pass anything, it goes | |
# to the root gem directory. | |
cdgem () | |
{ | |
local gempath=$(gem env gemdir)/gems; | |
if [[ $1 == "" ]]; then | |
pushd $gempath; | |
return; | |
fi; |
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
module Boolean | |
end | |
class TrueClass | |
include Boolean | |
end | |
class FalseClass | |
include Boolean | |
end |
OlderNewer