Skip to content

Instantly share code, notes, and snippets.

class Module
alias_method :include_without_hooks, :include
def include(*modules)
include_before_hook(*modules)
include_without_hooks(*modules)
include_after_hook(*modules)
end
def include_before_hook(*modules)
> ruby -rmath_functions.rb -e "puts MathFunctions.factorial(2)"
2
> ruby --test -rmath_functions.rb
.
Finished in 1.000706 seconds.
1 tests, 2 assertions, 0 failures, 0 errors
@foysavas
foysavas / haml_converter.rb
Created February 29, 2012 17:45 — forked from radamant/haml_converter.rb
Haml, Sass, and Scss conversion for jekyll
module Jekyll
require 'haml'
class HamlConverter < Converter
safe true
priority :low
def matches(ext)
ext =~ /haml/i
end