Commit Graph

3245 Commits

Author SHA1 Message Date
Piotr Sarnacki
09195f10bd Do not use the same hash instance for expansions [#6114 state:resolved]
Using the same hash instance makes using the same expansions for
both javascripts and stylesheets.
2010-12-22 09:44:46 +01:00
José Valim
0cbfd6c28d Small changes on AD::Reloader. 2010-12-20 12:43:02 +01:00
John Firebaugh
435bccda93 Replace AD::Callbacks.to_prepare with AD::Reloader.to_prepare
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-12-20 12:43:02 +01:00
John Firebaugh
0f7c970e4f Introduce ActionDispatch::Reloader
Based on the implementation on the 2-3-stable branch, patches by Hongli
Lai <hongli@phusion.nl>, and helpful suggestions from José Valim.

Hongli Lai's patches included locking around the request cycle; this is
now handled by Rack::Lock (https://github.com/rack/rack/issues/issue/87/).

[#2873]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-12-20 12:43:02 +01:00
Don Wilson
f71809f257 Fixed number_with_precision rounding error [#6182 state:resolved] 2010-12-18 10:00:37 +01:00
Piotr Sarnacki
07567aea5f Revert "Fixed number_with_precision rounding error [#6182 state:resolved]"
This reverts commit 006ec77e60.
2010-12-17 16:11:47 +01:00
Don Wilson
006ec77e60 Fixed number_with_precision rounding error [#6182 state:resolved] 2010-12-17 11:32:19 +01:00
Pavel Gorbokon
96bae30538 Replace rudimentary named_scope with scope. [#6052 state:resolved]
* rename method names (actually in tests)
* rename instance variable @_named_scopes_cache to @_scopes_cache
* rename references in doc comments
* don't touch CHANGELOG :)
2010-12-15 14:02:30 -08:00
brainopia
ebc47465a5 Fix edge cases for domain :all option on cookie store
Dont set explicit domain for cookies if host is not a domain name

[#6002 state:committed]

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-12-16 01:49:30 +05:30
Neeraj Singh
0027b65421 Ensure that while caching a page rails takes into
account the resolved mime type for the request

[#6110 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-12-09 16:14:57 +01:00
José Valim
cc70ac9508 Properly check the arity for template handlers. 2010-12-09 13:15:40 +01:00
José Valim
28cf77203b Check if the routes object really responds to define_mount_prefix. 2010-12-09 13:15:25 +01:00
Santiago Pastorino
b696dd70db Allow back passing :rescue_format => nil and test added 2010-12-04 20:08:23 -02:00
Sven Fuchs
896e25e994 Make TranslationHelper#translate use the :rescue_format option in I18n 0.5.0
Don't catch exceptions here. Instead only declare that we want exceptions to be rescued as :html, but also let users configure reactions to exceptions in I18n.

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-12-04 18:00:52 +01:00
José Valim
78afe68afb Merge remote branch 'joshk/redirect_routing'
Conflicts:
	actionpack/CHANGELOG
	actionpack/lib/action_controller/metal/mime_responds.rb

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-12-03 12:27:50 +01:00
Josh Kalderimis
1e26bda095 Added documentation explaining the new additional supported syntaxes for the routing redirect method, a small changelog note, and two extra tests for path interpolation when using the hash option syntax. 2010-11-30 17:55:33 +01:00
Josh Kalderimis
0bda6f1ec6 The redirect routing method now allows for a hash of options which only changes the relevant parts of the url, or an object which responds to call can be supplied so common redirect rules can be easily reused. This commit includes a change where url generation from parts has been moved to AD::Http::URL as a class method. 2010-11-30 16:36:01 +01:00
José Valim
31906eecdf Fix tests on 1.9.2. 2010-11-28 12:48:50 +01:00
José Valim
a4c360e8c7 trailing star mimes should respect the order in which mime types are defined. 2010-11-28 11:54:00 +01:00
José Valim
731ca00b48 Dynamically generaeted helpers on collection should not clobber resources url helper [#6028 state:resolved] 2010-11-25 11:50:29 +01:00
Neeraj Singh
fa2a5ae033 If a user wants json output then try best to render json output. In such cases prefer kind_of(String) over respond_to?(to_str)
[#5841 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-11-24 22:08:36 +01:00
Neeraj Singh
18adbe9347 process text/* if it appears in the middle of
HTTP_ACCEPT parameter
2010-11-25 04:38:51 +08:00
Neeraj Singh
5c9abb6cca processing image/* is an odditity because there is
a test case which expects image/* to not to be
expanded. So I am leaving image/* as it is and
process only text/* and application/*
2010-11-25 04:38:50 +08:00
Neeraj Singh
b52a6ba169 clean up test by using unregister method 2010-11-25 04:38:50 +08:00
Neeraj Singh
e870883625 unregister method implementation and test 2010-11-25 04:38:47 +08:00
Neeraj Singh
c6030e8562 Remove the not needed setup and teardown 2010-11-25 04:38:45 +08:00
José Valim
8624065bff Allow template handlers to store temp data. 2010-11-24 12:38:52 +01:00
Josh Kalderimis
e39138478b port_string bought back to life as it is part of the public api
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-11-24 10:34:18 +01:00
Josh Kalderimis
2fe43b694f :subdomain, :domain and :tld_length options can now be used in url_for, allowing for easy manipulation of the host during link generation.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-11-23 09:54:42 +01:00
Aaron Patterson
e83d15376d adding a test for the runner module [#6027 state:resolved] 2010-11-22 15:57:03 -08:00
Aaron Patterson
4395d493c5 sort lists before comparing them 2010-11-22 15:51:29 -08:00
Neeraj Singh
21fd93cedd make test more resilient to future changes by not
testing the count and not testing the internal value
of the registered mime type.

Ideally all mime type registration should be cleaned up
in teardown.

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-11-22 23:06:15 +01:00
Neeraj Singh
cdbbf6fd6b move the mime registration code to setup so that
it could be cleaned up on teardown.

Currently the test code
test/controller/mime_responds_test.rb impacts
test/dispatch/mime_type_test.rb.

dispatch/mime_type_test.rb runs independently fine
but when run as part of rake breaks because of
new mime types registered in
controller/mime_responds_test.rb

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-11-22 23:06:14 +01:00
Neeraj Singh
23ea19e20d rename star star to just one star
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-11-22 23:06:14 +01:00
Neeraj Singh
c9147ebfa0 cleanup Mime::LOOKUP after registering image/gif
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-11-22 23:06:14 +01:00
Neeraj Singh
4154c659fe fix test
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-11-22 23:06:14 +01:00
Neeraj Singh
b798a59bd5 test for text/*, application/* and image/*
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-11-22 23:06:13 +01:00
Neeraj Singh
cbb2651cc0 add the fixture file
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-11-22 23:06:13 +01:00
Neeraj Singh
eb6ccc9953 do not assume that there is no space between
leading */* and comma

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-11-22 23:06:12 +01:00
Neeraj Singh
f5fba917f8 failing test for #6022
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-11-22 23:06:12 +01:00
Neeraj Singh
61950a4b05 current code ignores http header "Accept" if it
has ....,*/* .

It is possible to a device to send
request such that */* appear at the beginning of the
"Accept" header. This patch ensures that "Accept" header
is ignored for such cases too.

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-11-22 23:06:12 +01:00
Xavier Noria
799a6fa047 realigns a series of hash arrows 2010-11-21 10:25:23 +01:00
José Valim
d5779efaf2 Ensure calling reset session twice does not raise errors. 2010-11-20 21:56:08 +01:00
Aaron Patterson
938243feb9 do not require ruby-debug automatically. please require it if you have declared it as a dependency 2010-11-19 16:26:09 -08:00
Henning Koch
deff528947 Fix AssetIncludeTag ensuring that files are in the wrong directory [#6015 state:resolved]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-11-19 15:38:13 -02:00
Santiago Pastorino
52b71c01fd Revert "Quick fix for not escaping []s (not ideal)"
According to http://www.ietf.org/rfc/rfc2616.txt and
http://tools.ietf.org/rfc/rfc3986.txt [ and ] are reserved characters
and should be escaped using "%" HEX HEX

This reverts commit 856d2fd874 and
1ee9b40b18a0bed5bb10a0785f7e2730bac983f6..
2010-11-18 23:31:00 -02:00
José Valim
e3d8331c5b Revert "Remove deprecated form_for with strings or symbols"
This code was not deprecated. What was deprecated is the following:

  form_for(:foo, @foo)

Which now should be rewritten as:

  form_for(@foo, :as => :foo)

The following format is valid:

  form_for(:foo)

This reverts commit be797750e6.
2010-11-18 20:22:14 +01:00
Leonardo Capillera
be797750e6 Remove deprecated form_for with strings or symbols
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-11-18 16:46:55 -02:00
Aaron Patterson
c52e2cf4b3 delegating path and open to internal tempfile 2010-11-18 10:10:25 -08:00
José Valim
f14c2bf582 Pass the view object as parameter to the handler. Useful if you need to access the lookup context or other information when compiling the template. 2010-11-17 23:50:45 +01:00