Class: Git::Approvals::AwesomePrintFormatter

Inherits:
Tilt::Template
  • Object
show all
Defined in:
lib/git/approvals/awesome_print_formatter.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.engine_initialized?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/git/approvals/awesome_print_formatter.rb', line 7

def self.engine_initialized?
  defined?(::AwesomePrint)
end

Instance Method Details

#evaluate(context, locals, &block) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/git/approvals/awesome_print_formatter.rb', line 18

def evaluate( context, locals, &block )
  # TODO use locals as options to the formatter
  # TODO require awesome_print/inspector to not pollute kernel, etc
  context.awesome_inspect \
    :plain  => true,
    :indent => -2
end

#initialize_engineObject



11
12
13
# File 'lib/git/approvals/awesome_print_formatter.rb', line 11

def initialize_engine
  require_template_library 'awesome_print'
end

#prepareObject



15
16
# File 'lib/git/approvals/awesome_print_formatter.rb', line 15

def prepare
end