Commit Graph

93 Commits

Author SHA1 Message Date
José Valim
851a4eab3c Oops, missing autoload, closes #466 2011-05-09 15:12:58 +02:00
José Valim
13df194c00 Tidy up pending TODOs after discussion with Mr. Gatoz (@wycats). 2011-05-01 19:39:57 +02:00
José Valim
367bdc5361 Remove view dependency from AV::Renderer. 2011-05-01 13:40:13 +02:00
José Valim
33cc001f91 More cleanup and moving responsibilities around. 2011-05-01 13:40:12 +02:00
José Valim
d08f65118c Start abstracting the renderer. 2011-05-01 13:40:12 +02:00
José Valim
e30ca001ef Yo dawg, I heard you like streaming. So I put a fiber, inside a block, inside a body, so you can stream. 2011-04-16 10:28:47 +02:00
José Valim
fad214b9e1 Initial work on fibered layout. 2011-04-16 01:10:13 +02:00
Prem Sichanugrist
839d06f5f2 We're in 2011, let's update our license
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-02-22 18:24:20 -02:00
José Valim
aa508c9baf SReorganize autoloads slightly and move two files to lib/action_view root. 2010-10-14 09:32:53 +02:00
Aaron Patterson
ee7863eaac removing some load path tomfoolery 2010-10-11 11:30:22 -07:00
Aaron Patterson
333e033064 fixing railties tests 2010-10-11 11:24:00 -07:00
José Valim
5ec27189b8 Do not allow templates coming from Fallback resolvers to store a virtual path. 2010-10-10 23:12:23 +02:00
José Valim
b88f4ca93b Clean up the house before moving in the new furniture.
This commit moves all the template rendering logic that was hanging around AV::Base to renderer objects.
2010-10-10 12:43:26 +02:00
Łukasz Strzałkowski
c5c839f75f Cleaned up autoload definitions.
Now it's more transparent, and readable

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-02 11:53:58 +02:00
José Valim
c565f0060a No need to delegate. Simply include the whole RecordIdentifier module. 2010-07-21 11:46:38 +02:00
wycats
80b60671f7 Revert "Moved encoding work in progress to a feature branch."
This reverts commit ade756fe42.
2010-05-17 19:41:54 +04:00
Jeremy Kemper
ade756fe42 Moved encoding work in progress to a feature branch.
This reverts commits af0d1a8815 and 64d109e353.
2010-05-16 13:55:29 -07:00
wycats
64d109e353 Significantly improved internal encoding heuristics and support.
* Default Encoding.default_internal to UTF-8
* Eliminated the use of file-wide magic comments to coerce code evaluated inside the file
* Read templates as BINARY, use default_external or template-wide magic comments
  inside the Template to set the initial encoding
  * This means that template handlers in Ruby 1.9 will receive Strings encoded
    in default_internal (UTF-8 by default)
* Create a better Exception for encoding issues, and use it when the template
  source has bytes that are not compatible with the specified encoding
* Allow template handlers to opt-into handling BINARY. If they do so, they
  need to do some of their own manual encoding work
* Added a "Configuration Gotchas" section to the intro Rails Guide instructing
  users to use UTF-8 for everything
* Use config.encoding= in Ruby 1.8, and raise if a value that is an invalid
  $KCODE value is used

Also:
* Fixed a few tests that were assert() rather than assert_equal() and
  were caught by Minitest requiring a String for the message
* Fixed a test where an assert_select was misformed, also caught by
  Minitest being more restrictive
* Fixed a test where a Rack response was returning a String rather
  than an Enumerable
2010-05-16 22:44:43 +04:00
wycats
af0d1a8815 Initial work to improve the state of encodings for templates 2010-05-16 22:43:35 +04:00
wycats
9f92563892 Eliminate an error from an implicit dependency on AV::Base 2010-03-19 11:50:03 -07:00
José Valim
07cf49aadf Optimize and clean up how details key get expired. 2010-03-10 22:13:29 +01:00
José Valim
7942e90960 Merge master. 2010-03-08 21:06:26 +01:00
José Valim
44ebab96da Rename Template::Lookup to LookupContext. 2010-03-08 15:19:03 +01:00
José Valim
ea68fe59c6 More refactoring on the views side of rendering. 2010-03-08 14:46:57 +01:00
wycats
39d6f9e112 Make many parts of Rails lazy. In order to facilitate this,
add lazy_load_hooks.rb, which allows us to declare code that
should be run at some later time. For instance, this allows
us to defer requiring ActiveRecord::Base at boot time purely
to apply configuration. Instead, we register a hook that should
apply configuration once ActiveRecord::Base is loaded.

With these changes, brings down total boot time of a
new app to 300ms in production and 400ms in dev.

TODO: rename base_hook
2010-03-07 06:24:30 -08:00
Mikel Lindsaar
d1eed079e1 Merge branch 'master' of git://github.com/rails/rails 2010-02-02 10:51:19 +11:00
Santiago Pastorino
1adfb92135 Deleted all references to ActionView::SafeBuffer in favor of ActiveSupport::SafeBuffer
Signed-off-by: Yehuda Katz <wycats@Yehuda-Katz.local>
2010-01-31 22:14:18 -08:00
Santiago Pastorino
9987a00738 action_view/safe_buffer is no longer valid
Signed-off-by: Yehuda Katz <wycats@Yehuda-Katz.local>
2010-01-31 21:55:41 -08:00
Yehuda Katz
4cbb9db0a5 For performance reasons, you can no longer call html_safe! on Strings. Instead, all Strings are always not html_safe?. Instead, you can get a SafeBuffer from a String by calling #html_safe, which will SafeBuffer.new(self).
* Additionally, instead of doing concat("</form>".html_safe), you can do
    safe_concat("</form>"), which will skip both the flag set, and the flag
    check.
  * For the first pass, I converted virtually all #html_safe!s to #html_safe,
    and the tests pass. A further optimization would be to try to use
    #safe_concat as much as possible, reducing the performance impact if
    we know up front that a String is safe.
2010-01-31 19:39:13 -08:00
Mikel Lindsaar
65ad16568c Updating copyright dates on all licenses 2010-02-01 10:10:53 +11:00
Joshua Peek
cf83a6f16b Autoload AC and AV test case classes 2010-01-04 16:22:46 -06:00
Carlhuda
9653599a79 Remove the ActionView::Base autoload because it creates crazy circular autoload insanity 2009-12-23 18:59:49 -08:00
Joshua Peek
ace20bd25e Flip deferrable autoload convention 2009-12-22 17:27:37 -06:00
Yehuda Katz
8b4735fbd9 Add active_support/ruby/shim to the default requirements for AP components 2009-12-20 14:06:40 -08:00
Joshua Peek
7ee5843c3c Fully expand relative rails framework paths and make sure we aren't
adding any to the load path more than once.
2009-12-16 11:56:51 -06:00
Nathan Weizenbaum
c517a4fb9a Add autoloads for ActionView::Template* classes, and an ActionView::TemplateError alias for ActionView::Template::Error.
Signed-off-by: Yehuda Katz <wycats@Yehuda-Katz.local>
2009-12-10 13:11:21 -08:00
Carlhuda
c1304098cc Reorganize autoloads:
* A new module (ActiveSupport::Autoload) is provide that extends
    autoloading with new behavior.
  * All autoloads in modules that have extended ActiveSupport::Autoload
    will be eagerly required in threadsafe environments
  * Autoloads can optionally leave off the path if the path is the same
    as full_constant_name.underscore
  * It is possible to specify that a group of autoloads live under an
    additional path. For instance, all of ActionDispatch's middlewares
    are ActionDispatch::MiddlewareName, but they live under 
    "action_dispatch/middlewares/middleware_name"
  * It is possible to specify that a group of autoloads are all found
    at the same path. For instance, a number of exceptions might all
    be declared there.
  * One consequence of this is that testing-related constants are not
    autoloaded. To get the testing helpers for a given component,
    require "component_name/test_case". For instance, "action_controller/test_case".
  * test_help.rb, which is automatically required by a Rails application's
    test helper, requires the test_case.rb for all active components, so
    this change will not be disruptive in existing or new applications.
2009-12-02 20:01:08 -08:00
Yehuda Katz
45d8ff08a4 Remove reference to class that doesn't exist (ht: brynary) 2009-11-28 21:36:58 -08:00
Michael Koziarski
9415935902 Switch to on-by-default XSS escaping for rails.
This consists of:

  * String#html_safe! a method to mark a string as 'safe'
  * ActionView::SafeBuffer a string subclass which escapes anything unsafe which is concatenated to it
  * Calls to String#html_safe! throughout the rails helpers
  * a 'raw' helper which lets you concatenate trusted HTML from non-safety-aware sources (e.g. presantized strings in the DB)
  * New ERB implementation based on erubis which uses a SafeBuffer instead of a String

Hat tip to Django for the inspiration.
2009-10-08 09:31:20 +13:00
José Valim
befec8a0d8 Remove unused code in ActionView.
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-09-15 16:18:10 -07:00
Jeremy Kemper
b8e914709c Require active_support after autoload setup 2009-09-14 13:04:43 -07:00
Yehuda Katz + Carl Lerche
f3fc5c4b5f Refactor ActionView::Resolver 2009-09-03 11:18:57 -07:00
Yehuda Katz
0f2914be40 Separate ActionView::Context so something else can easily be made into an AV context 2009-07-19 22:31:44 +09:00
Yehuda Katz
1a2946a6d9 Add some missing dependencies 2009-07-15 14:16:30 -07:00
Yehuda Katz + Carl Lerche
65102c8f1a Cleaning up more tests and code that needed to work in both old and new base 2009-06-17 16:51:51 -07:00
Yehuda Katz + Carl Lerche
251a6e492c Rename path.rb to resolver.rb 2009-06-17 15:39:41 -07:00
Yehuda Katz + Carl Lerche
d8f352e970 Rename ActionView::Template::Path ActionView::Resolver 2009-06-17 15:32:55 -07:00
Yehuda Katz + Carl Lerche
8fac2c88ca Cleaning up more render tests 2009-05-14 15:30:35 -07:00
Jeremy Kemper
e8550ee032 Cherry-pick core extensions 2009-05-13 12:00:15 -07:00
Jeremy Kemper
ab321268f8 No more free lunch 2009-04-22 16:10:49 -07:00