Sha256: cf56105c605279a1e74a4e46a8a1f48bb430bb5d41a0d36452f78d28bdadb313

Contents?: true

Size: 810 Bytes

Versions: 5

Compression:

Stored size: 810 Bytes

Contents

Kms::ExternalsRegistry.register(:request) {|request, controller| Liquor::Rails::Request.new(request, controller) }
Kms::ExternalsRegistry.register(:index) {|_,_| Kms::Page.find_by_slug!("index").to_drop }
Kms::ExternalsRegistry.register(:page) do |request,_|
    page_fetcher = Kms::PageFetcher.new(request.params[:path] || Kms::Page::INDEX_FULLPATH)
    page_fetcher.fetch!
end
Kms::ExternalsRegistry.register(:item) do |request,controller|
  page = Kms::ExternalsRegistry.externals[:page].call(request, controller)
  if page && page.source.templatable?
    page.source.fetch_item(File.basename(request.params[:path])).try(:to_drop)
  end
end
Kms::ExternalsRegistry.register(:search) do |request,_|
  search_service = Kms::SearchService.new(request.params[:query])
  search_service.search
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
kms-1.2.1 config/initializers/externals.rb
kms-1.2.0 config/initializers/externals.rb
kms-1.1.0 config/initializers/externals.rb
kms-1.0.1 config/initializers/externals.rb
kms-1.0.0 config/initializers/externals.rb