Commit Graph

6236 Commits

Author SHA1 Message Date
Neeraj Singh
08a08d97dd no need to check for nil? 2010-09-30 08:11:35 +08:00
Neeraj Singh
692f5184c4 no need to check for nil? 2010-09-30 08:11:34 +08:00
Neeraj Singh
8efdffeda3 no need of nil check 2010-09-30 08:11:34 +08:00
Aaron Patterson
a40e3c1a96 removing crazy finalizer code until there is proof that we need it 2010-09-29 16:40:47 -07:00
Aaron Patterson
2eef53b163 removing useless code 2010-09-29 16:17:56 -07:00
Aaron Patterson
78ac9c2be7 dry up method checking in the request object 2010-09-29 16:09:58 -07:00
Aaron Patterson
ab0d216b67 reduce function calls on Array 2010-09-29 15:43:27 -07:00
Aaron Patterson
3f88f26d1e removing more lolinject 2010-09-29 15:41:06 -07:00
Aaron Patterson
2437356cda removing lollerject 2010-09-29 15:37:38 -07:00
Aaron Patterson
1d9a219307 oops, missed a uniq 2010-09-29 11:53:34 -07:00
Aaron Patterson
a5f8f59081 dry up action_methods 2010-09-29 11:47:54 -07:00
Aaron Patterson
1c0be7baac fixing space error 2010-09-29 11:47:54 -07:00
José Valim
d2ea2e1d5f Merge remote branch 'miloops/warnings' 2010-09-29 20:28:51 +02:00
Aaron Patterson
c57f5d58ea no need to call e.class 2010-09-29 10:39:17 -07:00
Emilio Tagua
6371e5b99f We can't assign @view_context_class here, define super() in test instead if we want to avoid warnings. 2010-09-29 14:35:24 -03:00
José Valim
258f7b586e Fix a small typo (ht: masterkain) 2010-09-29 10:34:37 -07:00
Emilio Tagua
c37800aae1 _ is not a valid scheme name character, \w includes it and also is redundant with \d.
'The scheme name consists of a letter followed by any combination of letters, digits, and the plus ("+"), period ("."), or hyphen ("-") characters; and is terminated by a colon (":").'
2010-09-29 12:55:43 -03:00
Emilio Tagua
8823b85010 Remove redundant conditional. 2010-09-29 12:42:51 -03:00
Emilio Tagua
152580ee00 Don't try to interpolate string if there's no interpolation point at all. 2010-09-29 12:42:51 -03:00
Emilio Tagua
bc0e7f4e37 Test correct method behaviour. 2010-09-29 12:42:51 -03:00
Emilio Tagua
6268815779 Initialize @view_context_class and cache view_context_class value. 2010-09-29 12:42:23 -03:00
José Valim
f63d35fba5 Ensure that named routes do not overwrite previously defined routes. 2010-09-29 14:24:32 +02:00
José Valim
b1ae796284 Fix an error on 1.8.7. 2010-09-29 11:28:38 +02:00
José Valim
392df0fc06 @_etag is not used anywhere. 2010-09-29 11:19:22 +02:00
José Valim
14f9904e0f Avoid (@_var ||= nil) pattern by using initialize methods and ensuring everyone calls super as expected. 2010-09-29 11:18:31 +02:00
José Valim
0bbf9029e8 Merge remote branch 'miloops/warnings' 2010-09-29 10:04:42 +02:00
Emilio Tagua
17599abc9c Enable warnings now that they can be readed. 2010-09-28 18:50:46 -03:00
Emilio Tagua
623ef13b77 Fix test that wasn't running at all. 2010-09-28 18:48:58 -03:00
Emilio Tagua
d5bb640eb0 Remove methods to avoid warnings. 2010-09-28 18:40:38 -03:00
Emilio Tagua
783e9b8de5 Change test to avoid warnings. 2010-09-28 18:38:25 -03:00
Emilio Tagua
34fc109549 Redefine duplicated test name. 2010-09-28 18:36:45 -03:00
Emilio Tagua
454960d9fb Redefine duplicated test name. 2010-09-28 18:35:02 -03:00
Emilio Tagua
3e336f9ab7 Use redefine_method since baz is already defined. 2010-09-28 18:31:52 -03:00
Emilio Tagua
0c08d8bd75 Fix more warnings by defining variables and using instance_variable_defined? instead instance_variable_get. 2010-09-28 18:25:52 -03:00
Emilio Tagua
0fa9c5392e Define @_layout if it is not defined. 2010-09-28 18:25:24 -03:00
Emilio Tagua
357f59447d Initialize @path. 2010-09-28 18:20:54 -03:00
Emilio Tagua
e804104200 Use helper method here. 2010-09-28 18:16:26 -03:00
Emilio Tagua
a0f95a887e Silence warnings here, only setting Encoding.default_external for testing. 2010-09-28 18:11:57 -03:00
Emilio Tagua
d1e976da7f Silence warnings here, only setting Encoding.default_external for testing. 2010-09-28 18:10:32 -03:00
Emilio Tagua
523f98099d Remove more warnings on AP. 2010-09-28 18:01:48 -03:00
Emilio Tagua
ad2c21089e Define @title to avoid warnings. 2010-09-28 17:44:26 -03:00
Emilio Tagua
80a98e9b25 Use instance_variable_defined? instead instance_variable_get in tests. 2010-09-28 17:35:17 -03:00
Emilio Tagua
3abd0593a6 Initialize ivars in tests. 2010-09-28 17:32:18 -03:00
Emilio Tagua
c648a4cb94 Remove useless string line causing a warning. 2010-09-28 17:18:48 -03:00
Emilio Tagua
9917356d66 Remove more warnings by initializing variables in test. 2010-09-28 17:16:18 -03:00
Emilio Tagua
3f94b45262 Remove more warnings: no need to define attr_accessor if already exists. Initialize ivar. 2010-09-28 17:08:43 -03:00
Emilio Tagua
19d9fffb9b Use redefine_method instead define_method, it may be already defined. 2010-09-28 17:08:10 -03:00
Emilio Tagua
c8db1adc0d Remove duplicated class test. copy/paste fail? 2010-09-28 16:40:28 -03:00
Emilio Tagua
4d6e178f88 Remove method if exists, avoid calling Array#first so many times. 2010-09-28 16:31:21 -03:00
Emilio Tagua
da8f9ca432 Remove more warnings on variables. 2010-09-28 16:27:05 -03:00
Emilio Tagua
dc37bd778a Initialize @trusted_proxies. 2010-09-28 16:25:06 -03:00
Emilio Tagua
eea61a030e Initialize @compiled_at if it is not. 2010-09-28 16:24:42 -03:00
Emilio Tagua
6286b63f27 Remove warings from rescues: don't define more than once debug_hash method and ask if @response if defined. 2010-09-28 16:20:48 -03:00
Emilio Tagua
540e87256d Remove remaining warnings on _trace by adding parenthesis to gsub arguments. 2010-09-28 16:12:07 -03:00
Emilio Tagua
c9416546a2 Use parenthesis to avoid ambiguous first argument warning. 2010-09-28 16:09:31 -03:00
Emilio Tagua
7129dd95d0 undef method if already defined. 2010-09-28 16:08:00 -03:00
Emilio Tagua
dda3431942 Remove useless use of :: in void context. 2010-09-28 16:02:31 -03:00
Emilio Tagua
7c8b43ed4f Ask if the instance variable is defined before asking for it, avoid *many* warnings. 2010-09-28 15:53:32 -03:00
Emilio Tagua
9027721b11 Add parenthesis to avoid syntax warnings. 2010-09-28 15:48:45 -03:00
Emilio Tagua
059d609a1a Avoid more uninitialized variable warnings. 2010-09-28 15:46:30 -03:00
Emilio Tagua
97174980e5 Remove duplicated method. 2010-09-28 15:43:03 -03:00
Emilio Tagua
04c4f47fed Initialize @sub_templates 2010-09-28 15:33:48 -03:00
Emilio Tagua
699fb81def Initialize @_virtual_path path ivar. 2010-09-28 15:31:29 -03:00
Emilio Tagua
dc2cd266cd Rename tests to avoid name collisions and warnings when running rake task. 2010-09-28 15:30:59 -03:00
Emilio Tagua
f63f90134a Rename duplicated test, and give it a correct name. Remove nonsense line. 2010-09-28 15:30:16 -03:00
Emilio Tagua
dc61ab0be5 Remove duplicated test. 2010-09-28 15:29:59 -03:00
Emilio Tagua
adcc5e11fe @selected may not be defined here, avoid warning. 2010-09-28 15:29:40 -03:00
Aaron Patterson
1ef2b47fb1 convert inject to map + join 2010-09-28 11:22:16 -07:00
Emilio Tagua
8ee27afd06 Don't define _test_case method if already defined. 2010-09-28 15:21:44 -03:00
Emilio Tagua
4bce8e3c75 No need to call super here. Use yield instead block.call 2010-09-28 15:10:55 -03:00
Emilio Tagua
b8c565fbd6 Initialize @app if it doesn't exists. 2010-09-28 15:10:15 -03:00
Emilio Tagua
71acc2737a Move uri parser to AS as URI.parser method to reuse it in AP and ARes. 2010-09-28 11:38:35 +08:00
Emilio Tagua
197a995bc5 Move uri parser to AS as URI.parser method to reuse it in AP and ARes. 2010-09-27 20:57:26 -03:00
José Valim
8aa86babad Fix tests on 1.9.2. 2010-09-28 00:39:29 +02:00
Diego Carrion
72f37bd8bc renderer calls object.to_json when rendering :json => object [#5655 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-27 23:11:29 +02:00
José Valim
dd83140b24 Properly initialize variables inside the initialize method. 2010-09-27 22:58:31 +02:00
Emilio Tagua
8adb24016d Define @_routes inside method, makes more sense and will be initialized when called anywhere.
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-09-27 16:43:33 -03:00
Emilio Tagua
1ab2ab07b5 Remove more warnings shadowing outer local variable.
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-09-27 16:43:17 -03:00
Emilio Tagua
2f326b7f27 Remove warning "URI.unescape is obsolete" from actionpack.
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-09-27 16:43:04 -03:00
José Valim
8aa3684e07 Do not cache the script name outcome. 2010-09-27 21:14:18 +02:00
José Valim
fe0251e408 Merge remote branch 'miloops/warnings'
Conflicts:
	actionpack/lib/action_controller/metal/url_for.rb
2010-09-27 21:00:54 +02:00
José Valim
6067d16200 Call it compile_methods! and do the same on AM. 2010-09-27 20:43:56 +02:00
thedarkone
dc09cc055a Assume compute_asset_host returns reasonable values. 2010-09-27 17:46:00 +02:00
thedarkone
bb47927d91 Convert unless/else into if/else. 2010-09-27 17:46:00 +02:00
thedarkone
b127e0cac9 Performance: refactor convert_options_to_data_attributes. 2010-09-27 17:46:00 +02:00
thedarkone
dcabc6c043 Remove dead code. 2010-09-27 17:46:00 +02:00
thedarkone
7d9f605f80 Clean up url_for. 2010-09-27 17:45:59 +02:00
thedarkone
5b81d1f3ef Hash#empty? is faster than Enumerable#any? when used on a Hash. 2010-09-27 17:45:59 +02:00
thedarkone
70357666bc Do a single string interpolation. 2010-09-27 17:45:59 +02:00
thedarkone
e1bccc5169 Simple .empty? test will do fine here (rails_asset_id returns nice strings). 2010-09-27 17:45:59 +02:00
thedarkone
7cee1587f1 options[:action] is very likely to be nil. 2010-09-27 17:45:59 +02:00
thedarkone
e12e2fb4f6 Cache 2 of Request's commonly called methods. 2010-09-27 17:45:59 +02:00
thedarkone
8fdb34b237 Cache url_options on a per-request basis. 2010-09-27 17:45:59 +02:00
thedarkone
86bcccf8df No need to create a separate lambda for each call. 2010-09-27 17:45:59 +02:00
thedarkone
7b2d51817d Make asset extension rewriting faster. 2010-09-27 17:45:58 +02:00
thedarkone
05e53b4c1a Optimize relative_url_root rewriting code. 2010-09-27 17:45:58 +02:00
thedarkone
918dc27345 Compile ActionController::Base.config's methods to avoid method_missing overhead. 2010-09-27 17:45:58 +02:00
Emilio Tagua
50decfbc0e _routes must be inside @controller conditional. 2010-09-27 11:19:24 -03:00
Emilio Tagua
023c2020b3 Initialize @_routes if not defined yet, avoiding more warnings. 2010-09-27 11:19:24 -03:00
Emilio Tagua
bb71f182dd Rename duplicated test name. 2010-09-27 11:19:24 -03:00
Emilio Tagua
c2940a6bf4 Refactor method to avoid warnings and not run unnecessary code. 2010-09-27 11:19:24 -03:00
Emilio Tagua
d0621fde88 Avoid uninitialized variable warning. 2010-09-27 11:19:24 -03:00
Emilio Tagua
d95a16c526 Initialize @_request and @_response. 2010-09-27 11:19:23 -03:00
Emilio Tagua
2f59cd6fd6 Remove method previous method if already defined. 2010-09-27 11:19:23 -03:00
Emilio Tagua
e7c833fca9 Define @emitted_hidden_id if it doesn't exists and reuse it if it does. 2010-09-27 11:19:23 -03:00
Emilio Tagua
74d7664b60 Avoid uninitialized variable warning. 2010-09-27 11:19:23 -03:00
Emilio Tagua
1ed18fcc91 Initialize @cookies. 2010-09-27 11:19:23 -03:00
Emilio Tagua
583ddf22a2 Remove more warnings shadowing outer local variable. 2010-09-27 11:19:22 -03:00
Emilio Tagua
dafb4bd33b Don't shadow outer local variables. 2010-09-27 11:19:22 -03:00
Emilio Tagua
0cb1d87cd5 Remove duplicated test. 2010-09-27 11:19:22 -03:00
Emilio Tagua
53b91b11cc Avoid uninitialized variable warning, reuse @integration_session. 2010-09-27 11:19:21 -03:00
Emilio Tagua
24ef32fe93 Ask is @controller is defined to avoid warning. 2010-09-27 11:19:21 -03:00
Emilio Tagua
cd681681e6 Initialize @_routes if it doesn't exists. 2010-09-27 11:19:21 -03:00
Emilio Tagua
986bad6a3b Remove warning "too many arguments for format string" when interpolating with empty hash. 2010-09-27 11:19:21 -03:00
Emilio Tagua
b9fa46ca97 Initialize @_etag. 2010-09-27 11:19:21 -03:00
Emilio Tagua
bb2f53b409 Initialize @as before plural method is called. 2010-09-27 11:19:20 -03:00
Emilio Tagua
5ced275ac1 Remove old method before redefining it. 2010-09-27 11:19:20 -03:00
Emilio Tagua
5d773f8ded Remove warning "URI.unescape is obsolete" from actionpack. 2010-09-27 11:19:20 -03:00
Emilio Tagua
535371e956 Fix indentation. 2010-09-27 11:19:19 -03:00
Emilio Tagua
2d274a5208 Use parentheses when using assert_match followed by a regexp to avoid warnings. 2010-09-27 11:19:19 -03:00
Santiago Pastorino
56de4e9a80 Fix the precedence issue here 2010-09-26 17:54:00 -03:00
Santiago Pastorino
db23e32141 Not need to do this double ternary 2010-09-26 17:43:26 -03:00
Santiago Pastorino
29f13beda3 port is appended twice to HTTP_HOST when host already has the port 2010-09-26 12:06:19 -03:00
Santiago Pastorino
14d2feeeab Bump up some deps 2010-09-26 00:29:38 -03:00
Carlos Antonio da Silva
12db1a39cd Partial revert of #d650b71 'Remove deprecated stuff in ActionController'
This brings back the deprecated modules from ActionController, because
they didn't have any deprecation warning.
2010-09-26 02:13:48 +08:00
Carlos Antonio da Silva
ecc13f7c18 We don't need to check if the format exists to generate the url, it already does it internally 2010-09-26 02:13:48 +08:00
Carlos Antonio da Silva
00e7633555 More cleanup on form helpers 2010-09-26 02:13:47 +08:00
Carlos Antonio da Silva
6345899489 Remove last tests with deprecated form_for and cleanup form_for helper
This cleans up the last bits of deprecation stuff from form_for helper.
However there is still a bug when using :as => foo[], with index. The
classes and ids are being generated using [], such as foo[]_edit. This
bug already existed but it was not detected before.
2010-09-26 02:13:47 +08:00
Carlos Antonio da Silva
db57e92784 Select tags with array options are deprecated, removing 2010-09-26 02:13:46 +08:00
Carlos Antonio da Silva
eb8a24a375 Refactor form_for helper 2010-09-26 02:13:46 +08:00
Carlos Antonio da Silva
8a16485a96 Review most of the form_for deprecated tests, missing tests with index like [] 2010-09-26 02:13:45 +08:00
Carlos Antonio da Silva
7fc1edd790 Remove deprecated stuff in ActionController
This removes all deprecated classes in ActionController related to
Routing, Abstract Request/Response and Integration/IntegrationTest.
All tests and docs were changed to ActionDispatch instead of ActionController.
2010-09-26 02:13:45 +08:00
Carlos Antonio da Silva
ff3f55ee58 There is no need to open AC::Base three times to setup tests. 2010-09-26 02:13:44 +08:00
Carlos Antonio da Silva
f405df6e57 There is no DeprecatedBlockHelpers in AV, so remove it 2010-09-26 02:13:44 +08:00
Krekoten' Marjan
8639c10a40 Fix logging when cache key contains % sign [#5570 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-25 11:04:20 +02:00
Krekoten' Marjan
da94d0e8ca Remove duplicate helper method
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-25 11:02:46 +02:00
John Firebaugh
308517e913 Don't duplicate Rack::Response functionality. [#5320 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-25 10:58:07 +02:00
John Firebaugh
c509379923 Add ActionDispatch::TestResponse tests.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-25 10:52:57 +02:00
Emilio Tagua
f625b87f24 These tests shouldn't depend on local time to pass or fail, we can use utc here.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-24 15:51:29 +02:00
José Valim
6b3ad0cafc There is no need to use instance_eval since the proc is created in the same context it is eval'ed. 2010-09-24 12:54:31 +02:00
Nando Vieira
7223fe7faf Make redirect_to accept blocks [#5643 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-24 12:49:27 +02:00
Kevin Hughes
f48c56008e Changed documentation for auto_link so that the truncate example works [#5694 state:resolved]
Signed-off-by: Xavier Noria <fxn@hashref.com>
2010-09-24 00:58:43 +02:00
Xavier Noria
8c0c815ba7 resolves rdoc conflict 2010-09-23 22:35:08 +02:00
Carl Lerche
1da0dc2f90 Improve performance of applications using file uploads by not busting the method cache on every request containing a file upload. 2010-09-22 17:36:12 -07:00
Aaron Patterson
de9b3385fc fixing bug with rails use of rack-test 2010-09-22 17:09:06 -07:00
Emilio Tagua
59296ab26d Refactor routing methods.
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-09-22 18:08:03 -03:00
Emilio Tagua
8c97f49f2e Refactor decode_credentials to avoid inject and use map instead.
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-09-22 18:08:03 -03:00
Emilio Tagua
6d8a6700a7 Perf: refactor _assign method to avoid inject and defining unneeded local var.
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-09-22 18:08:03 -03:00
Emilio Tagua
10a63e2a0c Refactor methods in html node to avoid injects.
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-09-22 18:08:02 -03:00
Joost Baaij
b39dfd5936 Document form_for behaviour when using file_field inside the block 2010-09-21 15:11:04 +02:00