Commit Graph

1436 Commits

Author SHA1 Message Date
Rafael Mendonça França
fe1f4b2ad5
Add more rubocop rules about whitespaces 2016-10-29 01:17:49 -02:00
Rafael Mendonça França
79a5ea9ead
Remove deprecated support to :text in render 2016-10-10 00:02:52 -03:00
Ryuta Kamizono
3464cd5c28 Fix broken comments indentation caused by rubocop auto-correct [ci skip]
All indentation was normalized by rubocop auto-correct at 80e66cc4d90bf8c15d1a5f6e3152e90147f00772.
But comments was still kept absolute position. This commit aligns
comments with method definitions for consistency.
2016-09-14 18:26:32 +09:00
Xavier Noria
810dff7c9f RuboCop is 100% green 🎉 2016-09-02 00:43:33 +02:00
Xavier Noria
bb1ecdcc67 fixes remaining RuboCop issues [Vipul A M, Xavier Noria] 2016-09-01 23:41:49 +02:00
Rafael Mendonça França
0510208dd1
Add load hooks to all tests classes
Usually users extends tests classes doing something like:

    ActionView::TestCase.include MyCustomTestHelpers

This is bad because it will load the ActionView::TestCase right aways
and this will load ActionController::Base making its on_load hooks to
execute early than it should.

One way to fix this is using the on_load hooks of the components like:

    ActiveSupport.on_load(:action_view) do
      ActionView::TestCase.include MyCustomTestHelpers
    end

The problem with this approach is that the test extension will be only
load when ActionView::Base is loaded and this may happen too late in the
test.

To fix this we are adding hooks to people extend the test classes that
will be loaded exactly when the test classes are needed.
2016-08-25 04:22:48 -03:00
Rafael Mendonça França
55f9b8129a
Add three new rubocop rules
Style/SpaceBeforeBlockBraces
Style/SpaceInsideBlockBraces
Style/SpaceInsideHashLiteralBraces

Fix all violations in the repository.
2016-08-16 04:30:11 -03:00
Xavier Noria
432222fae1 prefer __dir__ over __FILE__ in File.expand_path
Thinking .. relative to files is not natural, we are used
to think "parent of a directory", and we have __dir__
nowadays.
2016-08-11 01:03:14 +02:00
Xavier Noria
46f511685c revises more Lint/EndAlignment offenses 2016-08-08 18:25:11 +02:00
Xavier Noria
a9dc45459a code gardening: removes redundant selfs
A few have been left for aesthetic reasons, but have made a pass
and removed most of them.

Note that if the method `foo` returns an array, `foo << 1`
is a regular push, nothing to do with assignments, so
no self required.
2016-08-08 01:12:38 +02:00
Stan Lo
ab2af4dfcb Modify LogSubscriber for single partial's cache message.
Implement naive partial caching mechanism.

Add test for LogSubscriber

Use ActionView::Base#log_payload to store log_subscriber's payload, so we can pass cache result into it.

Fixed tests

Remove useless settings

Check if #log_payload exists before calling it. Because other classes also includes CacheHelper but don't have is attribute

Use @log_payload_for_partial_reder instead of #log_payload to carry ActionView's payload.

Update test's hash syntax

Add configuration to enable/disable fragment caching logging

Remove unless test and add new test to ensure cache info won't effect next rendering's log

Move :enable_fragment_cache_logging config from ActionView to ActionPack

Apply new config to tests

Update actionview's changelog

Update configuration guide

Improve actionview's changelog

Refactor PartialRenderer#render and log tests

Mute subscriber's log instead of disabling instrumentation.

Fix typo, remove useless comment and use new hash syntax

Improve actionpack's log_subscriber test

Fix rebase mistake

Apply new config to all caching intstrument actions
2016-08-08 00:24:39 +08:00
Ryuta Kamizono
762e3f05f3 Add Style/EmptyLines in .rubocop.yml and remove extra empty lines 2016-08-07 17:50:59 +09:00
Xavier Noria
b326e82dc0 applies remaining conventions across the project 2016-08-06 20:20:22 +02:00
Xavier Noria
80e66cc4d9 normalizes indentation and whitespace across the project 2016-08-06 20:16:27 +02:00
Xavier Noria
e6ab70c439 applies new string literal convention to the rest of the project
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
2016-08-06 19:28:46 +02:00
Xavier Noria
adca8154c6 applies new string literal convention in the gemspecs
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
2016-08-06 19:27:12 +02:00
Xavier Noria
b91ff557ef applies new string literal convention in actionmailer/test
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
2016-08-06 19:03:39 +02:00
Xavier Noria
c3e7abddfb applies new string literal convention in actionmailer/lib
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
2016-08-06 19:01:31 +02:00
yuuji.yaginuma
2a45296114 remove -t option from default sendmail arguments [ci skip]
Follow up to #24436
2016-07-06 18:57:53 +09:00
Jonne Haß
5e3fb2f7b0
Do not suggest nonsensical OpenSSL verify modes [ci skip]
SSL_set_verify(3) explains:

SSL_VERIFY_FAIL_IF_NO_PEER_CERT
  Server mode: if the client did not return a certificate, the TLS/SSL
handshake is immediately terminated with a "handshake failure" alert.
This flag must
  be used together with SSL_VERIFY_PEER.

  Client mode: ignored

SSL_VERIFY_CLIENT_ONCE
  Server mode: only request a client certificate on the initial TLS/SSL
handshake. Do not ask for a client certificate again in case of a
renegotiation.
  This flag must be used together with SSL_VERIFY_PEER.

  Client mode: ignored

The SMTP connection here uses a OpenSSL socket in client mode,
suggesting invalid/ignored flags is rather misleading.
2016-06-07 15:50:46 +02:00
Rajat Bansal
72a0f5e24c fix grammar 2016-05-31 13:31:18 +05:30
Javan Makhmali
d12209cad2 Remove package:clean task
Introduced in d6f2000a67cc63aa67414c75ce77de671824ec52 and was only used by Action Cable. Now handled by Action Cable’s assets:compile task.
2016-05-24 13:11:28 -04:00
Jeremy Daer
e35b98e6f5
Action Mailer: Declarative exception handling with rescue_from.
Follows the same pattern as controllers and jobs. Exceptions raised in
delivery jobs (enqueued by `#deliver_later`) are also delegated to the
mailer's rescue_from handlers, so you can handle the DeserializationError
raised by delivery jobs:

```ruby
class MyMailer < ApplicationMailer
  rescue_from ActiveJob::DeserializationError do
    …
  end
```

ActiveSupport::Rescuable polish:
* Add the `rescue_with_handler` class method so exceptions may be
  handled at the class level without requiring an instance.
* Rationalize `exception.cause` handling. If no handler matches the
  exception, fall back to the handler that matches its cause.
* Handle exceptions raised elsewhere. Pass `object: …` to execute
  the `rescue_from` handler (e.g. a method call or a block to
  instance_exec) against a different object. Defaults to `self`.
2016-05-15 18:44:16 -07:00
Rafael Mendonça França
8ecc5ab1d8 Start Rails 5.1 development 🎉 2016-05-10 03:46:56 -03:00
Connor Shea
86c860ff0c
Update rails-dom-testing gem to 2.0
Resolves #24924.
2016-05-09 20:23:42 -06:00
Pedro Adame Vergara
7cffd6b372 Add :ssl/:tls to ActionMailer [ci skip] 2016-05-09 21:20:29 +02:00
Rafael Mendonça França
fbdcf5221a Preparing for 5.0.0.rc1 release 2016-05-06 16:54:40 -05:00
Rafael França
063bc008b3 Merge pull request #24589 from vipulnsward/am-fragment-cache
Expand on Action Mailer Fragment caching tests
2016-05-05 16:26:47 -05:00
eileencodes
f7a986012a Prep Rails 5 beta 4 2016-04-27 15:48:47 -05:00
arktisklada
9d63111499
Clear ActionMailer deliveries on setup and teardown
Signed-off-by: Jeremy Daer <jeremydaer@gmail.com>
2016-04-25 22:41:18 -05:00
Vipul A M
cbb25c4b1c Expand on Action Mailer Fragment caching tests 2016-04-17 23:16:09 +05:30
Edouard CHIN
106ac1016f Small typo on a method name:
- clear_test_deliviers -> clear_test_deliveries
2016-04-15 13:27:09 -04:00
Vipul A M
aeffcf25b4 Merge pull request #24525 from tomkadwill/action-mailer-base-docs2
Update ActionMailer base documentation [ci skip]
2016-04-14 02:14:58 +05:30
Tom Kadwill
d2f87d7000 Update ActionMailer base documentation [ci skip] 2016-04-13 21:40:03 +01:00
Yves Senn
c9238500bd Merge pull request #24497 from vipulnsward/am-changelog-pass
Pass over AM changelog [ci skip]
2016-04-11 17:02:20 +02:00
Vipul A M
829650ebe4 Pass over AM changelog
- Fixed statement about setting `config.action_mailer.default_url_options = {protocol: 'https'}` . We are just setting the protocol key to 'https', not replacing/initializing the complete config.
- Fixed grammar in assert_emails changlog
- Added sentence separator for code ":"

[ci skip]
2016-04-10 23:45:58 +05:30
Tom Kadwill
83ac216933 Update ActionMailer Views documentation [ci skip] 2016-04-10 14:31:32 +01:00
Jeremy Daer
2080ff2872 Merge pull request #24457 from jeremy/mailer/dont-deliver-later-after-message-is-loaded
Disallow calling `#deliver_later` after local message modifications.
2016-04-08 18:40:39 -07:00
yuuji.yaginuma
a972fb81f0 remove blank line generated in application_mailer.rb 2016-04-08 06:47:46 +09:00
Jeremy Daer
95e06e6682 Disallow calling #deliver_later after local message modifications.
They would be lost when the delivery job is enqueued, otherwise.
Prevents a common, hard-to-find bug like:

```ruby
message = Notifier.welcome(user, foo)
message.message_id = my_generated_message_id
message.deliver_later
```

The message_id is silently lost here! *Only the mailer arguments are
passed to the delivery job.*

This raises an exception now.

Make modifications to the message within the mailer method or use a
custom Active Job to manage delivery instead of using #deliver_later.
2016-04-07 13:36:50 -07:00
arktisklada
23e4c968d2 Sendmail default arguments match Mail::SendMail
Removes `-t`
2016-04-05 14:11:37 -05:00
yui-knk
5aa6c85c3b Suppress warnings
"Using a dynamic :controller (or :action) segment in a route is deprecated"
by 6520ea5f7e2215a763ca74bf6cfa87be2347d5df (#23980).
2016-03-31 01:07:43 +09:00
Prathamesh Sonpatki
5ac7bd3ec4 Pass over CHANGELOGs [ci skip] 2016-03-30 12:23:29 +05:30
Rafael França
878c2bbaaf Merge pull request #24164 from prathamesh-sonpatki/fix-application-mailer
Correctly generate application_mailer.rb in mountable engines
2016-03-23 23:05:26 -03:00
Rafael Mendonça França
07f3ae8f35 Fix generator test to match to use the string 2016-03-21 14:07:38 -03:00
Matt Hall
94ee86c162 switched layout :mailer to a string so that mail layout can be properly found and mail can be delivered properly 2016-03-17 17:13:20 -04:00
Prathamesh Sonpatki
4d0bf49b92 Correctly generate application_mailer.rb in mountable engines
- Followup of https://github.com/rails/rails/pull/24161.
2016-03-12 09:40:54 +05:30
Sen-Zhang
1be9563625 improve some code 2016-03-11 16:59:06 -08:00
Sen-Zhang
0b3ae023d2 generate application_mailer.rb if it is missing 2016-03-11 16:47:08 -08:00
Gadzhi Gadzhiev
37606d016d Remove redundant regexp escapes in generators 2016-03-08 15:30:12 +03:00