Method: CodeWeb::CodeParser#parse
- Defined in:
- lib/code_web/code_parser.rb
#parse(file_name, file_data = nil, required_string = nil) ⇒ Object
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 |
# File 'lib/code_web/code_parser.rb', line 174 def parse(file_name, file_data=nil, required_string=nil) #may make more sense to get this into cli (and an option for absolute path) file_name = File.realpath(file_name) file_data ||= File.binread(file_name) begin if required_string.nil? || file_data.include?(required_string) in_context file_name do traverse RubyParser.new.process(file_data, file_name) end end @file_count += 1 rescue => e STDERR.puts("#{e}: [#{file_data.size}] #{file_name}") end end |