From e6bd9ed2db5c0e660553692109e4441ab8a1642b Mon Sep 17 00:00:00 2001 From: Thomas Reynolds Date: Mon, 17 Dec 2018 13:51:35 -0800 Subject: [PATCH] Rubocop --- .rubocop.yml | 4 ++-- Gemfile | 26 ++++++++++----------- Rakefile | 6 ++--- gem_rake_helper.rb | 2 +- middleman-cli/Rakefile | 1 - middleman-core/Rakefile | 1 - middleman-core/lib/middleman-core/logger.rb | 2 +- middleman/Rakefile | 1 - 8 files changed, 20 insertions(+), 23 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index c92b709f..36309729 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -42,7 +42,7 @@ CyclomaticComplexity: HandleExceptions: Enabled: false EndAlignment: - AlignWith: variable + EnforcedStyleAlignWith: variable SignalException: Enabled: false RegexpLiteral: @@ -50,7 +50,7 @@ RegexpLiteral: FormatString: Enabled: false CaseIndentation: - IndentWhenRelativeTo: end + EnforcedStyle: end TrivialAccessors: Enabled: false SingleLineBlockParams: diff --git a/Gemfile b/Gemfile index 060a2e2f..e50e8e67 100644 --- a/Gemfile +++ b/Gemfile @@ -5,41 +5,41 @@ gem 'rake', '~> 10.3', require: false gem 'yard', '~> 0.8', require: false # Test tools -gem 'byebug' -gem 'aruba', '~> 0.7.4', require: false -gem 'rspec', '~> 3.0', require: false -gem 'cucumber', '~> 2.0', require: false gem 'addressable', '~> 2.4.0', require: false +gem 'aruba', '~> 0.7.4', require: false +gem 'byebug' gem 'capybara', '~> 2.5.0', require: false +gem 'cucumber', '~> 2.0', require: false +gem 'rspec', '~> 3.0', require: false # Pry tools gem 'pry' -gem 'pry-stack_explorer' gem 'pry-rescue' +gem 'pry-stack_explorer' # Optional middleman dependencies, included for tests -gem 'haml', '~> 4.0', require: false -gem 'sassc', '~> 1.10.1', require: false gem 'coffee-script', '~> 2.2', require: false +gem 'haml', '~> 4.0', require: false gem 'kramdown', '~> 1.2', require: false -gem 'slim', '>= 2.0', require: false gem 'liquid', '~> 3.0', require: false -gem 'stylus', '>= 1.0', require: false -gem 'sinatra', '>= 2.0.0.beta2', require: false gem 'redcarpet', '>= 3.1', require: false +gem 'sassc', '~> 1.10.1', require: false +gem 'sinatra', '>= 2.0.0.beta2', require: false +gem 'slim', '>= 2.0', require: false +gem 'stylus', '>= 1.0', require: false # Dns server to test preview server gem 'rubydns', '~> 1.0.1', require: false # For less, note there is no compatible JS runtime for windows -gem 'therubyrhino', '>= 2.0', platforms: :jruby gem 'therubyracer', '>= 0.12', platforms: :ruby +gem 'therubyrhino', '>= 2.0', platforms: :jruby # Code Quality +gem 'codeclimate-test-reporter', '~> 0.3', require: false, group: :test +gem 'coveralls', '~> 0.8', require: false gem 'rubocop', '~> 0.24', require: false gem 'simplecov', '~> 0.10', require: false -gem 'coveralls', '~> 0.8', require: false -gem 'codeclimate-test-reporter', '~> 0.3', require: false, group: :test # Middleman itself gem 'middleman-cli', path: 'middleman-cli' diff --git a/Rakefile b/Rakefile index 508c3a1d..aaa78ade 100644 --- a/Rakefile +++ b/Rakefile @@ -1,11 +1,11 @@ require 'rake' -require File.expand_path('../middleman-core/lib/middleman-core/version.rb', __FILE__) +require File.expand_path('middleman-core/lib/middleman-core/version.rb', __dir__) -ROOT = File.expand_path(File.dirname(__FILE__)) +ROOT = __dir__ GEM_NAME = 'middleman'.freeze -middleman_gems = %w(middleman-core middleman-cli middleman) +middleman_gems = %w[middleman-core middleman-cli middleman] GEM_PATHS = middleman_gems.freeze def sh_rake(command) diff --git a/gem_rake_helper.rb b/gem_rake_helper.rb index ea46e6a7..479f53a4 100644 --- a/gem_rake_helper.rb +++ b/gem_rake_helper.rb @@ -38,7 +38,7 @@ RSpec::Core::RakeTask.new do |spec| end desc 'Run tests, both RSpec and Cucumber' -task test: [:spec, :cucumber] +task test: %i[spec cucumber] YARD::Rake::YardocTask.new diff --git a/middleman-cli/Rakefile b/middleman-cli/Rakefile index db0d1cb8..8c9c28c6 100644 --- a/middleman-cli/Rakefile +++ b/middleman-cli/Rakefile @@ -1,4 +1,3 @@ -# coding:utf-8 RAKE_ROOT = __FILE__.freeze GEM_NAME = 'middleman-cli'.freeze require File.expand_path(File.dirname(__FILE__) + '/../gem_rake_helper') diff --git a/middleman-core/Rakefile b/middleman-core/Rakefile index 198f09ee..01049499 100644 --- a/middleman-core/Rakefile +++ b/middleman-core/Rakefile @@ -1,4 +1,3 @@ -# coding:utf-8 RAKE_ROOT = __FILE__.freeze GEM_NAME = ENV['NAME'] || 'middleman-core' require File.expand_path(File.dirname(__FILE__) + '/../gem_rake_helper') diff --git a/middleman-core/lib/middleman-core/logger.rb b/middleman-core/lib/middleman-core/logger.rb index 1c0170d1..9db5c49c 100644 --- a/middleman-core/lib/middleman-core/logger.rb +++ b/middleman-core/lib/middleman-core/logger.rb @@ -7,7 +7,7 @@ module Middleman # The Middleman Logger class Logger < ActiveSupport::Logger def self.singleton(*args) - if !@_logger || !args.empty? + if !@_logger || !args || !args.empty? if args.length == 1 && (args.first.is_a?(::String) || args.first.respond_to?(:write)) args = [0, false, args.first] end diff --git a/middleman/Rakefile b/middleman/Rakefile index 793455ab..74d040b1 100644 --- a/middleman/Rakefile +++ b/middleman/Rakefile @@ -1,4 +1,3 @@ -# coding:utf-8 RAKE_ROOT = __FILE__.freeze GEM_NAME = 'middleman'.freeze require File.expand_path(File.dirname(__FILE__) + '/../gem_rake_helper')