Parent

Class/Module Index [+]

Quicksearch

Compass::Stats::SassFile

Attributes

path[RW]
visitor[R]

Public Class Methods

new(path) click to toggle source
# File lib/compass/stats.rb, line 58
def initialize(path)
  self.path = path
end

Public Instance Methods

analyze!() click to toggle source
# File lib/compass/stats.rb, line 74
def analyze!
  visit_tree!
end
contents() click to toggle source
# File lib/compass/stats.rb, line 61
def contents
  @contents ||= File.read(path)
end
lines() click to toggle source
# File lib/compass/stats.rb, line 77
def lines
  contents.inject(0){|m,c| m + 1 }
end
mixin_count() click to toggle source
# File lib/compass/stats.rb, line 89
def mixin_count
  visitor.mixin_count
end
mixin_def_count() click to toggle source
# File lib/compass/stats.rb, line 86
def mixin_def_count
  visitor.mixin_def_count
end
prop_count() click to toggle source
# File lib/compass/stats.rb, line 83
def prop_count
  visitor.prop_count
end
rule_count() click to toggle source
# File lib/compass/stats.rb, line 80
def rule_count
  visitor.rule_count
end
tree() click to toggle source
# File lib/compass/stats.rb, line 64
def tree
  opts = Compass.configuration.to_sass_engine_options
  opts[:syntax] = path[-4..-1].to_sym
  @tree = Sass::Engine.new(contents, opts).to_tree
end
visit_tree!() click to toggle source
# File lib/compass/stats.rb, line 69
def visit_tree!
  @visitor = StatsVisitor.new
  tree.visit_depth_first(@visitor)
  @visitor
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.