Commit Graph

58 Commits

Author SHA1 Message Date
binarygit
8381bc6eef
fix typo in action_mailbox/base.rb 2023-02-06 13:10:24 +05:45
Petrik
6e89ae2d2e Use infinitive form verb for all task descriptions
All the common rails commands and some extended commands use the
infinitive form for the verb in the description. This changes the
remaining tasks to use the infinitive form verb as well, for
consistency.

__Before__

```console
$ bin/rails --help
...
action_mailbox:install             Installs Action Mailbox and its dependencies
...
app:template                       Applies the template supplied by LOCATION=(/path/to/template) or URL
...
credentials:diff                   Enrolls/disenrolls in decrypted diffs of credentials using git
credentials:edit                   Opens the decrypted credentials in `$EDITOR` for editing
credentials:show                   Shows the decrypted credentials
db:create                          Creates the database from DATABASE_URL or config/database.yml for the current RAILS_ENV (use...
db:drop                            Drops the database from DATABASE_URL or config/database.yml for the current RAILS_ENV (use d...
...
db:fixtures:load                   Loads fixtures into the current environment's database
db:migrate                         Migrate the database (options: VERSION=x, VERBOSE=false, SCOPE=blog)
db:migrate:down                    Runs the "down" for a given migration VERSION
db:migrate:redo                    Rolls back the database one migration and re-migrates up (options: STEP=x, VERSION=x)
db:migrate:up                      Runs the "up" for a given migration VERSION
db:prepare                         Runs setup if database does not exist, or runs migrations if it does
db:reset                           Drops and recreates all databases from their schema for the current environment and loads th...
db:rollback                        Rolls the schema back to the previous version (specify steps w/ STEP=n)
db:schema:cache:clear              Clears a db/schema_cache.yml file
db:schema:cache:dump               Creates a db/schema_cache.yml file
db:schema:dump                     Creates a database schema file (either db/schema.rb or db/structure.sql, depending on `ENV['...
db:schema:load                     Loads a database schema file (either db/schema.rb or db/structure.sql, depending on `ENV['SC...
db:seed                            Loads the seed data from db/seeds.rb
db:seed:replant                    Truncates tables of each database for current environment and loads the seeds
db:setup                           Creates all databases, loads all schemas, and initializes with the seed data (use db:reset t...
db:system:change                   Changes `config/database.yml` and your database gem to the target database
db:version                         Retrieves the current schema version number
destroy                            Removes code generated by `bin/rails generate`
dev:cache                          Toggles development mode caching on/off
encrypted:edit                     Opens the decrypted file in `$EDITOR` for editing
encrypted:show                     Shows the decrypted contents of the file
...
log:clear                          Truncates all/specified *.log files in log/ to zero bytes (specify which logs with LOGS=test...
middleware                         Prints out your Rack middleware stack
notes                              Shows comments in your code annotated with FIXME, OPTIMIZE, and TODO
...
routes                             Lists all the defined routes
runner                             Runs Ruby code in the context of your application
...
secrets:edit                       Opens the secrets in `$EDITOR` for editing
secrets:show                       Shows the decrypted secrets
...
tmp:create                         Creates tmp directories for cache, sockets, and pids
version                            Shows the Rails version
...
zeitwerk:check                     Checks project structure for Zeitwerk compatibility
```

__After__

```console
$ bin/rails --help
...
action_mailbox:install             Install Action Mailbox and its dependencies
...
app:template                       Apply the template supplied by LOCATION=(/path/to/template) or URL
...
credentials:diff                   Enrolls/disenrolls in decrypted diffs of credentials using git
credentials:edit                   Opens the decrypted credentials in `$EDITOR` for editing
credentials:show                   Shows the decrypted credentials
db:create                          Create the database from DATABASE_URL or config/database.yml for the current RAILS_ENV (use ...
db:drop                            Drop the database from DATABASE_URL or config/database.yml for the current RAILS_ENV (use db...
...
db:fixtures:load                   Load fixtures into the current environment's database
db:migrate                         Migrate the database (options: VERSION=x, VERBOSE=false, SCOPE=blog)
db:migrate:down                    Run the "down" for a given migration VERSION
db:migrate:redo                    Roll back the database one migration and re-migrate up (options: STEP=x, VERSION=x)
db:migrate:status                  Display status of migrations
db:migrate:up                      Run the "up" for a given migration VERSION
db:prepare                         Run setup if database does not exist, or run migrations if it does
db:reset                           Drop and recreate all databases from their schema for the current environment and load the s...
db:rollback                        Roll the schema back to the previous version (specify steps w/ STEP=n)
db:schema:cache:clear              Clear a db/schema_cache.yml file
db:schema:cache:dump               Create a db/schema_cache.yml file
db:schema:dump                     Create a database schema file (either db/schema.rb or db/structure.sql, depending on `ENV['S...
db:schema:load                     Load a database schema file (either db/schema.rb or db/structure.sql, depending on `ENV['SCH...
db:seed                            Load the seed data from db/seeds.rb
db:seed:replant                    Truncate tables of each database for current environment and load the seeds
db:setup                           Create all databases, load all schemas, and initialize with the seed data (use db:reset to a...
db:system:change                   Change `config/database.yml` and your database gem to the target database
db:version                         Retrieve the current schema version number
destroy                            Remove code generated by `bin/rails generate`
dev:cache                          Toggle development mode caching on/off
encrypted:edit                     Open the decrypted file in `$EDITOR` for editing
encrypted:show                     Show the decrypted contents of the file
...
log:clear                          Truncate all/specified *.log files in log/ to zero bytes (specify which logs with LOGS=test...
middleware                         Print out your Rack middleware stack
notes                              Show comments in your code annotated with FIXME, OPTIMIZE, and TODO
...
routes                             List all the defined routes
runner                             Run Ruby code in the context of your application
...
secrets:edit                       Open the secrets in `$EDITOR` for editing
secrets:show                       Show the decrypted secrets
...
tmp:create                         Create tmp directories for cache, sockets, and pids
version                            Show the Rails version
...
zeitwerk:check                     Check project structure for Zeitwerk compatibility
```

Co-authored-by: Jonathan Hefner <jonathan@hefner.pro>
2023-02-01 22:43:04 +01:00
George Claghorn
4914529180
Revert "Add nodoc to Mail module [ci-skip]" 2023-01-28 16:57:04 -05:00
Hartley McGuire
2e920b0097
Fix missing requires in Action Mailbox
Previously, trying to `require "action_mailbox"` would fail if Active
Support was not previously required.

This fixes requiring Action Mailbox by adding the standard
"active_support" and "active_support/rails" requires. In addition, this
files uses `30.days` and so it needs to require core_ext/numeric/time as
well.
2023-01-12 20:20:06 -05:00
Jonathan Hefner
6225b5f59f Load version.rb for Action Mailbox and Action Text
This matches the other frameworks, ensuring that `ActionMailbox.version`
and `ActionText.version` are available when using Action Mailbox and
Action Text, respectively.

__Before__

  ```console
  $ bin/rails runner 'puts ActiveRecord.version'
  7.1.0.alpha

  $ bin/rails runner 'puts ActionMailbox.version'
  undefined method `version' for ActionMailbox:Module

  $ bin/rails runner 'puts ActionText.version'
  undefined method `version' for ActionText:Module
  ```

__After__

  ```console
  $ bin/rails runner 'puts ActiveRecord.version'
  7.1.0.alpha

  $ bin/rails runner 'puts ActionMailbox.version'
  7.1.0.alpha

  $ bin/rails runner 'puts ActionText.version'
  7.1.0.alpha
  ```
2023-01-12 17:34:49 -06:00
OKURA Masafumi
a7a5f464cd Add nodoc to Mail module [ci-skip]
`Mail` gem is an external gem and all methods extended by Rails
are undocumented. However it's listed in API document page.
It serves no purposes so it should be removed.
2022-12-14 19:02:19 +09:00
Alex Ghiculescu
9e443a861a Fix CI for Mail 2.8+
CI is broken since https://github.com/mikel/mail/pull/1120, which is in the new `mail` release.

Example: https://buildkite.com/rails/rails/builds/91421#0184e03b-58dc-43f9-aa40-55949848dc67

This commit fixes it. The `adddress_list` method was renamed.
2022-12-04 21:48:54 -06:00
Étienne Barrié
3d6a7b2faa Initialize deprecators before configuring them
Since engine initializers run later in the process, we need to run this
initializer earlier than the default.

This ensures they're all registered before the environments are loaded.
2022-11-28 10:47:26 +01:00
Andy Stewart
12867b1f32 Add X-Forwarded-To addresses to recipients 2022-11-22 15:41:28 +00:00
Jonathan Hefner
f434310b3b Add ActionMailbox.deprecator
This commit adds `ActionMailbox.deprecator`, and adds it to
`Rails.application.deprecators` so that it can be configured via
settings such as `config.active_support.report_deprecations`.
2022-11-01 17:39:39 -05:00
Gannon McGibbon
6be4bdc6cf Improve mailbox generator usage docs
- Makes heading styles consistent with other generators
- Adds backticks to code snippets
2022-06-21 00:30:49 -05:00
Rafael Mendonça França
5c1bd20f0d
Merge pull request #44693 from ghousemohamed/fix-docs-related-gem-versions
Fix `#version` method docs and some typos [ci-skip]
2022-03-15 16:28:07 -04:00
Ghouse Mohamed
6ee6cb554b Fix #version docs and some typos 2022-03-16 01:48:37 +05:30
Lewis Buckley
246c13f8df
Change the AS::Notification payload to include the mailbox instance 2022-03-10 09:43:34 +00:00
Lewis Buckley
599e73bc00
Instrument Action Mailbox processing
Use ActiveSupport::Notifications to instrument Action Mailbox for
logging or performance monitoring.
2022-03-09 10:06:43 +00:00
Jonathan Hefner
a199aaedb8 Cross-link API docs [ci-skip]
RDoc will automatically format and link API references as long as they
are not already marked up as inline code.

This commit removes markup from various API references so that those
references will link to the relevant API docs.
2022-02-21 11:45:25 -06:00
Jonathan Hefner
0d3effc97e Replace "overwrite" with "override" [ci-skip]
"Overwrite" means "destructively replace", and is more suitable when,
for example, talking about writing data to a location.

"Override" means "supersede", and is more suitable when, for example,
talking about redifining methods in a subclass.
2022-02-21 11:11:11 -06:00
Rafael Mendonça França
83d85b2207
Start Rails 7.1 development 2021-12-07 15:52:30 +00:00
Rafael Mendonça França
d177551c30
Preparing for 7.0.0.alpha2 release 2021-09-15 18:22:51 -04:00
Rafael Mendonça França
9b7be48212
Preparing for 7.0.0.alpha1 release 2021-09-15 17:55:08 -04:00
Rafael Mendonça França
18707ab17f
Standardize nodoc comments 2021-07-29 21:18:07 +00:00
Yurii Rashkovskii
855e08d22d Problem: ActionMailbox uses default ActiveStorage service
This is imperfect in situations when a separation
between regular files (such as uploads) and emails
is necessary (for the purposes of regulatory compliance,
proper compartmentalization, etc.)

Solution: allow configuring ActionMailbox's storage service
2021-06-30 09:33:29 -07:00
Rafael Mendonça França
1b455e2e9d
Rails 6.2 is now Rails 7.0
We have big plans for the next version of Rails and that
require big versions.
2021-02-04 16:47:16 +00:00
Rafael Mendonça França
59f7f5889e
Start Rails 6.2 development 🎉 2020-12-03 01:35:29 +00:00
Rafael Mendonça França
8389f9902c
Preparing for 6.1.0.rc1 release 2020-11-02 21:12:47 +00:00
Petrik
2b09948637 Replace 'Stubs out' with 'Generates' in generator USAGE's [ci skip]
Generators generate things, but what is meant by 'Stubbing out' might
confuse beginners and non-native English speakers.
While generated tests are stubs that should have an implementation, a
generated model is a valid model that doesn't require any changes.
2020-06-03 08:51:47 +02:00
Abhay Nikam
9b60273a62 Adds :inline option to Action Mailbox generator rails_command 2020-05-04 11:02:17 +05:30
Kasper Timm Hansen
420d533021
Merge pull request #37988 from abhaynikam/37823-change-action-mailbox-installer-to-generator
Add ActionMailbox install generator
2020-02-10 02:32:08 +01:00
Haroon Ahmed
db1ae8cbb4 remove reference to global rails command and replace with bin/rails 2019-12-27 19:32:37 +00:00
Abhay Nikam
fc12d224ae Add ActionMailbox install generator
Forward ActionMailbox install to install generator and hide the ActionMailbox install generator from generator list

Updated the Action Mailbox install task description
2019-12-23 22:21:55 +05:30
glaszig
de862deb29 Fix Action Mailbox ingress config example [ci skip] 2019-10-14 21:58:30 -04:00
Takayuki Nakata
43081fae4c Fix typo a InboxMailbox -> an InboxMailbox [ci skip] 2019-10-03 14:27:35 +09:00
Michael Herold
ab34ed8acc Allow testing multipart emails in Action Mailbox
Allow passing a block to the create_inbound_email_from_mail and
receive_inbound_email_from_mail test helper methods.

When you wanted to test a multipart email -- for example, an email that
has both a plaintext part and an HTML part -- there wasn't a way to
easily build one without a pre-made fixture. By allowing you to pass a
block to these methods, we unlock the power of Mail.new to easily
create a variety of emails, from multi-part emails, to emails with
attachments, and beyond.
2019-08-07 10:12:13 -04:00
Akira Matsuda
af2129b4c7 Use try only when we're unsure if the receiver would respond_to the method 2019-08-01 17:58:00 +09:00
John Duff
09e5d6d004 Fix Bcc header missing with emails from conductor and test helpers 2019-07-26 13:04:16 -04:00
yuuji.yaginuma
d380ffe216 Remove frozen_string_literal magic comment from template file
The other template files do not add `frozen_string_literal`, so should
behave the same.

Ref: #30342, #30348.
2019-05-29 08:00:59 +09:00
James Dabbs
9ce8156c93 Delegate to the correct method in ActionMailbox.mailbox_for 2019-05-05 12:09:32 -07:00
James Dabbs
9f96d094a3 Expose mailbox_for method
Currently, the only exposed entry point into the ApplicationMailbox's configured
routing system is to call `route`, which performs a lot of work to fully
`process` inbound email. It'd be nice to have a way (e.g. in test) of checking
which mailbox an email would route to without necessarily processing it yet.
2019-05-04 10:53:08 -07:00
Rafael Mendonça França
9834be6565
Start Rails 6.1 development 2019-04-24 15:57:14 -04:00
George Claghorn
f480cfabcd
Remove the Amazon SES ingress
It's unusable and not ready to ship in Rails 6.0. We'll rewrite it for 6.1.
2019-04-14 12:15:54 -04:00
Kyle Zhao
4a9f2a746e FIX: ActionMailbox test helper argument list
`receive_inbound_email_from_source` should accept an argument list
(`*args`) instead, to allow for the `source` argument in
`create_inbound_email_from_source`.

```ruby
receive_inbound_email_from_source(source, status: :processing)
```

Accepting a keyword argument list (`**kwargs`) results in an
`ArgumentError`

```text
ArgumentError: wrong number of arguments (given 1, expected 0)
```
2019-04-09 00:43:53 -04:00
eileencodes
7c87fd5635 Prep release
* Update RAILS_VERSION
* Bundle
* rake update_versions
* rake changelog:header
2019-03-11 11:58:15 -04:00
Rafael Mendonça França
5e6e505083
Preparing for 6.0.0.beta2 release 2019-02-25 17:45:04 -05:00
George Claghorn
ef602f8892 Fix preparing the configured Action Mailbox ingress in production
When reloading is disabled, after_initialize hooks run after to_prepare hooks have already run for the last time. Since to_prepare hooks always run after application initializers, we don't need need to use an after_initialize hook.
2019-02-18 11:50:50 -05:00
Pratik
d0037daa37 Allow skipping incineration of processed emails 2019-02-06 19:28:49 -05:00
Rafael Mendonça França
5a0230c67f
Preparing for 6.0.0.beta1 release 2019-01-18 15:42:12 -05:00
colorbox
620ba4c12a Fix document formatting on ActionMailbox [ci skip]
Use `+` instead of backquote.
2019-01-17 01:10:21 +09:00
George Claghorn
512b5316dd
Add Exim and Qmail support to Action Mailbox 2019-01-12 21:38:26 -05:00
George Claghorn
9adc2aa303 Exclude ActionMailbox::Base#perform_processing and #finished_processing? from API docs 2019-01-01 07:34:20 -05:00
George Claghorn
1c2747ee22 Document ActionMailbox::Base#bounce_with [ci skip] 2019-01-01 07:33:15 -05:00