Module: BulletTrain::Themes

Defined in:
lib/tasks/application.rb,
lib/bullet_train/themes.rb,
lib/bullet_train/themes/engine.rb,
lib/bullet_train/themes/version.rb

Defined Under Namespace

Modules: Application, Base Classes: Engine

Constant Summary collapse

INVOCATION_PATTERNS =
[
  # ❌ This path is included for legacy purposes, but you shouldn't reference partials like this in new code.
  /^account\/shared\//,

  # ✅ This is the correct path to generically reference theme component partials with.
  /^shared\//,
]
VERSION =
"1.7.22"

Class Method Summary collapse

Class Method Details

.theme_invocation_path_for(path) ⇒ Object



22
23
24
25
26
27
# File 'lib/bullet_train/themes.rb', line 22

def self.theme_invocation_path_for(path)
  # Themes only support `<%= render 'shared/box' ... %>` style calls to `render`, so check `path` is a string first.
  if path.is_a?(String) && (pattern = INVOCATION_PATTERNS.find { _1.match? path })
    path.remove(pattern)
  end
end