lib/procemon/function/proc_source/proc.rb in procemon-0.2.0 vs lib/procemon/function/proc_source/proc.rb in procemon-0.3.1

- old
+ new

@@ -4,19 +4,25 @@ # the right bindings using the .to_proc call from String methods class << self attr_accessor :source_cache end Proc.source_cache= Hash.new - def source + def source(test=nil) # defaults begin return_string= ProcSource.new block= 0 end + unless test.nil? + puts Proc.source_cache.inspect + puts self.object_id + end + unless Proc.source_cache[self.object_id].nil? return Proc.source_cache[self.object_id] else + File.open(File.expand_path(self.source_location[0]) ).each_line_from self.source_location[1] do |line| block += line.source_formater_for_line_sub return_string.concat(line) break if block == 0 \ No newline at end of file