lib/code_web/code_parser.rb
# mark the context of the method call.
# optionally indents output as well
# @param name [String] name of the block - file, module, class, method, 'yield'
# @param indent [boolean] (false) indent this block (pass :static if this is a static method)
# @param class_def [boolean] (false) true if this is a class definition
mark the context of the method call.
optionally indents output as well
mark the context of the method call . optionally indents output as well
def in_context name, indent=false, class_def=false
      name = collapse_ast(name) 
      @cur_method << [ name, class_def, indent == :static]
      puts ">> #{'self.' if static?}#{src}" if debug? && indent
      @indent += 1 if indent
      ret = yield
      @indent -= 1 if indent
      @cur_method.pop
      ret
    end
def in_context name , indent = false , class_def = false name = collapse_ast ( name ) @cur_method << [ name , class_def , indent == :static ] puts ">> #{'self.' if static?}#{src}" if debug? && indent @indent += 1 if indent ret = yield @indent -= 1 if indent @cur_method . pop ret end
mark the context of the method call.
mark the context of the method call .
#split("::").last
name
name of the block - file, module, class, method, 'yield'
name of the block - file module class method ' yield '
indent
(false) indent this block (pass :static if this is a static method)
( false ) indent this block ( pass : static if this is a static method )
class_def
(false) true if this is a class definition
( false ) true if this is a class definition