Skip to content

Commit

Permalink
Merge pull request #1 from Teamtailor/standard-rb
Browse files Browse the repository at this point in the history
Add Standard instead of Rubocop
  • Loading branch information
himynameisjonas authored Oct 28, 2024
2 parents 3ca5442 + e3a3c1a commit 6cc0f32
Show file tree
Hide file tree
Showing 15 changed files with 172 additions and 218 deletions.
22 changes: 0 additions & 22 deletions .github/workflows/rubocop.yml

This file was deleted.

14 changes: 14 additions & 0 deletions .github/workflows/standard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: Standard

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
permissions:
checks: write
contents: write
steps:
- name: Standard Ruby
uses: standardrb/standard-ruby-action@v1
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
fail-fast: true
matrix:
ruby:
- 2.6
- 2.7
- 3.0
- 3.1
- 3.2
- 3.3
experimental: [false]
include:
- ruby: head
Expand All @@ -35,7 +35,7 @@ jobs:
bundler: 2

- name: bundle install
run: bundle install --jobs 4 --retry 3
run: bundle install --jobs 4 --retry 3

- name: test
timeout-minutes: 10
Expand Down
36 changes: 0 additions & 36 deletions .rubocop.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

source 'https://rubygems.org'
source "https://rubygems.org"

gemspec
8 changes: 3 additions & 5 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# frozen_string_literal: true

require 'bundler/gem_tasks'
require 'rspec/core/rake_task'
require 'rubocop/rake_task'

RuboCop::RakeTask.new(:rubocop)
require "bundler/gem_tasks"
require "rspec/core/rake_task"
require "standard/rake"

RSpec::Core::RakeTask.new(:spec)

Expand Down
6 changes: 3 additions & 3 deletions lib/mail-ses.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

require 'aws-sdk-sesv2'
require 'mail'
require 'mail/ses'
require "aws-sdk-sesv2"
require "mail"
require "mail/ses"
12 changes: 6 additions & 6 deletions lib/mail/ses.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# frozen_string_literal: true

require 'mail/ses/version'
require 'mail/ses/message_validator'
require 'mail/ses/options_builder'
require "mail/ses/version"
require "mail/ses/message_validator"
require "mail/ses/options_builder"

module Mail
# Mail delivery method handler for AWS SES
Expand All @@ -21,7 +21,7 @@ def initialize(options = {})
@mail_options = options.delete(:mail_options) || {}

@error_handler = options.delete(:error_handler)
raise ArgumentError.new(':error_handler must be a Proc') if @error_handler && !@error_handler.is_a?(Proc)
raise ArgumentError.new(":error_handler must be a Proc") if @error_handler && !@error_handler.is_a?(Proc)

@settings = {
return_response: options.delete(:return_response),
Expand All @@ -46,9 +46,9 @@ def deliver!(message, options = {})

begin
response = client.send_email(send_options)
message.message_id = "#{response.to_h[:message_id]}@#{settings[:message_id_domain] || 'email.amazonses.com'}"
message.message_id = "#{response.to_h[:message_id]}@#{settings[:message_id_domain] || "email.amazonses.com"}"
settings[:return_response] ? response : self
rescue StandardError => e
rescue => e
handle_error(e, send_options)
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/mail/ses/message_validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def validate
def validate_class
return if @message.is_a?(Mail::Message)

raise ArgumentError.new('mail must be an instance of Mail::Message class')
raise ArgumentError.new("mail must be an instance of Mail::Message class")
end

def validate_delivery_params
Expand All @@ -31,7 +31,7 @@ def validate_delivery_params
def validate_attachments
return unless @message.has_attachments? && @message.text_part.nil? && @message.html_part.nil?

raise ArgumentError.new('Attachment provided without message body')
raise ArgumentError.new("Attachment provided without message body")
end
end
end
Expand Down
14 changes: 7 additions & 7 deletions lib/mail/ses/options_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ class SES
# Builds options for Aws::SESV2::Client#send_email
class OptionsBuilder
SES_FIELDS = %i[ from_email_address
from_email_address_identity_arn
reply_to_addresses
feedback_forwarding_email_address
feedback_forwarding_email_address_identity_arn
email_tags
configuration_set_name ].freeze
from_email_address_identity_arn
reply_to_addresses
feedback_forwarding_email_address
feedback_forwarding_email_address_identity_arn
email_tags
configuration_set_name ].freeze

# message - The Mail::Message object to be sent.
# options - The Hash options which override any defaults
Expand Down Expand Up @@ -41,7 +41,7 @@ def message_options
cc_addresses: extract_value(:cc) || [],
bcc_addresses: extract_value(:bcc) || []
},
content: { raw: { data: @message.to_s } }
content: {raw: {data: @message.to_s}}
}.compact
end

Expand Down
2 changes: 1 addition & 1 deletion lib/mail/ses/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

module Mail
class SES
VERSION = '1.1.0'
VERSION = "1.1.0"
end
end
40 changes: 20 additions & 20 deletions mail-ses.gemspec
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
# frozen_string_literal: true

$LOAD_PATH.push File.expand_path('lib', __dir__)
require 'mail/ses/version'
$LOAD_PATH.push File.expand_path("lib", __dir__)
require "mail/ses/version"

Gem::Specification.new do |s|
s.name = 'mail-ses'
s.version = Mail::SES::VERSION
s.licenses = ['MIT']
s.summary = 'Ruby Mail delivery method handler for Amazon SES'
s.description = 'Ruby Mail delivery method handler for Amazon SES'
s.authors = ['Johnny Shields']
s.email = '[email protected]'
s.files = Dir.glob('lib/**/*') + %w[CHANGELOG.md LICENSE README.md]
s.homepage = 'https://github.com/tablecheck/mail-ses'
s.required_ruby_version = '>= 2.6.0'
s.name = "mail-ses"
s.version = Mail::SES::VERSION
s.licenses = ["MIT"]
s.summary = "Ruby Mail delivery method handler for Amazon SES"
s.description = "Ruby Mail delivery method handler for Amazon SES"
s.authors = ["Johnny Shields"]
s.email = "[email protected]"
s.files = Dir.glob("lib/**/*") + %w[CHANGELOG.md LICENSE README.md]
s.homepage = "https://github.com/tablecheck/mail-ses"
s.required_ruby_version = ">= 3.0.0"

s.add_dependency('aws-sdk-sesv2', '>= 1.27')
s.add_dependency('mail', '>= 2.8.1')
s.add_development_dependency('net-smtp')
s.add_development_dependency('nokogiri')
s.add_development_dependency('rake', '>= 1')
s.add_development_dependency('rspec', '>= 3.8')
s.add_development_dependency('rubocop', '~> 1.30.1')
s.add_dependency("aws-sdk-sesv2", ">= 1.27")
s.add_dependency("mail", ">= 2.8.1")
s.add_development_dependency("net-smtp")
s.add_development_dependency("nokogiri")
s.add_development_dependency("rake", ">= 1")
s.add_development_dependency("rspec", ">= 3.8")
s.add_development_dependency("standard", "1.41.1")

s.metadata['rubygems_mfa_required'] = 'true'
s.metadata["rubygems_mfa_required"] = "true"
end
Loading

0 comments on commit 6cc0f32

Please sign in to comment.