From fc070c01b868ce83d5666a05ef9fe37ffd09a9b0 Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Wed, 2 Nov 2022 00:49:43 -0300 Subject: [PATCH] Ruby: fix linter errors --- Gemfile | 14 ++++++++------ Rakefile.rb | 2 ++ Rules | 2 +- lib/rake/cmd.rb | 9 +++++---- lib/tasks/deploy.rb | 2 ++ 5 files changed, 18 insertions(+), 11 deletions(-) diff --git a/Gemfile b/Gemfile index 4013237..17e071f 100644 --- a/Gemfile +++ b/Gemfile @@ -1,8 +1,10 @@ -source 'https://rubygems.org' -gem 'nanoc', '~> 4.12' -gem 'nanoc-live', '~> 1.0' -gem 'rainpress', '~> 1.0' -gem 'sass' -gem 'standardrb' +# frozen_string_literal: true + +source "https://rubygems.org" +gem "nanoc", "~> 4.12" +gem "nanoc-live", "~> 1.0" +gem "rainpress", "~> 1.0" +gem "sass" +gem "standardrb" gem "ryo.rb" gem "paint" diff --git a/Rakefile.rb b/Rakefile.rb index 7d0cd3c..f83cf64 100644 --- a/Rakefile.rb +++ b/Rakefile.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "bundler/setup" require_relative "lib/tasks" include Tasks diff --git a/Rules b/Rules index b9c0c37..d97ac2b 100644 --- a/Rules +++ b/Rules @@ -50,4 +50,4 @@ compile "/images/*" do end compile("/**/*") { write(nil) } -layout('**/*', :erb) +layout("**/*", :erb) diff --git a/lib/rake/cmd.rb b/lib/rake/cmd.rb index 945e513..0e308b9 100644 --- a/lib/rake/cmd.rb +++ b/lib/rake/cmd.rb @@ -1,14 +1,15 @@ +# frozen_string_literal: true + module Cmd def cmd(cmd, *args, silent: false) print " -> #{cmd}: " unless silent _, result = Process.wait2 Process.spawn( [cmd, cmd], *args, - STDERR=>File::NULL, - STDOUT=>File::NULL + $stderr => File::NULL, + $stdout => File::NULL ) - case - when result.success? + if result.success? print Paint["OK", :green, :bold], "\n" unless silent else print Paint["ERROR", :red, :bold], "\n" unless silent diff --git a/lib/tasks/deploy.rb b/lib/tasks/deploy.rb index ddc3cdc..b7981cf 100644 --- a/lib/tasks/deploy.rb +++ b/lib/tasks/deploy.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Tasks::Deploy require_relative "deploy/local" end