diff --git a/middleman-core/lib/middleman-core/core_extensions/data.rb b/middleman-core/lib/middleman-core/core_extensions/data.rb index db2c985e..205021d4 100644 --- a/middleman-core/lib/middleman-core/core_extensions/data.rb +++ b/middleman-core/lib/middleman-core/core_extensions/data.rb @@ -11,7 +11,7 @@ module Middleman # Make the internal `data_store` method available as `app.data` expose_to_application data: :data_store - + # Exposes `data` to templates expose_to_template data: :data_store diff --git a/middleman-core/lib/middleman-core/extension.rb b/middleman-core/lib/middleman-core/extension.rb index ab9daea1..2c15eef0 100644 --- a/middleman-core/lib/middleman-core/extension.rb +++ b/middleman-core/lib/middleman-core/extension.rb @@ -198,7 +198,7 @@ module Middleman end # Takes a method within this extension and exposes it inside the scope - # of the config.rb sandbox. + # of the config.rb sandbox. # @example with Hash: # expose_to_config global_name: :local_name # @example with Array: @@ -405,7 +405,7 @@ module Middleman elsif g.is_a? Symbol definition = method(g) - if definition.arity === 0 + if definition.arity == 0 send(g) else send(g, resources) @@ -421,7 +421,7 @@ module Middleman if g.is_a? Symbol definition = method(g) - g = if definition.arity === 0 + g = if definition.arity == 0 send(g) else send(g, resources) diff --git a/middleman-core/lib/middleman-core/renderers/haml.rb b/middleman-core/lib/middleman-core/renderers/haml.rb index 1ed893ac..8f98ddc6 100644 --- a/middleman-core/lib/middleman-core/renderers/haml.rb +++ b/middleman-core/lib/middleman-core/renderers/haml.rb @@ -51,10 +51,9 @@ module Middleman def add_exposed_to_context(context) super - + context.init_haml_helpers if context.respond_to?(:init_haml_helpers) end - end end end diff --git a/middleman-core/lib/middleman-core/renderers/kramdown.rb b/middleman-core/lib/middleman-core/renderers/kramdown.rb index 9dcdf23e..c93d254d 100644 --- a/middleman-core/lib/middleman-core/renderers/kramdown.rb +++ b/middleman-core/lib/middleman-core/renderers/kramdown.rb @@ -6,7 +6,7 @@ module Middleman class KramdownTemplate < ::Tilt::KramdownTemplate def evaluate(scope, *) @output ||= begin - MiddlemanKramdownHTML.scope = ::Middleman::Renderers::Haml.last_haml_scope || scope + MiddlemanKramdownHTML.scope = (defined?(::Middleman::Renderers::Haml) && ::Middleman::Renderers::Haml.last_haml_scope) ? ::Middleman::Renderers::Haml.last_haml_scope : scope output, warnings = MiddlemanKramdownHTML.convert(@engine.root, @engine.options) @engine.warnings.concat(warnings) diff --git a/middleman-core/lib/middleman-core/sitemap/extensions/redirects.rb b/middleman-core/lib/middleman-core/sitemap/extensions/redirects.rb index c002a0b2..e42d34dc 100644 --- a/middleman-core/lib/middleman-core/sitemap/extensions/redirects.rb +++ b/middleman-core/lib/middleman-core/sitemap/extensions/redirects.rb @@ -7,7 +7,6 @@ module Middleman # Manages the list of proxy configurations and manipulates the sitemap # to include new resources based on those configurations class Redirects < Extension - # Expose `create_redirect` to config as `redirect` expose_to_config redirect: :create_redirect diff --git a/middleman-core/lib/middleman-core/sitemap/extensions/request_endpoints.rb b/middleman-core/lib/middleman-core/sitemap/extensions/request_endpoints.rb index 9b976fdd..fc66cd71 100644 --- a/middleman-core/lib/middleman-core/sitemap/extensions/request_endpoints.rb +++ b/middleman-core/lib/middleman-core/sitemap/extensions/request_endpoints.rb @@ -4,7 +4,6 @@ module Middleman module Sitemap module Extensions class RequestEndpoints < Extension - # Expose `create_endpoint` to config as `endpoint` expose_to_config endpoint: :create_endpoint