Module: Kernel

Defined in:
lib/jets/core_ext/kernel.rb

Class Method Summary collapse

Class Method Details

.jets_original_requireObject



4
# File 'lib/jets/core_ext/kernel.rb', line 4

alias_method :jets_original_require, :require

.require(path) ⇒ Boolean

Parameters:

  • path (String)

Returns:

  • (Boolean)


7
8
9
10
11
12
# File 'lib/jets/core_ext/kernel.rb', line 7

def require(path)
  # Hack to prevent Rails const from being defined
  # Actionview requires "rails-html-sanitizer" and that creates a Rails module
  path = "jets-html-sanitizer" if path == "rails-html-sanitizer" && !ENV['JETS_RAILS_CONST']
  jets_original_require(path)
end