Module: Kernel

Defined in:
lib/gg/core.rb

Instance Method Summary collapse

Instance Method Details

#gg(*args) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/gg/core.rb', line 10

def gg(*args)
  #ap args
  #ap caller
  #$gg << "<h1>JFKLDJSKLFSDJKL</h1>"
  #ap '======================'
  #ap args.size
  stack = gg_caller
  history = GG::History.new
  # case args.size
  # when 1
    # $gg << GG.render( 'slim/logger.slim', { stack: stack } ) do
      # args[0].to_hi_html({})
    # end
  # else
  
  # RENDER HTML
  $gg << GG.render( 'slim/logger_with_multiple_variables.slim', 
    line: caller[0],
    objects: args,
    history: history,
    stack: stack
  )
  
  # RENDER CONSOLE
  $gg.console_array << <<-EOF
#{'-'*79}
#{caller[0]}
#{stack[0].code_line.strip}
#{'.'*79}
#{args.ai({})}
  EOF
  # end
end

#gg_caller(start = 1) ⇒ Object



4
5
6
7
8
# File 'lib/gg/core.rb', line 4

def gg_caller(start=1)
  # we add another +1 because we have to remove the current #hi_caller call
  # from the stack.
  GG::Stack.new(caller(start+1))
end

#gg_render_error(e) ⇒ Object



44
45
46
# File 'lib/gg/core.rb', line 44

def gg_render_error(e)
  e.inspect
end