Skip to content

Commit

Permalink
chore: remove non-breaking spaces from comments
Browse files Browse the repository at this point in the history
  • Loading branch information
adamcooke committed Feb 19, 2024
1 parent 71452b7 commit 49aba40
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion app/models/route.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def save_additional_route_endpoints

#
# This message will create a suitable number of message objects for messages that
#  are destined for this route. It receives a block which can set the message content
# are destined for this route. It receives a block which can set the message content
# but most information is specified already.
#
# Returns an array of created messages.
Expand Down
2 changes: 1 addition & 1 deletion lib/postal/http_sender.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def send_message(message)
result.output = response[:body].to_s[0, 500].strip
end
if response[:code] >= 200 && response[:code] < 300
#  This is considered a success
# This is considered a success
result.type = "Sent"
elsif response[:code] >= 500 && response[:code] < 600
# This is temporary. They might fix their server so it should soft fail.
Expand Down
20 changes: 10 additions & 10 deletions lib/postal/message_db/database.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ def messages_with_pagination(*args)
end

#
#  Create a new message with the given attributes. This won't be saved to the database
#  until it has been 'save'd.
# Create a new message with the given attributes. This won't be saved to the database
# until it has been 'save'd.
#
def new_message(attributes = {})
Message.new(self, attributes)
Expand All @@ -74,35 +74,35 @@ def total_size
end

#
#  Return the live stats instance
# Return the live stats instance
#
def live_stats
@live_stats ||= LiveStats.new(self)
end

#
#  Return the statistics instance
# Return the statistics instance
#
def statistics
@statistics ||= Statistics.new(self)
end

#
#  Return the provisioner instance
# Return the provisioner instance
#
def provisioner
@provisioner ||= Provisioner.new(self)
end

#
#  Return the provisioner instance
# Return the provisioner instance
#
def suppression_list
@suppression_list ||= SuppressionList.new(self)
end

#
#  Return the provisioner instance
# Return the provisioner instance
#
def webhooks
@webhooks ||= Webhooks.new(self)
Expand Down Expand Up @@ -183,7 +183,7 @@ def select(table, options = {})
end

#
#  A paginated version of select
# A paginated version of select
#
def select_with_pagination(table, page, options = {})
page = page.to_i
Expand Down Expand Up @@ -253,7 +253,7 @@ def insert_multi(table, keys, values)

#
# Deletes a in the database. Accepts a table name, and some options which
#  are shown below:
# are shown below:
#
# :where => The condition to apply to the query
#
Expand All @@ -269,7 +269,7 @@ def delete(table, options = {})
end

#
#  Return the correct database name
# Return the correct database name
#
def database_name
@database_name ||= "#{Postal.config.message_db.prefix}-server-#{@server_id}"
Expand Down
24 changes: 12 additions & 12 deletions lib/postal/message_db/message.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def timestamp
end

#
#  Return the time that the last delivery was attempted
# Return the time that the last delivery was attempted
#
def last_delivery_attempt
@last_delivery_attempt ||= @attributes["last_delivery_attempt"] ? Time.zone.at(@attributes["last_delivery_attempt"]) : nil
Expand Down Expand Up @@ -172,14 +172,14 @@ def loads
end

#
#  Return all activity entries
# Return all activity entries
#
def activity_entries
@activity_entries ||= (deliveries + clicks + loads).sort_by(&:timestamp)
end

#
#  Provide access to set and get acceptable attributes
# Provide access to set and get acceptable attributes
#
def method_missing(name, value = nil, &block)
if @attributes.key?(name.to_s)
Expand All @@ -202,7 +202,7 @@ def persisted?
end

#
#  Save this message
# Save this message
#
def save(queue_on_create: true)
save_raw_message
Expand All @@ -223,7 +223,7 @@ def update(attributes_to_change)
end

#
#  Delete the message from the database
# Delete the message from the database
#
def delete
return unless persisted?
Expand All @@ -232,7 +232,7 @@ def delete
end

#
#  Return the headers
# Return the headers
#
def raw_headers
if raw_table
Expand All @@ -243,7 +243,7 @@ def raw_headers
end

#
#  Return the full raw message body for this message.
# Return the full raw message body for this message.
#
def raw_body
if raw_table
Expand Down Expand Up @@ -303,7 +303,7 @@ def plain_body
end

#
#  Return the HTML body for this message
# Return the HTML body for this message
#
def html_body
mail&.html_body
Expand Down Expand Up @@ -484,7 +484,7 @@ def create_load(request)
end

#
#  Create a new link
# Create a new link
#
def create_link(url)
hash = Digest::SHA1.hexdigest(url.to_s)
Expand All @@ -494,7 +494,7 @@ def create_link(url)
end

#
#  Return a message object that this message is a reply to
# Return a message object that this message is a reply to
#
def original_messages
return nil unless bounce
Expand Down Expand Up @@ -531,7 +531,7 @@ def inspect_message
end

#
#  Return all spam checks for this message
# Return all spam checks for this message
#
def spam_checks
@spam_checks ||= database.select(:spam_checks, where: { message_id: id })
Expand All @@ -552,7 +552,7 @@ def cancel_hold
def parse_content
parse_result = Postal::MessageParser.new(self)
if parse_result.actioned?
#  Somethign was changed, update the raw message
# Somethign was changed, update the raw message
@database.update(raw_table, { data: parse_result.new_body }, where: { id: raw_body_id })
@raw = parse_result.new_body
@raw_message = nil
Expand Down
2 changes: 1 addition & 1 deletion lib/postal/message_db/provisioner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def remove_raw_table(table)
end

#
#  Remove messages from the messages table that are too old to retain
# Remove messages from the messages table that are too old to retain
#
def remove_messages(max_age = 60)
time = (Time.now.utc.to_date - max_age.days).to_time.end_of_day
Expand Down

0 comments on commit 49aba40

Please sign in to comment.