module Ekylibre::PluginSystem::Sugar::Themes

Syntactic sugar to ease the registration of Themes and ThemeAddon into the container

Public Instance Methods

register_theme(theme, container:) click to toggle source
# File lib/ekylibre/plugin_system/sugar/themes.rb, line 28
def register_theme(theme, container:)
  container.add_definition(
    self.class.make_definition("themes.#{theme}", Ekylibre::View::Themes::Theme) { tag 'ekylibre.view.theme' },
    context: { theme: theme }
  ) do |ctx|
    args value(ctx.theme)
  end
end
register_theme_addons(addons, container:) click to toggle source

@param [Array<String>] addons @param [Corindon::DependencyInjection::Container] container

# File lib/ekylibre/plugin_system/sugar/themes.rb, line 13
def register_theme_addons(addons, container:)
  addons.each do |relative_path|
    container.add_definition(
      self.class.make_definition(relative_path, Ekylibre::View::Themes::ThemeAddon) { tag 'ekylibre.view.theme_addon' },
      context: { path: relative_path, origin: self.name }
    ) do |ctx|
      args for_theme: value('tekyla'), relative_path: value(ctx.path), origin: value(ctx.name)
    end
  end
end
register_themes(themes, container:) click to toggle source
# File lib/ekylibre/plugin_system/sugar/themes.rb, line 24
def register_themes(themes, container:)
  themes.each { |theme| register_theme(theme, container: container) }
end