Class: Churn::LocationMapping

### Home Classes Methods

### In Files

- lib/churn/location_mapping.rb

### Parent

SexpProcessor

### Methods

- ::new
- #analyze_list
- #get_info
- #process_class
- #process_defn

### Files

- LICENSE
- README.rdoc

### Class/Module Index

Quicksearch

- Churn
- Churn::ChurnCalculator
- Churn::ChurnHistory
- Churn::GitAnalyzer
- Churn::HgAnalyzer
- Churn::LocationMapping
- Churn::SourceControl
- Churn::SvnAnalyzer
- Object

No matching classes.

# Churn::LocationMapping

### Attributes

klasses_collection[R]
methods_collection[R]

### Public Class Methods

new() click to toggle source

    # File lib/churn/location_mapping.rb, line 7
    def initialize()
      super
      @klasses_collection  = {}
      @methods_collection  = {}
      @parser              = RubyParser.new
      self.auto_shift_type = true
    end

### Public Instance Methods

analyze_list(exp) click to toggle source

    # File lib/churn/location_mapping.rb, line 33
    def analyze_list exp
      process exp.shift until exp.empty?
    end

get_info(file) click to toggle source

    # File lib/churn/location_mapping.rb, line 15
    def get_info(file)
      ast = @parser.process(File.read(file), file)
      process ast
    end

process_class(exp) click to toggle source

    # File lib/churn/location_mapping.rb, line 20
    def process_class(exp)
      name           = exp.shift
      start_line     = exp.line
      last_line      = exp.last.line
      name           = name if name.is_a?(Symbol)
      name           = name.values.value if name.is_a?(Sexp) #deals with cases like class Test::Unit::TestCase
      @current_class = name
      @klasses_collection[name.to_s] = [] unless @klasses_collection.include?(name)
      @klasses_collection[name.to_s] << (start_line..last_line)
      analyze_list exp
      s()
    end

process_defn(exp) click to toggle source

    # File lib/churn/location_mapping.rb, line 37
    def process_defn(exp)
      name        = exp.shift
      start_line  = exp.line
      last_line   = exp.last.line
      full_name   = "#{@current_class}##{name}"
      @methods_collection[full_name] = [] unless @methods_collection.include?(full_name)
      @methods_collection[full_name] << (start_line..last_line)
      return s(:defn, name, process(exp.shift), process(exp.shift))
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.