# File lib/less/engine.rb, line 15 15: def initialize obj, options = {} 16: @less = if obj.is_a? File 17: @path = File.dirname File.expand_path(obj.path) 18: obj.read 19: elsif obj.is_a? String 20: obj.dup 21: else 22: raise ArgumentError, "argument must be an instance of File or String!" 23: end 24: 25: @options = options 26: @parser = StyleSheetParser.new 27: end
# File lib/less/engine.rb, line 29 29: def parse build = true, env = Node::Element.new 30: root = @parser.parse(self.prepare) 31: 32: return root unless build 33: 34: if root 35: @tree = root.build env.tap {|e| e.file = @path } 36: else 37: raise SyntaxError, @parser.failure_message(@options[:color]) 38: end 39: 40: @tree 41: end
# File lib/less/engine.rb, line 48 48: def prepare 49: @less.gsub(/\r\n/, "\n").gsub(/\t/, ' ') 50: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.