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

15 commits

Author SHA1 Message Date
Akira Matsuda
8ae2fdd267 [Action View] require_relative => require
This basically reverts c4d1a4efee
2017-10-21 22:48:28 +09:00
Kir Shatrov
424117281e Use frozen string literal in actionview/ 2017-07-24 11:53:43 +03:00
Akira Matsuda
c4d1a4efee [Action View] require => require_relative 2017-07-01 18:38:04 +09: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
66a7cfa910 applies new string literal convention in actionview/lib
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
2016-08-06 18:48:35 +02:00
Aaron Patterson
dfa0ab50f9 sort templates after looking them up in the from the paths cache
The view paths cache will eventually query the filesystem when looking
up templates:

  2db347bebc/actionview/lib/action_view/template/resolver.rb (L224-L230)

The order in which files are returned is file system dependent.  Since
the template digest [depends on its children](2db347bebc/actionview/lib/action_view/digestor.rb (L109-L115)), the order of the dependencies will impact the fingerprint.
This commit sorts the wildcard dependencies so that we get a consistent
hash.

Fixes #23592
2016-02-10 15:44:27 -08:00
Aaron Patterson
81f75f578a check supports_view_paths? at registration time
If we check the conditional at registration time, then we can avoid the
conditional at runtime.  This commit checks for view path support when
the handler is registered so that runtime calls to `find_dependencies`
won't need to check the conditional.  The idea is that
`register_tracker` is called only once where `find_dependencies` may be
called many times.
2016-02-10 14:42:09 -08:00
Jerry D'Antonio
23b6f65fd1 Require only necessary concurrent-ruby classes. 2015-11-04 21:12:28 -05:00
Jerry D'Antonio
56ac6e4768 Replaced ThreadSafe::Map with successor Concurrent::Map.
The thread_safe gem is being deprecated and all its code has been merged
into the concurrent-ruby gem. The new class, Concurrent::Map, is exactly
the same as its predecessor except for fixes to two bugs discovered
during the merge.
2015-09-19 09:56:26 -04:00
Kasper Timm Hansen
a6509d3112 Add wildcard template dependencies. 2015-07-26 19:21:14 +02:00
Juho Leinonen
4640c346ea Fix dependency tracker bug 2015-02-25 14:57:29 +02:00
David Heinemeier Hansson
da1b8a786c Fix that render layout should also be picked up by the template dependency tracker, but only half-ways. You can add that layout option on the same render call, and both templates should be added to the dependency tree. But thats going to require a more serious rework of the tracker. Please do help fix this part of it too. For now, render layout needs to be on its own line. 2014-07-25 16:37:18 -07:00
João Britto
ccbba3ff50 Avoid scanning multiple render calls as a single match.
Each chunk of text coming after `render` is now handled individually as a possible list of arguments.
2014-01-09 20:37:00 -02:00
João Britto
c2afa05561 Improve ERB dependency detection.
The current implementation can't handle some special cases of oddly-formatted Ruby. Now we are able to detect them:

* Multi-line arguments on the `render` call
* Strings containing quotes, e.g. `"something's wrong"`
* Multiple kinds of identifiers - instance variables, class variables and globals
* Method chains as arguments for the `render` call

Also, this fix reduces the rate of "false positives" which showed up when we had calls/access to identifiers containing `render`, like `surrender` and `rendering`.
2014-01-09 20:36:59 -02:00
Piotr Sarnacki
0d6e8edc2a Move actionpack/lib/action_view* into actionview/lib 2013-06-20 17:23:15 +02:00
Renamed from actionpack/lib/action_view/dependency_tracker.rb (Browse further)