Commit Graph

2476 Commits

Author SHA1 Message Date
José Valim
af0d1fa892 Update Orchestra instrumentations and move part of logging to Orchestra. 2009-10-15 18:18:44 -03:00
José Valim
8b340ab2f6 Revert "Rename Orchestra to Notifications [#3321 state:resolved]"
This reverts commit 8cbf825425dc8ad3770881ea4e100b9023c69ce2.
2009-10-15 18:06:15 -03:00
Joshua Peek
bc1a18d7bd Punt on ConcurrentHash [#3322 state:resolved] 2009-10-14 19:53:52 -05:00
Joshua Peek
8cbf825425 Rename Orchestra to Notifications [#3321 state:resolved] 2009-10-14 19:50:36 -05:00
Craig Smith
316f4704ea Test cases should see all the cookies, not just cookies that have been set in the controller.
Previously this example would always pass, even when cookies.delete was not called.

@request.cookies['foo'] = 'bar'
get :delete_cookie
assert_nil cookies['foo']

Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#2768 state:committed]
2009-10-15 10:58:55 +13:00
Michael Koziarski
5d5e34fa52 Use ERB::Util.h over CGI.escapeHTML as the former is safety aware and the latter isn't 2009-10-15 09:58:17 +13:00
Jeffrey Hardy
a8dc9fd27b CookieJar#delete should return the key's value, consistent with a Hash
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-10-14 11:50:51 -07:00
Carl Lerche
992c2db76c Finish porting over the initializers to the app object and fix all the tests 2009-10-08 18:12:28 -07:00
Joshua Peek
76d823677f Revert "Revert "Fix Dispatch.new so passenger works" as it broke the build"
This reverts commit 49b52cadc2e66c11a025e7719837ae77b3736046.
2009-10-05 09:17:51 -05:00
Michael Koziarski
49b52cadc2 Revert "Fix Dispatch.new so passenger works" as it broke the build
This reverts commit c97c31b096e627480b64403d1460065738941c3e.
2009-10-05 17:23:37 +13:00
Joshua Peek
c97c31b096 Fix Dispatch.new so passenger works 2009-10-04 12:45:53 -05:00
Erik Ostrom
8ffc2e3b8d Ported the new ActionView::TestCase from 2-3-stable to master [#3260
state:resolved]

The test case now mimicks the template environment more closely, so it's
possible to use render, load helper dependencies.

This also fixes assert_select, and similar assertions. Because view tests
and helpers generally don't render full templates assert_select looks
first in rendered and then in output_buffer to find the rendered output.

Additional `master'-only changes: Made the Action Pack Rakefile run the
ActionView::TestCase tests, and made ActionView::Rendering#_render_text
always return a string.

Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-09-28 13:31:30 -05:00
Joshua Peek
a6757a02e1 Move middleware and route configuration from AC::Dispatcher to Rails application object 2009-09-26 21:59:28 -05:00
Joshua Peek
1f72700575 Move default middleware stack into initializer 2009-09-26 13:41:32 -05:00
Yehuda Katz + Carl Lerche
f0dd77c6be Move railties/lib/* into railties/lib/* 2009-09-24 16:11:41 -07:00
Joshua Peek
9f96708f53 Resurrect AC::Benchmarking [#3140 state:resolved] 2009-09-24 12:13:09 -05:00
Joshua Peek
3fb623fa90 SessionRestoreError belongs in AD 2009-09-23 23:37:31 -05:00
Joshua Peek
542ddde5d4 Move helpers specific to functional tests out of TestProcess into AC::TestCase 2009-09-23 23:03:24 -05:00
Joshua Peek
4a55d1de8d Move integration test runner into ActionDispatch 2009-09-23 22:38:19 -05:00
José Valim
a0233dd3b2 Use NewCallbacks on ActionDispatch::Callbacks. 2009-09-20 10:56:38 -03:00
José Valim
7cc1c2e71d Add Orchestra instrumentation to fragment and page caching. 2009-09-20 10:56:38 -03:00
Joshua Peek
90d7ae23c6 Remove global exception catching from ApplicationController.
It was severely broken since it was ported to NewBase and is causing problems with normal exception catching. A replacement is coming soon.
2009-09-15 10:05:46 -05:00
Jeremy Kemper
af68eb99c1 Uses extlib_inheritable_accessor 2009-09-14 13:04:43 -07:00
Joshua Peek
8491b77f55 Omit PATH_INFO in integration test so rack mock will properly override it 2009-09-13 17:15:35 -05:00
Yehuda Katz
76cd4cb27e Memoize in the endpoint. 2009-09-12 15:38:34 -05:00
Yehuda Katz
7152a4e9a6 Add per-controller middleware 2009-09-12 13:51:15 -05:00
Nathaniel Talbott
f024aabee3 Fix filtering parameters when there are Fixnum or other un-dupable values.
[#3184 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-09-10 18:53:50 -07:00
Joshua Peek
c531bd6665 Cleanup hacky routing with controller_path in url helper tests. This doesn't work in real life anyway. 2009-09-06 22:29:29 -05:00
Yehuda Katz + Carl Lerche
e3744166ec Refactor ActionController to use find_template and template_exists? 2009-09-03 12:52:53 -07:00
Yehuda Katz + Carl Lerche
f3fc5c4b5f Refactor ActionView::Resolver 2009-09-03 11:18:57 -07:00
Joshua Peek
a79790e1a5 rack-test 0.4.2 has rack 1.1.pre goodies, we'll use it instead 2009-08-31 23:08:20 -05:00
Joshua Peek
5e5e34377c Back off rack 1.1-pre and bundle in the new testing goodies 2009-08-31 15:39:19 -05:00
José Valim
3f78de67b5 Ensure that blocks are also handled inside the responder. 2009-08-29 18:21:19 +02:00
José Valim
684a6b3c71 Attempt to render the template inside the responder, so it can be used for caching and pagination.
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-08-29 11:01:00 -05:00
Joshua Peek
ba5995dcd9 Reset session in integration tests after changing routes to reload the middleware stack 2009-08-27 12:43:26 -05:00
Carl Lerche
4467fa7d24 Fixed stupid mistake... nothing to see here. 2009-08-26 20:51:54 -07:00
Carl Lerche
2890760665 Set the request and response in ActionController::Middleware 2009-08-26 19:52:18 -07:00
Jeffrey Hardy
05b529ca57 UrlRewriter#rewrite_url should call #to_param on the value given in :anchor option, just as #url_for does
[#2746 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-26 14:11:26 -07:00
Yehuda Katz
9408fcd2e8 Create new ActionController::Middleware class that will work as a normal Rack middleware.
* This initial implementation is a bit hackish, but it uses a normal middleware API
    so it's future-proof when we improve the internals.
2009-08-26 00:18:52 -07:00
Yehuda Katz + Carl Lerche
5bc66f160d And the same thing for Basic 2009-08-25 17:34:07 -07:00
Yehuda Katz + Carl Lerche
3a5269eba4 HTTP Auth should not depend on RenderingController 2009-08-25 17:29:48 -07:00
Yehuda Katz + Carl Lerche
303f9b8841 Redirector had an undeclared dependency on Logger. 2009-08-25 17:20:58 -07:00
Yehuda Katz + Carl Lerche
469424c85e Modify Digest and Basic to take a request so they can be used outside of the controller 2009-08-25 16:02:26 -07:00
Yehuda Katz + Carl Lerche
c7ba911a43 ActionController::Metal can be a middleware 2009-08-25 12:14:31 -07:00
Joshua Peek
b58acea569 Move legacy param_parsers config onto AD::ParamsParser 2009-08-21 16:49:33 -05:00
Joshua Peek
24ad9ae3d2 Cleanup route reloading in tests. Prefer with_routing over using ActionController::Routing::Routes directly 2009-08-16 21:14:26 -05:00
Joshua Peek
911acc10de Axe "best fit" generation support 2009-08-15 18:08:46 -05:00
Jeremy Kemper
df6617bc8a Normalize route generation order: associations, yield block, then own routes. 2009-08-15 15:56:52 -07:00
Yehuda Katz
1310231c15 Got tests to pass with some more changes.
* request.formats is much simpler now
    * For XHRs or Accept headers with a single item, we use the Accept header
    * For other requests, we use params[:format] or fallback to HTML
    * This is primarily to work around the fact that browsers provide completely
      broken Accept headers, so we have to whitelist the few cases we can
      specifically isolate and treat other requests as coming from the browser
    * For APIs, we can support single-item Accept headers, which disambiguates
      from the browsers
  * Requests to an action that only has an XML template from the browser will
    no longer find the template. This worked previously because most browsers
    provide a catch-all */*, but this was mostly accidental behavior. If you
    want to serve XML, either use the :xml format in links, or explicitly
    specify the XML template: render "template.xml".
2009-08-15 12:32:02 -07:00
Yehuda Katz
9b552fb300 Caches and cache clearing seems to actually work, but the actual architecture is kind of messy. Next: CLEAN UP. 2009-08-15 12:32:01 -07:00
José Valim
8692b11e81 Merge branch 'master' of git://github.com/rails/rails 2009-08-13 10:27:53 +02:00
José Valim
4f9047ecc8 Ensure collections are not treated as nested resources. 2009-08-13 10:27:41 +02:00
Yehuda Katz
4bf516e072 More perf work:
* Move #set_cookie and #delete_cookie inline to optimize. These optimizations should
    almost certainly be sent back upstream to Rack. The optimization involves using
    an ivar for cookies instead of indexing into the headers each time.
  * Was able to use a bare Hash for headers now that cookies have their own joining
    semantics (some code assumed that the raw cookies were an Array).
  * Cache blankness of body on body=
  * Improve expand_cache_key for Arrays of a single element (common in our case)
  * Use a simple layout condition check unless conditions are used
  * Cache visible actions
  * Lazily load the UrlRewriter
  * Make etag an ivar that is set on prepare!
2009-08-11 15:03:53 -07:00
Yehuda Katz
0adbeeb0c9 Got overhead down from 127 to 85. All tests pass:
* Tentatively replaced HeaderHash with SimpleHeaderHash, which does not preserve
    case but does handle converting Arrays to Strings in to_hash. This requires
    further discussion.
  * Moved default_charset to ActionDispatch::Response to avoid having to hop over
    to ActionController. Ideally, this would be a constant on AD::Response, but
    some tests expect to be able to change it dynamically and I didn't want to change
    them yet.
  * Completely override #initialize from Rack::Response. Previously, it was creating
    a HeaderHash, and then we were creating an entirely new one. There is no way to
    call super without incurring the overhead of creating a HeaderHash.
  * Override #write from Rack::Response. Its implementation tracks Content-Length,
    and doing so adds additional overhead that could be mooted if other middleware
    changes the body. It is more efficiently done at the top-level server.
  * Change sending_file to an instance_variable instead of header inspection. In
    general, if a state is important, it should be set as a property of the response
    not reconstructed later.
  * Set the Etag to @body instead of .body. AS::Cache.expand_cache_key handles
    Arrays fine, and it's more efficient to let it handle the body parts, since
    it is not forced to create a joined String.
  * If we detect the default cache control case, just set it, rather than setting
    the constituent parts and then running the normal (expensive) code to generate
    the string.
2009-08-11 15:03:53 -07:00
Joshua Peek
734e903af5 Deprecate router generation "best match" sorting 2009-08-09 22:53:16 -05:00
Hugo Peixoto
202b091373 Added both the documentation and a test case for the collection path name customization feature.
[#1218 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-09 14:26:36 -07:00
Bence Nagy
e1b73b9752 path_names could be used to customize collection actions too
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-09 14:26:36 -07:00
Gabe da Silveira
1185500ff0 Remove unused routeset method routes_for_controller_and_action in favour for routes_for [#3023 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-09 18:02:35 +01:00
Felipe Talavera
654568e71b Allow to configure trusted proxies via ActionController::Base.trusted_proxies [#2126 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-09 16:56:18 +01:00
José Valim
32bde66aa6 Make http digest work with different server/browser combinations
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-09 15:53:52 +01:00
Yehuda Katz
e28e061165 Use response_body rather than performed? 2009-08-09 04:12:09 -03:00
Jan Schwenzien
1f6afe4a74 Fix HTTP basic authentication for long credentials [#2572 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-09 01:28:43 +01:00
Niklas Holmgren
c284412b14 Polymorphic routes generates collection URL from model class [#1089 state:resolved]
Signed-off-by: Dan Pickett <dpickett@enlightsolutions.com>
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-08 17:00:29 +01:00
Yehuda Katz
ad98827a78 Merge commit 'jose/responder' 2009-08-08 12:54:02 -03:00
José Valim
6e0ac748e4 Renamed ActionController::Renderer to ActionController::Responder and ActionController::MimeResponds::Responder to ActionController::MimeResponds::Collector. 2009-08-08 17:48:07 +02:00
Yehuda Katz
efcfce50c4 Fixes "Cached fragment hit" written to log even if fragment is not cached (Erik Andrejko) [#2917 state:resolved] 2009-08-08 12:46:44 -03:00
Yehuda Katz
d0301e13f4 First pass at making partial rendering an Object. More cleanup to come. 2009-08-08 12:44:26 -03:00
Yehuda Katz
010a0c92eb Rename find_by_parts and find_by_parts? to find and exists? 2009-08-07 15:00:12 -03:00
José Valim
aed135d3e2 Renamed presenter to renderer, added some documentation and defined its API. 2009-08-07 17:17:51 +02:00
José Valim
1fd65c80fc Encapsulate respond_with behavior in a presenter. 2009-08-07 17:16:16 +02:00
José Valim
7034272354 Add destroyed? to ActiveRecord, include tests for polymorphic urls for destroyed objects and refactor mime responds tests and documentation. 2009-08-07 17:16:16 +02:00
José Valim
f59984cc81 Add nagivational behavior to respond_with. 2009-08-07 17:16:15 +02:00
José Valim
e45e120af9 Merge branch 'master' of git://github.com/rails/rails into old 2009-08-07 17:13:44 +02:00
Yehuda Katz
bfe58ac05d Get all ActionController partial rendering to use ActionView's partial code. Consequences:
* It is not possible to always pre-determine the layout before going to ActionView.
    This was *already* broken for render :partial => @object, :layout => true. This is
    now handled by overriding render_to_body in layouts.rb and manually injecting the
    partial's response. This needs to be done in ActionController since ActionController
    knows enough to get _layout_for_option. There is probably a better abstraction here.
  * As a result, all partial rendering can correctly restrict their layouts to the mime
    type of the rendered partial. This could have previously caused a bug in some edge cases.
  * If other layout-like options are added, they might need to add special code for the
    case of render :partial. We should try to think of an alternate solution, if possible,
    but this works for the cases we know of now.
2009-08-07 11:33:54 -03:00
José Valim
dac8927b05 Merge branch 'master' of git://github.com/rails/rails into old 2009-08-07 16:10:17 +02:00
Yehuda Katz
8534c5bf19 Start cleaning up partial path 2009-08-07 01:51:50 -03:00
Yehuda Katz
70a440aa27 Clean up render @object a bit more. 2009-08-07 00:52:13 -03:00
Yehuda Katz
0435178ff8 Remove file that doesn't seem to be used anymore 2009-08-06 22:57:42 -03:00
Yehuda Katz
71638e6760 Move AbstractController to a top-level component 2009-08-06 22:51:24 -03:00
Yehuda Katz
16c01224cb ActionController::Metal#to_rack converted to #to_a to match normal rack convention 2009-08-06 20:05:14 -03:00
Yehuda Katz
70d779aaea Update _render_options to reflect the fact that they're public 2009-08-06 20:03:59 -03:00
Yehuda Katz
bd6b61be88 Rename /base to /metal and make base.rb and metal.rb top-level to reflect their module locations 2009-08-06 19:52:11 -03:00
Yehuda Katz
52798fd479 rename ActionController::Http to ActionController::Metal at Josh's suggestion 2009-08-06 19:50:22 -03:00
Yehuda Katz
af375a5eb3 Replace _action_view with view_context to reflect that it is public and that it does not need to be an ActionView instance 2009-08-06 19:45:40 -03:00
Yehuda Katz
f0945409d9 replace _render_*_from_controller with render_* as they are intended to be public 2009-08-06 19:43:28 -03:00
Yehuda Katz
503ce1d01c Update cache_control to be a Hash of options that is used to build the header.
* Significantly simplifies setting and modifying cache control in other areas
2009-08-02 19:39:33 -04:00
Sava Chankov
ec94c2550d Ruby 1.9: fix Content-Length for multibyte send_data streaming
[#2661 state:resolved]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-01 20:25:59 -07:00
José Valim
5b7e81efec Allow respond_with to deal with http verb accordingly. 2009-07-31 11:59:05 +02:00
José Valim
7a4a679dba Remove any resource logic from respond_to. 2009-07-30 22:43:37 +02:00
José Valim
d209aea7d8 Remove last TODO.
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-07-29 12:06:04 -07:00
José Valim
fa0cf663fe Add a couple more tests to respond_with.
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-07-29 12:06:03 -07:00
José Valim
09de34ca56 Added respond_with.
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-07-29 12:06:03 -07:00
José Valim
bbe86077c2 Added tests for respond_to class method.
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-07-29 12:06:03 -07:00
José Valim
67b2d08c0a Ensure that the proper accept header value is set during tests.
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-07-29 12:06:03 -07:00
José Valim
7e280c3bff Remove Mime::ALL from Mime::SET.
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-07-29 12:06:02 -07:00
José Valim
3e8ba616ef Refactor even more Responder. Move mime negotiation to request and added respond_to class method.
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-07-29 12:06:02 -07:00
José Valim
3f445b316d Refactor Responder to only calculate available mime types. Those are sent to the controller that knows what to do with it (render a block or call default render).
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-07-29 12:06:02 -07:00
Pratik Naik
e033b5d037 Merge docrails 2009-07-25 16:03:58 +01:00
Yehuda Katz
5ffaaa71d1 Define ActiveModel API Compliance
- Define to_model on AR
  - Define to_model on ActiveModel::APICompliant
  - Update test fixtures to be API Compliant
  - Start using to_model in AP
2009-07-20 00:27:04 +09:00
Yehuda Katz
bb530923bc Simplify required "ActionView compliant" API 2009-07-19 21:53:02 +09:00
Yehuda Katz
1a2946a6d9 Add some missing dependencies 2009-07-15 14:16:30 -07:00
Yehuda Katz
1273ffa186 Fix AbstractController::Layouts to work when included directly on a controller 2009-07-15 14:16:12 -07:00
Yehuda Katz
28508d444e Centralize commonly used parts of AS in ActionController into action_controller.rb 2009-07-15 14:15:52 -07:00
Yehuda Katz
b0429f5e66 Rename method to a more obvious name 2009-07-11 23:40:36 -04:00
Jesús García Sáez
fc6077d76e Allow symbols on routes declaration (:controller and :action values) [#2828 state:resolved]
Signed-off-by: Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>
2009-07-02 12:18:48 -07:00
Yehuda Katz + Carl Lerche
0515256fd3 Accept Symbol for contoller name [#2855 state:resolved]
Signed-off-by: Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>
2009-07-01 11:16:18 -07:00
Vicente Mundim
68b02cb00a Make filter_parameters work correctly with array parameters. 2009-06-27 12:43:57 +12:00
Joshua Peek
7837da41a3 send_data should set Content-Length as a string 2009-06-25 14:47:15 -05:00
Pratik Naik
97159fad6a Missed file from the previous commit 92b229e1251d7d3578c3f73e8185972354e76436 2009-06-25 17:03:07 +01:00
Pratik Naik
92b229e125 Make performance tests work again 2009-06-25 17:02:04 +01:00
Yehuda Katz
4417a19b03 Small changes to get 1.9 passing (for the most part) 2009-06-23 14:06:22 -07:00
=?utf-8?q?Mislav=20Marohni=C4=87?=
21cd4c0e93 Fix polymorphic_path doesn't modify options hash [#2099 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-06-21 17:53:07 +01:00
Yehuda Katz + Carl Lerche
ca8f8fb031 Remove one more note about deprecated behavior 2009-06-17 18:15:41 -07:00
Yehuda Katz + Carl Lerche
a9ad763c86 Drive the final stake through @content_for_*'s heart! 2009-06-17 18:08:45 -07:00
Yehuda Katz + Carl Lerche
55ee0ba7f5 Cleaning up if defined?(ActionController::Http) blocks from the pre new base era. 2009-06-17 16:23:11 -07:00
Yehuda Katz + Carl Lerche
8fdf3d7890 Remove some defined?(Http) checks 2009-06-17 16:14:05 -07:00
Yehuda Katz + Carl Lerche
487312515c RJS doesn't render with an HTML layout by default 2009-06-17 12:54:19 -07:00
Yehuda Katz + Carl Lerche
315147fcb5 Move the exceptions for missing template into Compatibility in prep for moving it into a "not-production" module 2009-06-16 13:54:55 -07:00
Yehuda Katz + Carl Lerche
dd58f4021d An exception is raised if a layout is missing only if the layout is missing for all mimes 2009-06-16 13:44:51 -07:00
Yehuda Katz + Carl Lerche
01a4bc84b8 Exceptions now in an exceptions module 2009-06-16 11:32:38 -07:00
Yehuda Katz + Carl Lerche
18c3b77b23 Merge process2 into process to people's regular tests run :P 2009-06-16 10:46:03 -07:00
Yehuda Katz + Carl Lerche
3c15cba175 Whoops, I guess we broke layouts ;) 2009-06-15 17:32:10 -07:00
Yehuda Katz + Carl Lerche
19c3495a67 rm -r controller/base! 2009-06-15 16:29:45 -07:00
Yehuda Katz + Carl Lerche
5314abed18 Keep ActionMailer using the old layouts code until it gets refactored. 2009-06-15 11:59:28 -07:00
Yehuda Katz + Carl Lerche
a63caa4c0c Get tests to run (with failures) without old base around 2009-06-15 11:44:45 -07:00
Yehuda Katz + Carl Lerche
5a8a550a45 Finish making things pass with updated internal content_type semantics 2009-06-15 11:21:08 -07:00
Xavier Noria
b56169c262 moves reopening of core classes to add generic stuff from Action Pack to AS/core_ext and adds tests
[#2798 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-06-13 15:01:14 -07:00
Xavier Noria
d32965399c uses Object#metaclass and Object#class_eval in a few spots
[#2797 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-06-12 16:14:06 -07:00
Yehuda Katz + Carl Lerche
47ff57f6d1 Document and clean up HideActions and Http 2009-06-10 15:27:53 -07:00
Yehuda Katz + Carl Lerche
82a10ce9f6 Removed unnecessary code 2009-06-10 14:43:43 -07:00
Yehuda Katz + Carl Lerche
fbb6b936e9 Document ActionController::Helpers 2009-06-10 14:28:58 -07:00
Yehuda Katz + Carl Lerche
316fab7de6 Cleaned up the #default_helper_module method to make better use of #helper instead of duplicating code. 2009-06-10 14:15:21 -07:00
Yehuda Katz + Carl Lerche
4fc0778123 Simplify helper use of ActiveSupport::Dependencies, and use super better for in #helpers 2009-06-10 12:15:30 -07:00
Yehuda Katz + Carl Lerche
b6fde6b480 Clean up AbstractController::Logger and write documentation 2009-06-09 17:03:02 -07:00
Yehuda Katz + Carl Lerche
f35f47b8c0 Cleaning up and documenting AbstractController::Layouts 2009-06-09 16:47:40 -07:00
Yehuda Katz + Carl Lerche
acb2447785 Write documentation for AbstractController::Helpers 2009-06-09 16:47:39 -07:00
nate
f68cc639f5 A test to show that http_authentication needs to fail authentication if the password procedure returns nil. Also includes a fix to validate_digest_response to fail validation if the password procedure returns nil.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
2009-06-09 19:47:53 +12:00
Yehuda Katz + Carl Lerche
be371993b7 More documentation work on AbstractController
This is still not completely done and there might be pointers to things that don't exist yet.
2009-06-08 17:41:08 -07:00
Yehuda Katz + Carl Lerche
38b608ecab Writing comments to AbstractController 2009-06-08 16:15:14 -07:00
Yehuda Katz + Carl Lerche
a470bb3612 Remove extraneous response_obj 2009-06-08 16:15:13 -07:00
Yehuda Katz + Carl Lerche
86fc43fd58 ActionPack components should no longer have undeclared dependencies.
* Tests can be run in isolation
  * Dependencies added
  * A few tests modified to avoid depending on AS deps 
    not depended on my files they were testing
2009-06-08 13:34:07 -07:00
Yehuda Katz
1126a85aed Further cleaning up new callbacks 2009-06-02 21:41:31 -07:00
Yehuda Katz
971e2438d9 Simplify callbacks to use less metaprogramming 2009-06-02 19:00:59 -07:00
Yehuda Katz + Carl Lerche
196f780e30 Get all the callback tests to work on new base 2009-06-01 15:40:40 -07:00
Jeremy Kemper
c79551f02b Depend on Hash#slice and Object#try 2009-05-30 11:59:17 -07:00
Jeremy Kemper
c53057d4fd html-scanner uses Set and class_inheritable_accessor 2009-05-30 11:59:17 -07:00
Joshua Peek
669fd84910 AS::Concern redefines "include" to lazy include modules as dependencies 2009-05-29 17:03:23 -05:00
Joshua Peek
c7c35be8fe AS::Concern includes InstanceMethods module if it exists 2009-05-29 16:28:54 -05:00
Joshua Peek
4e50a35fa2 Break up DependencyModule's dual function of providing a "depend_on" DSL and "included" block DSL into separate modules. But, unify both approaches under AS::Concern. 2009-05-28 11:35:36 -05:00
Joshua Peek
de203245af Revert "Revert "Whitespace!""
This reverts commit 0cac68d3bed3e6bf8ec2eb994858e4a179046941.
2009-05-28 09:49:02 -05:00
Johan Sörensen
72cb6f58be The FlashHash and friends causes a lot of needless session storing, when we know for a fact that there's no content in the flash. By not storing the empty hash in the session we save a lot of communication with the various session backends, while still keeping the same interface to the flash. [#2703 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-05-28 09:30:49 -05:00
Olly Legg
0349278f3d Memoize cookies so that updates to cookies are available in the current request. [#2733 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-05-28 09:18:27 -05:00
Yehuda Katz + Carl Lerche
f2f58f5355 Fix failing ActionCacheFilter tests due to around filter changes. 2009-05-27 17:31:48 -07:00
Yehuda Katz + Carl Lerche
e70bd6bdfa Added hook point in new base #send_action which does the actual action method dispatching 2009-05-27 16:16:33 -07:00
Carl Lerche
a5688fa907 Add the ability to prepend filters to new callbacks 2009-05-27 16:15:53 -07:00
Eduard Bondarenko
61c471eebb Add % to RESERVED_PCHAR [#2574 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-05-27 14:53:05 -05:00
Niels Ganser
bb8e5843f3 ActionController::Flash::FlashHash.use now returns either the value corresponding to the passed key or itself when no key is passed [#1792 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-05-27 14:51:33 -05:00
Yehuda Katz
6bbe965ccd Reduce the cost of using ActionController::Http significantly by:
* Removing the dependency on AD::Request and AD::Response
  * Moving the logic for the request and response object
    into a new module that is included by default.
  * Changing Renderer and Redirector to use self.headers,
    self.content_type, and self.status, which have very basic
    default implementations on AC::Http. When RackConvenience
    is included (which it is by default on AC::Base), the full
    Request/Response logic is used instead of the simple logic.
2009-05-27 10:40:43 +02:00
Carl Lerche
7211048b2b Get all template tests passing on new base 2009-05-26 15:19:39 -07:00
Carl Lerche
a1f280e83d Got all the dispatch tests running on new base 2009-05-26 15:03:09 -07:00
Carl Lerche
a3ca5638d3 Get controller/test_test.rb to pass on new base 2009-05-26 14:13:35 -07:00
Carl Lerche
7dd094329e Add html-scanner to the new base set of autoloads 2009-05-26 13:40:58 -07:00
Carl Lerche
09907d1b93 Get controller/view_paths_test.rb to pass on new base 2009-05-26 12:14:50 -07:00
Carl Lerche
cbb0724f0d In new base Rails2Compatibility, move @template assignment to right before the first action is processed. 2009-05-26 12:06:48 -07:00
Pratik Naik
10085114ce Make Filter#filter work with around filters 2009-05-25 18:09:12 +02:00
Yehuda Katz
e0ed4b7aa4 Make a couple more tests pass.
A large number of the remaining failing tests have to do with
  the semantics of filters that are Objects. The right solution
  is probably to just implement the filter/before/after semantics
  in NewCallbacks directly (the current semantics are based
  on the old AS::Callbacks specs)
2009-05-23 01:30:25 -07:00
Yehuda Katz
e22a3d893e Slightly modify things to get content type matching working without breaking other code 2009-05-23 00:39:32 -07:00
Pratik Naik
3ac6d8f8b0 Remove unnecessary asset_host initialization 2009-05-23 02:35:34 +02:00
Pratik Naik
9286d422f8 Add asset_host to Rails2Compatibility 2009-05-23 02:29:55 +02:00
Yehuda Katz + Carl Lerche
69a1ea8b5d Created an ActionController::Renderers::All that includes all the default render options (:json, :js, :rjs, :xml) 2009-05-22 17:17:16 -07:00
Yehuda Katz + Carl Lerche
7b3fb1d43f Got controller/render_js_test.rb to pass on new base 2009-05-22 17:08:58 -07:00
Jeremy Kemper
f9dde8fe4e Port cookies to new base 2009-05-22 17:05:44 -07:00
Pratik Naik
c90f613ad6 Add Translation to the new base 2009-05-23 02:03:22 +02:00
Yehuda Katz + Carl Lerche
28dbeb3a64 Get controller/render_other_test.rb to pass on new base and fixed a bug in new base with regards to rendering layouts. 2009-05-22 16:55:27 -07:00
Pratik Naik
f766f66946 Make logging_test pass with the new base 2009-05-23 01:36:09 +02:00
Pratik Naik
8a336d01d2 Use super wherever possible in ActionController::Helpers#helper 2009-05-23 00:30:32 +02:00
Yehuda Katz + Carl Lerche
72a574b507 Get controller/layout_test.rb running on new base except for ActionController::Base.exempt_from_layout which is going to be deprecated. 2009-05-22 15:25:13 -07:00
Yehuda Katz + Carl Lerche
01129534cd Cleaned up the #render_to_body chain by extracting determining the templates to render to a separate hook point. 2009-05-22 15:24:31 -07:00
Pratik Naik
e976c489e6 Add all the existing helpers related features to the new base 2009-05-23 00:17:10 +02:00
Pratik Naik
1d168afcb1 Move FilterParameterLogging to a stand alone module and make it work on new base 2009-05-22 19:51:17 +02:00
Pratik Naik
9d08f86cd4 Make assertion tests pass with the new base 2009-05-22 19:01:52 +02:00
Jeremy Kemper
1fa7e3322d Ruby 1.9 compat: don't rely on lexical scoping since the included block is called from dependency_module 2009-05-21 20:54:28 -07:00
Jeremy Kemper
4c52ba278b Move Safari response-padding fix to Rails2Compatibility. Should be a Rack concern. 2009-05-21 20:27:24 -07:00
Jeremy Kemper
8f3cbb4773 Dead local 2009-05-21 20:27:24 -07:00
Yehuda Katz + Carl Lerche
68a207ccf6 Implemented layout conditions in new base 2009-05-21 18:14:20 -07:00
Yehuda Katz + Carl Lerche
6923b392b7 Added the :rjs render option 2009-05-21 16:35:40 -07:00
Yehuda Katz + Carl Lerche
e773d0e68a Renamed #implicit_render to #default_render in new base to support the default_render API 2009-05-21 16:31:05 -07:00
Pratik Naik
1a52b246eb Add HTTP Authentication to the new base 2009-05-22 00:29:47 +02:00
Pratik Naik
d2cac9dd0e Add missing dependency in Streaming 2009-05-22 00:27:08 +02:00
Yehuda Katz + Carl Lerche
9d3d774670 Update render options to remove performance implications of many render options types 2009-05-21 15:23:52 -07:00
Yehuda Katz + Carl Lerche
ad1c90de3a Added the :xml render option 2009-05-21 14:51:29 -07:00
Yehuda Katz + Carl Lerche
2daac47d58 Added the ability to register methods to handle specific render option keys and render :json 2009-05-21 14:36:00 -07:00
Yehuda Katz + Carl Lerche
e693f45e15 Remove some response content type concepts from ActionView 2009-05-21 14:34:56 -07:00
Pratik Naik
386ff66e5e Add Streaming to new base 2009-05-21 21:48:42 +02:00
Pratik Naik
59b32f2883 RequestForgeryProtection now works with the new base 2009-05-21 21:48:42 +02:00
Pratik Naik
5a03645762 Allow Module#depends_on to accept multiple modules 2009-05-21 03:04:17 +02:00
Pratik Naik
e21d1614bb Made ActionController::Verification work with new_base 2009-05-21 02:55:25 +02:00
Yehuda Katz + Carl Lerche
7f7fdc407a Make controller/content_type_test.rb pass on new base 2009-05-20 17:42:04 -07:00
Yehuda Katz + Carl Lerche
c8eda9ade4 Fixed new_base tests on ruby 1.9 2009-05-20 17:22:29 -07:00
Pratik Naik
8e7a87d299 Make ActionController::Flash work with new_base 2009-05-21 01:41:35 +02:00
Yehuda Katz + Carl Lerche
01f032f256 Added responds_to to new base. 2009-05-20 15:34:26 -07:00
Joshua Peek
6761759a90 Temporarily bundle rack-test while MockSession is baking 2009-05-19 22:43:22 -05:00
Bryan Helmkamp
df0faea378 Refactor ActionController instantiation capture 2009-05-19 22:43:21 -05:00
Bryan Helmkamp
0029d5e594 Integrating Rack::MockSession (from Rack::Test) 2009-05-19 22:43:21 -05:00
Yehuda Katz + Carl Lerche
321168b17b Make old caching tests pass on new base. 2009-05-19 18:11:45 -07:00
Yehuda Katz + Carl Lerche
67cc021d01 Modified caching implementation to work with NewBase 2009-05-19 18:11:45 -07:00
Yehuda Katz + Carl Lerche
0e7da0e4a0 Include caching module into new base 2009-05-19 18:11:44 -07:00
Yehuda Katz + Carl Lerche
26f2be01c2 Modify caching to use new included helper 2009-05-19 18:11:44 -07:00
Pratik Naik
4a6f4b92ad Change integration test helpers to accept Rack environment instead of just HTTP Headers.
Before :  get '/path', {}, 'Accept' => 'text/javascript'
  After  :  get '/path', {}, 'HTTP_ACCEPT' => 'text/javascript'
2009-05-19 23:50:03 +02:00
Yehuda Katz + Carl Lerche
07f733c631 Ported simple benchmarking in new base 2009-05-18 17:33:45 -07:00
Pratik Naik
195fadbfd3 Ensure HTTP Digest auth uses appropriate HTTP method [#2490 state:resolved] [Steve Madsen] 2009-05-18 16:59:37 +02:00
Joshua Peek
092089015b Extract generic callbacks middleware from dispatcher 2009-05-17 13:39:55 -05:00
Joshua Peek
8118fca9be Merge Failsafe middleware into ShowExceptions 2009-05-17 12:24:59 -05:00
Joshua Peek
c3319504f0 Rescue hack was supposed to be removed. Some how it crept back in. 2009-05-17 12:24:59 -05:00
Thomas E. Glasgow
e41984c5f7 Simplify filter_chain method implementation [#2327 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-05-17 18:56:07 +02:00
Jeffrey Chupp
842dab0c29 Ensure WhiteListSanitizer allows dl tag [#2393 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-05-17 14:29:47 +02:00
Yehuda Katz + Carl Lerche
5a45446cff Ported Rescuable to new base 2009-05-15 17:49:11 -07:00
Yehuda Katz + Carl Lerche
7e10504bde Refactored AbstractController to provide better hook points for overriding aspects of action dispatching 2009-05-15 15:57:12 -07:00
Yehuda Katz + Carl Lerche
b6bac73b28 Merge commit 'origin/master'
Conflicts:
	actionpack/lib/action_controller/abstract/base.rb
	actionpack/lib/action_controller/routing.rb
2009-05-14 17:38:30 -07:00
Yehuda Katz + Carl Lerche
da65320433 Got new base to pass controller/base_test.rb, implemented method_missing action semantics in compatibility mode, and fixed a few action_missing bugs. 2009-05-14 17:25:10 -07:00
Yehuda Katz + Carl Lerche
8fac2c88ca Cleaning up more render tests 2009-05-14 15:30:35 -07:00
Jeremy Kemper
c286952050 Minimal base/new_base comparison 2009-05-14 02:01:08 -07:00
Jeremy Kemper
e8550ee032 Cherry-pick core extensions 2009-05-13 12:00:15 -07:00
Yehuda Katz + Carl Lerche
216309c165 Implemented redirects and partial rendering in new base. 2009-05-12 16:21:34 -07:00
Yehuda Katz + Carl Lerche
72ca7c591c Fixed new callbacks to not call the action when a callback sets the response body 2009-05-12 10:53:00 -07:00
Yehuda Katz + Carl Lerche
00a9d4b91c Merge branch 'master' into wip_abstract_controller
Conflicts:
	actionpack/lib/action_controller/abstract/callbacks.rb
	actionpack/lib/action_controller/abstract/renderer.rb
	actionpack/lib/action_controller/base/base.rb
	actionpack/lib/action_controller/dispatch/dispatcher.rb
	actionpack/lib/action_controller/routing/route_set.rb
	actionpack/lib/action_controller/testing/process.rb
	actionpack/test/abstract_controller/layouts_test.rb
	actionpack/test/controller/filters_test.rb
	actionpack/test/controller/helper_test.rb
	actionpack/test/controller/render_test.rb
	actionpack/test/new_base/test_helper.rb
2009-05-11 17:07:05 -07:00
Yehuda Katz + Carl Lerche
0cac68d3be Revert "Whitespace!"
This reverts commit a747ab5b20b9d543e9d311070e3b720c761ae716.
2009-05-11 15:03:24 -07:00
Yehuda Katz + Carl Lerche
0f6e764e40 Fixed a bug with handling render options 2009-05-11 14:48:58 -07:00
Yehuda Katz + Carl Lerche
6694bd46f5 Aliased AbstractController::ActionNotFound to ActionController::UnknownAction 2009-05-11 12:45:26 -07:00
Yehuda Katz + Carl Lerche
94ee9d2452 Ported ConditionalGet to new Base 2009-05-11 12:04:43 -07:00
Yehuda Katz + Carl Lerche
c1d120a71e Don't run the action if callbacks are halted.
In AbstractController, this means that response_body is not empty
2009-05-11 11:48:38 -07:00
Yehuda Katz + Carl Lerche
a2f3684cec Ported fresh_when into a ConditionalGet module 2009-05-11 10:57:59 -07:00
Yehuda Katz
030dfe3f83 More community code review :) 2009-05-11 10:22:07 -07:00
Joshua Peek
a747ab5b20 Whitespace! 2009-05-07 10:45:29 -05:00
Joshua Peek
af40fa6d03 Prefer "included" language over "setup" 2009-05-07 10:38:57 -05:00
Joshua Peek
2854535b02 Make module dependency DSL opt in 2009-05-07 10:29:22 -05:00
Joshua Peek
bcc4537f2a Wrap dispatcher callbacks around the whole middleware chain. Kill unnecessary Reloader middleware. 2009-05-03 09:41:40 -05:00
Joshua Peek
11af089cee Extract ActionController rescue templates into Rescue and ShowExceptions middleware.
This commit breaks all exception catching plugins like ExceptionNotifier. These plugins should be rewritten as middleware instead overriding Controller#rescue_action_in_public.
2009-05-02 23:02:22 -05:00
Joshua Peek
24affdc88c Deprecate Controller.process interface 2009-05-02 15:37:29 -05:00
Joshua Peek
f32cf44870 Switch functional tests to run through the rack interface instead of process 2009-05-02 15:29:18 -05:00
Joshua Peek
a8b75c480f Functional test runner finalizes response just like the integration test runner. In both runners, the @response object will now behave the same.
Some functional tests will need to be updated if they are relying on preprocessed data on the response.
2009-05-02 14:57:40 -05:00
Joshua Peek
3900f4007e Deprecate assert_redirect_to's partial hash matching 2009-05-02 14:23:44 -05:00
Yehuda Katz
72160d9f89 Implement FooController.action(:name)
* Rails actions are now Rack endpoints, and can be retrieved
    via FooController.action(name) and called with an env
  * Updated some tests that relied on the old internal
    #process/#call implementation
2009-05-02 02:15:09 -07:00
Yehuda Katz + Carl Lerche
ad2a1b5cb1 Get render :inline working 2009-05-01 18:17:08 -07:00
Yehuda Katz + Carl Lerche
7dd072d333 A few more tweaks to get new Base running old render tests again 2009-05-01 17:53:20 -07:00
Yehuda Katz + Carl Lerche
e046f36824 Renamed Base2 to Base and don't require old action_controller for new Base 2009-05-01 17:31:03 -07:00
Yehuda Katz + Carl Lerche
b1d34b3aa4 Starting to get new_base to run on old tests 2009-05-01 17:31:03 -07:00
Yehuda Katz + Carl Lerche
918b119bd3 Add support for stripping "layouts/" from the layout name 2009-05-01 17:31:02 -07:00
Yehuda Katz + Carl Lerche
b4903a8e34 Modify new_base to use String action_names for back-compat 2009-05-01 17:31:02 -07:00
Yehuda Katz + Carl Lerche
4ee3e5b094 Ported over the concept of public instance methods on controller child classes as callable action methods 2009-05-01 17:31:02 -07:00