Move ToStdout to /app/lib folder and include it in app.rb

This commit is contained in:
Alex Sherman 2021-01-06 15:33:02 +05:00
parent 217f009fa3
commit 1d5c46e6a0
6 changed files with 13 additions and 16 deletions

View file

@ -2,7 +2,6 @@ module DNS
# Namespace is needed, because a class with the same name is defined by `domain_name` gem,
# a dependency of `actionmailer`,
class DomainName
include ToStdout
def initialize(name)
@name = name
end
@ -37,7 +36,7 @@ module DNS
auction = Auction.new
auction.domain = name
auction.start
to_stdout "Created the auction: #{auction.inspect}"
ToStdout.msg "Created the auction: #{auction.inspect}"
update_whois_from_auction(auction)
end
@ -102,8 +101,8 @@ module DNS
whois_record = Whois::Record.find_or_create_by!(name: name) do |record|
record.json = {}
end
to_stdout "Starting to update WHOIS record #{whois_record.inspect}\n\n"\
"from auction #{auction.inspect}"
ToStdout.msg "Starting to update WHOIS record #{whois_record.inspect}\n\n"\
"from auction #{auction.inspect}"
whois_record.update_from_auction(auction)
end
end