Method: FeatureMap::Private::TodoInspector#calculate
- Defined in:
- lib/feature_map/private/todo_inspector.rb
#calculate ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/feature_map/private/todo_inspector.rb', line 25 def calculate todos = {} content = File.read(@file_path) in_comment = false content.each_line.with_index do |line, index| in_comment ||= line.match?(ENTERING_COMMENT) if in_comment && (match = line.match(TODO_PATTERN)) todos["#{@file_path}:#{index + 1}"] = match[:content].strip end in_comment &&= !line.match?(EXITING_COMMENT) end todos end |