edavis10 (owner)

Revisions

gist: 200147 Download_button fork
public
Public Clone URL: git://gist.github.com/200147.git
Embed All Files: show embed
init.rb #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
module PatchingProjectForEirikb
  def self.included(base) # :nodoc:
    base.send(:include, InstanceMethods)
 
    # Same as typing in the class
    base.class_eval do
      unloadable # Send unloadable so it will not be unloaded in development
 
      after_save :do_something
    end
 
  end
  
  module ClassMethods
  end
  
  module InstanceMethods
    def do_something
      # Shell out or whatever here...
    end
  end
end
 
require 'dispatcher'
 
Dispatcher.to_prepare do
  Project.send(:include, PatchingProjectForEirikb)
end