Sha256: 7919efc5972abf81dcb9dc2268f6139175fe8384393e098d45d54f4e9780775f
Contents?: true
Size: 1.38 KB
Versions: 7
Compression:
Stored size: 1.38 KB
Contents
require "padrino-helpers" require "rack" require "sprockets" require "sprockets-helpers" module Machined class Context < Sprockets::Context include Helpers::OutputHelpers include Padrino::Helpers::OutputHelpers include Padrino::Helpers::TagHelpers include Padrino::Helpers::AssetTagHelpers include Padrino::Helpers::FormHelpers include Padrino::Helpers::FormatHelpers include Padrino::Helpers::NumberHelpers include Padrino::Helpers::TranslationHelpers include Helpers::AssetTagHelpers include Helpers::LocalsHelpers include Helpers::PageHelpers include Helpers::RenderHelpers # Override initialize to add helpers # from the Machined environment. def initialize(*args) # :nodoc: super add_machined_helpers end # Returns the main Machined environment instance. def machined environment.machined end # Returns the configuration of the Machined environment. def config machined.config end protected # Loops through the helpers added to the Machined # environment and adds them to the Context. Supports # blocks and Modules. def add_machined_helpers # :nodoc: machined.context_helpers.each do |helper| case helper when Proc instance_eval &helper when Module extend helper end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems