Files

Rcodetools::XMPDocFilter::UseMethodAnalyzer

Constants

METHOD_ANALYSIS

Public Instance Methods

_doc(code, lineno, column=nil) click to toggle source
     # File lib/rcodetools/doc.rb, line 117
117:     def _doc(code, lineno, column=nil)
118:       find_method_analysis do |ma_file|
119:         methods = open(ma_file, "rb"){ |f| Marshal.load(f)}
120:         line = File.readlines(@filename)[lineno-1]
121:         current_method = line[ /^.{#{column}}\w*/][ /\w+[\?!]?$/ ].sub(/:+/,'')
122:         filename = @filename  # FIXME
123:         begin 
124:           methods[filename][lineno].grep(Regexp.new(Regexp.quote(current_method)))[0]
125:         rescue NoMethodError
126:           raise "doc/method_analyzer:cannot find #{current_method}"
127:         end
128: 
129:       end
130:     end
find_method_analysis() click to toggle source
     # File lib/rcodetools/doc.rb, line 100
100:     def find_method_analysis
101:       here = Dir.pwd
102:       oldpwd = here
103:       begin
104:         while ! have_method_analysis
105:           Dir.chdir("..")
106:           if Dir.pwd == here
107:             return nil          # not found
108:           end
109:           here = Dir.pwd
110:         end
111:       ensure
112:         Dir.chdir oldpwd
113:       end
114:       yield(File.join(here, METHOD_ANALYSIS))
115:     end
have_method_analysis() click to toggle source
    # File lib/rcodetools/doc.rb, line 96
96:     def have_method_analysis
97:       File.file? METHOD_ANALYSIS
98:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.