From 80b5d18176ed9930f4c435de217b51cfb39445d2 Mon Sep 17 00:00:00 2001 From: Matthias Viehweger Date: Tue, 26 Mar 2019 12:43:03 +0100 Subject: [PATCH] Conform to linter and styleguide --- .rubocop.yml | 5 +++++ Gemfile | 2 ++ Rakefile | 8 +++++--- bin/console | 7 ++++--- lib/gpuzzletime/app.rb | 1 + spec/spec_helper.rb | 2 +- 6 files changed, 18 insertions(+), 7 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 7c480ec..77bcefe 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -7,6 +7,11 @@ Style/TrailingCommaInArrayLiteral: Style/TrailingCommaInHashLiteral: EnforcedStyleForMultiline: consistent_comma +Layout/AlignHash: + EnforcedHashRocketStyle: table + EnforcedColonStyle: table + EnforcedLastArgumentHashStyle: always_inspect # default + Metrics/BlockLength: Exclude: - spec/**/* diff --git a/Gemfile b/Gemfile index d9e6b75..2eeae8e 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + source 'https://rubygems.org' # Specify your gem's dependencies in gpuzzletime.gemspec diff --git a/Rakefile b/Rakefile index b7e9ed5..82bb534 100644 --- a/Rakefile +++ b/Rakefile @@ -1,6 +1,8 @@ -require "bundler/gem_tasks" -require "rspec/core/rake_task" +# frozen_string_literal: true + +require 'bundler/gem_tasks' +require 'rspec/core/rake_task' RSpec::Core::RakeTask.new(:spec) -task :default => :spec +task default: :spec diff --git a/bin/console b/bin/console index 2d0f01e..16bb807 100755 --- a/bin/console +++ b/bin/console @@ -1,7 +1,8 @@ #!/usr/bin/env ruby +# frozen_string_literal: true -require "bundler/setup" -require "gpuzzletime" +require 'bundler/setup' +require 'gpuzzletime' # You can add fixtures and/or initialization code here to make experimenting # with your gem easier. You can also use a different console, if you like. @@ -10,5 +11,5 @@ require "gpuzzletime" # require "pry" # Pry.start -require "irb" +require 'irb' IRB.start diff --git a/lib/gpuzzletime/app.rb b/lib/gpuzzletime/app.rb index 170c48e..b33178d 100644 --- a/lib/gpuzzletime/app.rb +++ b/lib/gpuzzletime/app.rb @@ -57,6 +57,7 @@ def fill_entries(purpose) # this is mixing preparation, assembly and output, but gets the job done next unless date # guard against the machine next unless @date == :all || @date == date # limit to one day if passed + entries[date] = [] start = nil # at the start of the day, we have no previous end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 7e8b1da..2c2dd12 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) +$LOAD_PATH.unshift File.expand_path('../lib', __dir__) require 'gpuzzletime' require 'timecop'