This file contains 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
# LAME | |
if a > b | |
foo = a | |
else | |
foo = b | |
end | |
# SWEET | |
foo = if a > b | |
a |
This file contains 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
Config.new { | |
_'the description of the next variable' | |
foo 42 | |
_'the description of bar' | |
bar { | |
_'the description of baz' | |
baz 3.14159 | |
} | |
} |
This file contains 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 WikiTrail | |
def wiki_trail( *args ) | |
links = args.flatten.map do |name| | |
"> #{link_to_page_unless_current name} <" | |
end | |
links.join(" ") | |
end | |
end |
This file contains 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
class Webby::Resources::Page < Webby::Resources::Resource | |
alias :_initialize :initialize | |
def initialize( fn, meta_data = nil ) | |
_initialize(fn, meta_data) | |
# put your initialization code here | |
end | |
end |
This file contains 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
class Logging::Appenders::TimestampRollingFile < Logging::Appenders::RollingFile | |
def initialize( name, opts = {} ) | |
super | |
@date_fmt = '%Y%m%d' | |
@logname_fmt.sub!(%r/\.%d/, '.%s') | |
end | |
def roll_files |
This file contains 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
--- | |
filter: | |
- textile | |
- outline | |
--- | |
<toc /> | |
h1. Foo | |
h2. Bar |
This file contains 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
class Module | |
# call-seq: | |
# logger_name #=> string | |
# | |
# Returns a predictable logger name for the current module or class. If | |
# used within an anonymous class, the first non-anonymous class name will | |
# be used as the logger name. If used within a meta-class, the name of the | |
# actual class will be used as the logger name. If used within an | |
# anonymous module, the string 'anonymous' will be returned. |
NewerOlder