~ubuntu-branches/ubuntu/oneiric/puppet/oneiric-security

« back to all changes in this revision

Viewing changes to vendor/gems/rspec/lib/spec/example/module_reopening_fix.rb

  • Committer: Bazaar Package Importer
  • Author(s): Micah Anderson
  • Date: 2008-07-26 15:43:45 UTC
  • mto: (3.1.1 lenny) (1.3.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 16.
  • Revision ID: james.westby@ubuntu.com-20080726154345-1fmgo76b4l72ulvc
ImportĀ upstreamĀ versionĀ 0.24.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
module Spec
 
2
  module Example
 
3
    # This is a fix for ...Something in Ruby 1.8.6??... (Someone fill in here please - Aslak)
 
4
    module ModuleReopeningFix
 
5
      def child_modules
 
6
        @child_modules ||= []
 
7
      end
 
8
 
 
9
      def included(mod)
 
10
        child_modules << mod
 
11
      end
 
12
 
 
13
      def include(mod)
 
14
        super
 
15
        child_modules.each do |child_module|
 
16
          child_module.__send__(:include, mod)
 
17
        end
 
18
      end
 
19
    end
 
20
  end
 
21
end
 
 
b'\\ No newline at end of file'