Skip to content

Commit

Permalink
Fixed Ameba issues, added Ameba to Travis config. (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
igor-alexandrov committed Aug 10, 2020
1 parent 40f7d93 commit 4214535
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -7,3 +7,4 @@ crystal:
script:
- crystal spec
- crystal tool format --check
- crystal bin/ameba.cr
5 changes: 5 additions & 0 deletions shard.yml
Expand Up @@ -17,3 +17,8 @@ development_dependencies:
dotenv:
github: gdotdesign/cr-dotenv
version: 0.7.0

ameba:
github: veelenga/ameba
version: 0.13.1

8 changes: 4 additions & 4 deletions src/carbon/adapters/send_grid_adapter.cr
Expand Up @@ -54,13 +54,13 @@ class Carbon::SendGridAdapter < Carbon::Adapter
end

private def reply_to_header
reply_to_header = email.headers.select do |key, value|
email.headers.select do |key, _value|
key.downcase == "reply-to"
end
end

private def headers : Hash(String, String)
email.headers.reject do |key, value|
email.headers.reject do |key, _value|
key.downcase == "reply-to"
end
end
Expand All @@ -70,7 +70,7 @@ class Carbon::SendGridAdapter < Carbon::Adapter
to: to_send_grid_address(email.to),
cc: to_send_grid_address(email.cc),
bcc: to_send_grid_address(email.bcc),
}.to_h.reject do |key, value|
}.to_h.reject do |_key, value|
value.empty?
end
end
Expand All @@ -88,7 +88,7 @@ class Carbon::SendGridAdapter < Carbon::Adapter
{
email: email.from.address,
name: email.from.name,
}.to_h.reject do |key, value|
}.to_h.reject do |_key, value|
value.nil?
end
end
Expand Down

0 comments on commit 4214535

Please sign in to comment.