From b4cc81264c85d5f0061e5b5121a30d7bdcabc189 Mon Sep 17 00:00:00 2001 From: Adam Cooke Date: Fri, 9 Feb 2024 17:21:27 +0000 Subject: [PATCH] style(rubocop): Style/StringLiterals --- Gemfile | 6 +++--- config/initializers/zeitwerk.rb | 2 +- script/send-html-email.rb | 10 +++++----- spec/lib/postal/message_db/connection_pool_spec.rb | 10 +++++----- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Gemfile b/Gemfile index f327418..e945eb7 100644 --- a/Gemfile +++ b/Gemfile @@ -17,7 +17,7 @@ gem "gelf" gem "haml" gem "hashie" gem "highline", require: false -gem "execjs", '~> 2.7', "< 2.8" +gem "execjs", "~> 2.7", "< 2.8" gem "jwt" gem "kaminari" gem "mail" @@ -30,8 +30,8 @@ gem "puma" gem "rails", "= 6.1.7.6" gem "resolv", "~> 0.2.1" gem "secure_headers" -gem 'sentry-rails' -gem 'sentry-ruby' +gem "sentry-rails" +gem "sentry-ruby" gem "turbolinks", "~> 5" group :development, :assets do diff --git a/config/initializers/zeitwerk.rb b/config/initializers/zeitwerk.rb index 4941321..518aba1 100644 --- a/config/initializers/zeitwerk.rb +++ b/config/initializers/zeitwerk.rb @@ -3,5 +3,5 @@ Rails.autoloaders.each do |autoloader| # Ignore the message DB migrations directory as it doesn't follow # Zeitwerk's conventions and is always loaded and executed in order. - autoloader.ignore(Rails.root.join('lib/postal/message_db/migrations')) + autoloader.ignore(Rails.root.join("lib/postal/message_db/migrations")) end diff --git a/script/send-html-email.rb b/script/send-html-email.rb index 564b0b0..43a1fd5 100644 --- a/script/send-html-email.rb +++ b/script/send-html-email.rb @@ -3,8 +3,8 @@ # This script will automatically send an HTML email to the # SMTP server given. -require 'mail' -require 'net/smtp' +require "mail" +require "net/smtp" from = ARGV[0] to = ARGV[1] @@ -19,7 +19,7 @@ mail = Mail.new mail.to = to mail.from = from mail.subject = "A test email from #{Time.now.to_s}" -mail['X-Postal-Tag'] = 'send-html-email-script' +mail["X-Postal-Tag"] = "send-html-email-script" mail.text_part = Mail::Part.new do body <<~BODY Hello there. @@ -32,7 +32,7 @@ mail.text_part = Mail::Part.new do BODY end mail.html_part = Mail::Part.new do - content_type 'text/html; charset=UTF-8' + content_type "text/html; charset=UTF-8" body <<~BODY

Hello there

This is an example email. It doesn't do all that much.

@@ -43,7 +43,7 @@ end #puts mail.to_s -Net::SMTP.start('127.0.0.1', 2525) do |smtp| +Net::SMTP.start("127.0.0.1", 2525) do |smtp| smtp.send_message mail.to_s, mail.from.first, mail.to.first end diff --git a/spec/lib/postal/message_db/connection_pool_spec.rb b/spec/lib/postal/message_db/connection_pool_spec.rb index 62190bb..4c254b1 100644 --- a/spec/lib/postal/message_db/connection_pool_spec.rb +++ b/spec/lib/postal/message_db/connection_pool_spec.rb @@ -6,8 +6,8 @@ describe Postal::MessageDB::ConnectionPool do subject(:pool) { described_class.new } - describe '#use' do - it 'yields a connection' do + describe "#use" do + it "yields a connection" do counter = 0 pool.use do |connection| expect(connection).to be_a Mysql2::Client @@ -16,7 +16,7 @@ describe Postal::MessageDB::ConnectionPool do expect(counter).to eq 1 end - it 'checks in a connection after the block has executed' do + it "checks in a connection after the block has executed" do connection = nil pool.use do |c| expect(pool.connections).to be_empty @@ -25,7 +25,7 @@ describe Postal::MessageDB::ConnectionPool do expect(pool.connections).to eq [connection] end - it 'checks in a connection if theres an error in the block' do + it "checks in a connection if theres an error in the block" do expect do pool.use do |c| raise StandardError @@ -34,7 +34,7 @@ describe Postal::MessageDB::ConnectionPool do expect(pool.connections).to match [kind_of(Mysql2::Client)] end - it 'does not check in connections when there is a connection error' do + it "does not check in connections when there is a connection error" do expect do pool.use do raise Mysql2::Error, "lost connection to server"