From 85cebdb7e94ab901ab2db975e98db96aebff3625 Mon Sep 17 00:00:00 2001 From: Ben Hollis Date: Fri, 30 May 2014 23:19:33 -0700 Subject: [PATCH] rubocop --- middleman-core/lib/middleman-core/core_extensions.rb | 1 - .../lib/middleman-core/core_extensions/front_matter.rb | 9 +-------- .../lib/middleman-core/core_extensions/i18n.rb | 4 +++- .../lib/middleman-core/sitemap/extensions/redirects.rb | 1 + .../sitemap/extensions/request_endpoints.rb | 1 + 5 files changed, 6 insertions(+), 10 deletions(-) diff --git a/middleman-core/lib/middleman-core/core_extensions.rb b/middleman-core/lib/middleman-core/core_extensions.rb index 4ff25339..1177eefe 100644 --- a/middleman-core/lib/middleman-core/core_extensions.rb +++ b/middleman-core/lib/middleman-core/core_extensions.rb @@ -50,7 +50,6 @@ Middleman::Extensions.register :routing, auto_activate: :before_configuration do Middleman::CoreExtensions::Routing end - ### # Setup Optional Extensions ### diff --git a/middleman-core/lib/middleman-core/core_extensions/front_matter.rb b/middleman-core/lib/middleman-core/core_extensions/front_matter.rb index 42e8ee98..234e5a01 100644 --- a/middleman-core/lib/middleman-core/core_extensions/front_matter.rb +++ b/middleman-core/lib/middleman-core/core_extensions/front_matter.rb @@ -43,9 +43,7 @@ module Middleman::CoreExtensions # TODO: Should we make people put these under "options" instead of having # special known keys? opts = fmdata.extract!(:layout, :layout_engine, :renderer_options, :directory_index, :content_type) - if opts.has_key?(:renderer_options) - opts[:renderer_options].symbolize_keys! - end + opts[:renderer_options].symbolize_keys! if opts.key?(:renderer_options) ignored = fmdata.delete(:ignored) @@ -54,9 +52,6 @@ module Middleman::CoreExtensions resource.add_metadata options: opts, page: fmdata - # TODO: resource.ignore! if ignored - # TODO: This doesn't really work because resources can't themselves be ignored / when - # an ignore rule is in place it's forever resource.ignore! if ignored == true && !resource.proxy? # TODO: Save new template here somewhere? @@ -84,8 +79,6 @@ module Middleman::CoreExtensions data = external_data.deep_merge(data) end - - [data, content] end end diff --git a/middleman-core/lib/middleman-core/core_extensions/i18n.rb b/middleman-core/lib/middleman-core/core_extensions/i18n.rb index 6f4f0012..c6284226 100644 --- a/middleman-core/lib/middleman-core/core_extensions/i18n.rb +++ b/middleman-core/lib/middleman-core/core_extensions/i18n.rb @@ -81,7 +81,9 @@ class Middleman::CoreExtensions::Internationalization < ::Middleman::Extension # This is for backwards compatibility with the old provides_metadata-based code # that used to be in this extension, but I don't know how much sense it makes. - #resource.add_metadata options: { lang: @mount_at_root }, locals: { lang: @mount_at_root } + unless resource.options[:lang] + resource.add_metadata options: { lang: @mount_at_root }, locals: { lang: @mount_at_root } + end end resources + new_resources diff --git a/middleman-core/lib/middleman-core/sitemap/extensions/redirects.rb b/middleman-core/lib/middleman-core/sitemap/extensions/redirects.rb index 60e5bdbb..3f4dafd1 100644 --- a/middleman-core/lib/middleman-core/sitemap/extensions/redirects.rb +++ b/middleman-core/lib/middleman-core/sitemap/extensions/redirects.rb @@ -83,6 +83,7 @@ module Middleman false end + # rubocop:disable AccessorMethodName def get_source_file '' end 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 b89ec083..4f5a646e 100644 --- a/middleman-core/lib/middleman-core/sitemap/extensions/request_endpoints.rb +++ b/middleman-core/lib/middleman-core/sitemap/extensions/request_endpoints.rb @@ -72,6 +72,7 @@ module Middleman false end + # rubocop:disable AccessorMethodName def get_source_file '' end