Applied Rubocop feedback.
This commit is contained in:
parent
c11a9e6f39
commit
dcc52d967c
9 changed files with 11 additions and 16 deletions
|
@ -35,13 +35,13 @@ module Middleman::Cli
|
|||
# Output a .gitignore file
|
||||
class_option :git, type: :boolean, default: true
|
||||
|
||||
no_tasks {
|
||||
no_tasks do
|
||||
# Write a .gitignore file for project
|
||||
# @return [void]
|
||||
def generate_gitignore!
|
||||
return unless options[:git]
|
||||
copy_file 'gitignore', File.join(name, '.gitignore')
|
||||
end
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -118,7 +118,6 @@ module Middleman
|
|||
# Set the value of a setting by key. Creates the setting if it doesn't exist.
|
||||
# @param [Symbol] key
|
||||
# @param [Object] val
|
||||
# rubocop:disable UselessSetterCall
|
||||
def []=(key, val)
|
||||
setting_obj = setting(key) || define_setting(key)
|
||||
setting_obj.value = val
|
||||
|
@ -228,7 +227,6 @@ module Middleman
|
|||
end
|
||||
|
||||
# Whether or not there has been a value set beyond the default
|
||||
# rubocop:disable TrivialAccessors
|
||||
def value_set?
|
||||
@value_set
|
||||
end
|
||||
|
|
|
@ -428,7 +428,7 @@ module Middleman
|
|||
|
||||
layout_path = locate_layout(layout_name, current_engine)
|
||||
|
||||
if !layout_path
|
||||
unless layout_path
|
||||
raise ::Middleman::CoreExtensions::Rendering::TemplateNotFound, "Could not locate layout: #{layout_name}"
|
||||
end
|
||||
|
||||
|
@ -462,7 +462,6 @@ module Middleman
|
|||
end
|
||||
|
||||
# The currently rendering engine
|
||||
# rubocop:disable TrivialAccessors
|
||||
# @return [Symbol, nil]
|
||||
def current_engine=(v)
|
||||
@_current_engine = v
|
||||
|
|
|
@ -130,7 +130,6 @@ module Middleman
|
|||
@klass.after_configuration do
|
||||
ext.after_configuration if ext.respond_to?(:after_configuration)
|
||||
|
||||
# rubocop:disable IfUnlessModifier
|
||||
if ext.respond_to?(:manipulate_resource_list)
|
||||
ext.app.sitemap.register_resource_list_manipulator(ext.class.extension_name, ext)
|
||||
end
|
||||
|
|
|
@ -17,7 +17,6 @@ module Middleman
|
|||
|
||||
module ResourceInstanceMethods
|
||||
# Whether this page is a proxy
|
||||
# rubocop:disable TrivialAccessors
|
||||
# @return [Boolean]
|
||||
def proxy?
|
||||
@proxied_to
|
||||
|
|
|
@ -102,13 +102,13 @@ class Middleman::CoreExtensions::DefaultHelpers < ::Middleman::Extension
|
|||
# Override helper to add `relative` opt-out.
|
||||
def stylesheet_link_tag(*sources)
|
||||
options = {
|
||||
:rel => 'stylesheet'
|
||||
rel: 'stylesheet'
|
||||
}.update(sources.extract_options!.symbolize_keys)
|
||||
|
||||
path_options = {}
|
||||
path_options[:relative] = options.delete(:relative) if options.key?(:relative)
|
||||
|
||||
sources.flatten.inject(ActiveSupport::SafeBuffer.new) do |all,source|
|
||||
sources.flatten.inject(ActiveSupport::SafeBuffer.new) do |all, source|
|
||||
all << tag(:link, {
|
||||
href: asset_path(:css, source, path_options)
|
||||
}.update(options))
|
||||
|
@ -122,7 +122,7 @@ class Middleman::CoreExtensions::DefaultHelpers < ::Middleman::Extension
|
|||
path_options = {}
|
||||
path_options[:relative] = options.delete(:relative) if options.key?(:relative)
|
||||
|
||||
sources.flatten.inject(::ActiveSupport::SafeBuffer.new) do |all,source|
|
||||
sources.flatten.inject(::ActiveSupport::SafeBuffer.new) do |all, source|
|
||||
all << content_tag(:script, nil, {
|
||||
src: asset_path(:js, source, path_options)
|
||||
}.update(options))
|
||||
|
|
|
@ -245,10 +245,10 @@ class Middleman::CoreExtensions::Internationalization < ::Middleman::Extension
|
|||
::I18n.locale = lang
|
||||
localized_page_id = ::I18n.t("paths.#{page_id}", default: page_id, fallback: [])
|
||||
|
||||
partially_localized_path = ""
|
||||
partially_localized_path = ''
|
||||
|
||||
File.dirname(path).split('/').each do |path_sub|
|
||||
next if path_sub == ""
|
||||
next if path_sub == ''
|
||||
partially_localized_path = "#{partially_localized_path}/#{(::I18n.t("paths.#{path_sub}", default: path_sub).to_s)}"
|
||||
end
|
||||
|
||||
|
|
|
@ -152,8 +152,8 @@ class Middleman::Extensions::Lorem < ::Middleman::Extension
|
|||
color = options[:color]
|
||||
|
||||
if options[:random_color]
|
||||
background_color = hex.shuffle[0...6].join
|
||||
color = hex.shuffle[0...6].join
|
||||
background_color = hex.sample(6).join
|
||||
color = hex.sample(6).join
|
||||
end
|
||||
|
||||
src << "/#{background_color.sub(/^#/, '')}" if background_color
|
||||
|
|
|
@ -18,7 +18,7 @@ class Middleman::Extensions::RelativeAssets < ::Middleman::Extension
|
|||
def asset_url(path, prefix='', options={})
|
||||
options[:relative] = true unless options.key?(:relative)
|
||||
|
||||
path = super(path, prefix, options)
|
||||
super(path, prefix, options)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue