Skip to content

Commit

Permalink
Merge pull request #5 from arcage/work
Browse files Browse the repository at this point in the history
crystal 0.20.3
  • Loading branch information
arcage authored Dec 28, 2016
2 parents 38e8f5f + 48f4e45 commit 8ca0d8a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
4 changes: 3 additions & 1 deletion shard.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: email
version: 0.1.2
version: 0.1.3

authors:
- ʕ·ᴥ·ʔAKJ <[email protected]>

crystal: 0.20.3

license: MIT
2 changes: 1 addition & 1 deletion src/email.cr
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ module EMail
DEFAULT_SMTP_PORT = 25

def self.send(host : ::String, port : ::Int32 = DEFAULT_SMTP_PORT, **option)
client = Client.new(host, port)
mail = Message.new
with mail yield
mail.validate!
client = Client.new(host, port)
{% for opt in %i(log_level client_name helo_domain on_failed use_tls auth) %}
if {{opt.id}} = option[{{opt}}]?
client.{{opt.id}} = {{opt.id}}
Expand Down
3 changes: 0 additions & 3 deletions src/email/client.cr
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ class EMail::Client
# Createss smtp client object.
def initialize(@host : ::String, @port : ::Int32 = DEFAULT_SMTP_PORT)
@logger = logger_setting(::STDOUT, "EMail_Client", ::Logger::INFO)
rescue ex : Error
fatal_error(ex)
end

private def logger_setting(io : IO, progname : ::String, level : ::Logger::Severity)
Expand Down Expand Up @@ -153,7 +151,6 @@ class EMail::Client
status_code = ""
status_messages = [] of ::String
while (line = socket.gets)
line = line.chomp
@command_history << line
if line =~ /\A(\d{3})((( |-)(.*))?)\z/
continue = false
Expand Down
2 changes: 1 addition & 1 deletion src/email/version.cr
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module EMail
VERSION = "0.1.2"
VERSION = "0.1.3"
end

0 comments on commit 8ca0d8a

Please sign in to comment.