1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Add frozen_string_literal: true to match Rails codebase

This commit is contained in:
Dino Maric 2018-12-14 11:06:12 +01:00
parent af7d237002
commit 4412ca6dac
51 changed files with 102 additions and 0 deletions

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# The base class for all Active Mailbox ingress controllers.
class ActionMailbox::BaseController < ActionController::Base
skip_forgery_protection

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Ingests inbound emails from Amazon's Simple Email Service (SES).
#
# Requires the full RFC 822 message in the +content+ parameter. Authenticates requests by validating their signatures.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Ingests inbound emails from Mailgun. Requires the following parameters:
#
# - +body-mime+: The full RFC 822 message

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Ingests inbound emails from Mandrill.
#
# Requires a +mandrill_events+ parameter containing a JSON array of Mandrill inbound email event objects.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Ingests inbound emails relayed from Postfix.
#
# Authenticates requests using HTTP basic access authentication. The username is always +actionmailbox+, and the

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Ingests inbound emails from SendGrid. Requires an +email+ parameter containing a full RFC 822 message.
#
# Authenticates requests using HTTP basic access authentication. The username is always +actionmailbox+, and the

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Rails::Conductor::ActionMailbox::InboundEmailsController < Rails::Conductor::BaseController
def index
@inbound_emails = ActionMailbox::InboundEmail.order(created_at: :desc)

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Rerouting will run routing and processing on an email that has already been, or attempted to be, processed.
class Rails::Conductor::ActionMailbox::ReroutesController < Rails::Conductor::BaseController
def create

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# TODO: Move this to Rails::Conductor gem
class Rails::Conductor::BaseController < ActionController::Base
layout "rails/conductor"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# You can configure when this `IncinerationJob` will be run as a time-after-processing using the
# `config.action_mailbox.incinerate_after` or `ActionMailbox.incinerate_after` setting.
#

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Routing a new InboundEmail is an asynchronous operation, which allows the ingress controllers to quickly
# accept new incoming emails without being burdened to hang while they're actually being processed.
class ActionMailbox::RoutingJob < ActiveJob::Base

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "mail"
# The `InboundEmail` is an Active Record that keeps a reference to the raw email stored in Active Storage

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Ensure that the `InboundEmail` is automatically scheduled for later incineration if the status has been
# changed to `processed`. The later incineration will be invoked at the time specified by the
# `ActionMailbox.incinerate_after` time using the `IncinerationJob`.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Command class for carrying out the actual incineration of the `InboundMail` that's been scheduled
# for removal. Before the incineration which really is just a call to `#destroy!` is run, we verify
# that it's both eligible (by virtue of having already been processed) and time to do so (that is,

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# The `Message-ID` as specified by rfc822 is supposed to be a unique identifier for that individual email.
# That makes it an ideal tracking token for debugging and forensics, just like `X-Request-Id` does for
# web request.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# A newly received `InboundEmail` will not be routed synchronously as part of ingress controller's receival.
# Instead, the routing will be done asynchronously, using a `RoutingJob`, to ensure maximum parallel capacity.
#

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "action_mailbox/engine"
require "action_mailbox/mail_ext"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "active_support/rescuable"
require "action_mailbox/callbacks"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "active_support/callbacks"
module ActionMailbox

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "rails/engine"
module ActionMailbox

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "mail"
# The hope is to upstream most of these basic additions to the Mail gem's Mail object. But until then, here they lay!

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Mail::Address
def ==(other_address)
other_address.is_a?(Mail::Address) && to_s == other_address.to_s

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Mail::Address
def self.wrap(address)
address.is_a?(Mail::Address) ? address : Mail::Address.new(address)

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Mail::Message
def from_address
header[:from]&.address_list&.addresses&.first

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Mail
def self.from_source(source)
Mail.new Mail::Utilities.binary_unsafe_to_crlf(source.to_s)

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Mail::Message
def recipients
Array(to) + Array(cc) + Array(bcc) + Array(header[:x_original_to]).map(&:to_s)

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Encapsulates the routes that live on the ApplicationMailbox and performs the actual routing when
# an inbound_email is received.
class ActionMailbox::Router

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Encapsulates a route, which can then be matched against an inbound_email and provide a lookup of the matching
# mailbox class. See examples for the different route addresses and how to use them in the `ActionMailbox::Base`
# documentation.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionMailbox
# See `ActionMailbox::Base` for how to specify routing.
module Routing

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "action_mailbox/test_helper"
require "active_support/test_case"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "mail"
module ActionMailbox

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActionMailbox
VERSION = '0.1.0'
end

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class ApplicationMailbox < ActionMailbox::Base
# route /something/i => :somewhere
end

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "test_helper"
ActionMailbox::Ingresses::Amazon::InboundEmailsController.verifier =

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "test_helper"
ENV["MAILGUN_INGRESS_API_KEY"] = "tbsy84uSV1Kt3ZJZELY2TmShPRs91E3yL4tzf96297vBCkDWgL"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "test_helper"
ENV["MANDRILL_INGRESS_API_KEY"] = "1l9Qf7lutEf7h73VXfBwhw"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "test_helper"
class ActionMailbox::Ingresses::Postfix::InboundEmailsControllerTest < ActionDispatch::IntegrationTest

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "test_helper"
class ActionMailbox::Ingresses::Sendgrid::InboundEmailsControllerTest < ActionDispatch::IntegrationTest

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
ENV["RAILS_ENV"] = "test"
ENV["RAILS_INBOUND_EMAIL_PASSWORD"] = "tbsy84uSV1Kt3ZJZELY2TmShPRs91E3yL4tzf96297vBCkDWgL"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative '../../test_helper'
class ActionMailbox::InboundEmail::IncinerationTest < ActiveSupport::TestCase

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative '../../test_helper'
class ActionMailbox::InboundEmail::MessageIdTest < ActiveSupport::TestCase

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative '../test_helper'
module ActionMailbox

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative '../../test_helper'
module MailExt

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative '../../test_helper'
module MailExt

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative '../../test_helper'
module MailExt

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative '../../test_helper'
class BouncingWithReplyMailbox < ActionMailbox::Base

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative '../../test_helper'
class CallbackMailbox < ActionMailbox::Base

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative '../../test_helper'
class ApplicationMailbox < ActionMailbox::Base

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative '../../test_helper'
class SuccessfulMailbox < ActionMailbox::Base

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative '../test_helper'
require 'action_mailbox/postfix_relayer'

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative '../test_helper'
class RootMailbox < ActionMailbox::Base