Sha256: fe4786bc71ff0e63f74cf04dba7e767354d89a1aabb8b68ea344403cee0ae25b

Contents?: true

Size: 692 Bytes

Versions: 4

Compression:

Stored size: 692 Bytes

Contents

# Copyright: Copyright 2009 Topic Maps Lab, University of Leipzig.
# License:   Apache License, Version 2.0

enable_persistent_code_output = false
class Module
  alias :module_eval_without_output :module_eval
  def module_eval(code,file,line)
    module_eval_without_output(code,file,line)
    File.open("/tmp/rtm.rb","a") do |f|
      #puts self, self.class
      @@first_class = true
      @@last_self ||= nil
      if ! @@last_self || @@last_self != self
        f.puts "end\n\n" unless @@first_class
        @@first_class = false
        @@last_self = self
        f.puts "#{self.class.to_s.downcase} #{self}"
      end
      f.puts code
    end
  end
end if enable_persistent_code_output

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rtm-activerecord-0.3.1 lib/rtm/activerecord/persistent_code_output.rb
rtm-activerecord-0.3.0 lib/rtm/activerecord/persistent_code_output.rb
rtm-activerecord-0.2.1 lib/rtm/activerecord/persistent_code_output.rb
rtm-activerecord-0.2.0 lib/rtm/activerecord/persistent_code_output.rb