Module: ViewInspect

Defined in:
lib/view_inspect/client_side_template.rb,
lib/view_inspect.rb,
lib/view_inspect/version.rb,
lib/view_inspect/handlers/eco.rb,
lib/view_inspect/handlers/ejs.rb,
lib/view_inspect/handlers/erb.rb,
lib/view_inspect/handlers/jst.rb,
lib/view_inspect/handlers/haml.rb,
lib/view_inspect/handlers/slim.rb,
lib/view_inspect/rails/railtie.rb,
lib/view_inspect/handlers/handlebars.rb,
lib/view_inspect/server_side_template.rb,
lib/view_inspect/handlers/html_template.rb

Overview

Were monkey patching subclasses of Tilt::Template to add file:line information to the original source

Defined Under Namespace

Modules: ClientSideTemplate, Handlers, Rails, ServerSideTemplate

Constant Summary collapse

VERSION =
"0.3.8"

Class Method Summary collapse

Class Method Details

.allow_view_source_location?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/view_inspect.rb', line 15

def self.allow_view_source_location?
  !@disable && ::Rails.env.development?
end

.disable=(bool) ⇒ Object



19
20
21
# File 'lib/view_inspect.rb', line 19

def self.disable=(bool)
  @disable = bool
end

.initObject



6
7
8
9
10
11
12
13
# File 'lib/view_inspect.rb', line 6

def self.init
  return unless allow_view_source_location?

  ServerSideTemplate.handle
  ClientSideTemplate.handle

  @show_html_syntax_error = false
end

.show_html_syntax_error=(bool) ⇒ Object



27
28
29
# File 'lib/view_inspect.rb', line 27

def self.show_html_syntax_error=(bool)
  @show_html_syntax_error = bool
end

.show_html_syntax_error?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/view_inspect.rb', line 23

def self.show_html_syntax_error?
  @show_html_syntax_error
end