Refactor
:my
=>
'code'
Codes
Refactorings
Popular
Best
Submit
Spam
Account
Logout
Login
JavaScript doesn't seem to be activated, expect things to be ugly and sloppy!
Learn How to Create Your Own Programming Language
createyourproglang.com
Recent
Simple Particle Engine for a shooter game
Snake / Nibbles clone in C and Ncurses
Please improve
Parsing of XML data has high CPU usage
Convert simple Javascript to jQuery plugin
Active Record getting unique records
List the files in a directory without the directory name or the extension
clean the code
ohs system, recruitment software, hr software, oh&s software, human resources software, ohs software
Array parsing in a block
Popular
Parsing of XML data has high CPU usage
Please improve
Snake / Nibbles clone in C and Ncurses
List the files in a directory without the directory name or the extension
Convert simple Javascript to jQuery plugin
Simple Particle Engine for a shooter game
Active Record getting unique records
Breadth first cartesian product iterator
php refactoring
first BST
Pastable version of
Including modules degradably
<pre class='prettyprint' language='ruby'>module Facon module Baconize # Mixin intended for Bacon::Context so that it runs spec_verify on all mocks # after each example. module ContextExtensions def self.included(base) base.class_eval do alias_method :it_without_mock_verification, :it alias_method :it, :it_with_mock_verification end end def it_with_mock_verification(description, &block) setup_facon_mocks it_without_mock_verification(description, &block) verify_facon_mocks end end module ShouldExtensions def receive(method, &block) end end end end begin Bacon::Context.class_eval { include Facon::Baconize::ContextExtensions } Should.class_eval { include Facon::Baconize::ShouldExtensions } rescue NameError require 'rubygems' require 'bacon' Bacon::Context.class_eval { include Facon::Baconize::ContextExtensions } Should.class_eval { include Facon::Baconize::ShouldExtensions } rescue LoadError puts 'Bacon is not available.' end</pre> <a href="http://www.refactormycode.com/codes/230-including-modules-degradably" style="color:#fff" title="As seen on RefactorMyCode.com"><img alt="Small_logo" src="http://www.refactormycode.com/images/small_logo.gif" style="border:0" /></a>