Commit Graph

626 Commits

Author SHA1 Message Date
José Valim
924fa084e8 First steps into making Plugin < Engine. 2010-01-23 17:13:25 +01:00
José Valim
4eab3aad8d Ensure user set load paths have higher preference and move Bootstrap inside Application. 2010-01-23 02:03:11 +01:00
José Valim
98240c49b0 Get rid of initializers global and create i18n railtie. 2010-01-23 01:29:29 +01:00
Joshua Peek
c2e57c0bb0 I removed the rdoc task from plugin Rakefile 2010-01-22 13:56:10 -06:00
Joshua Peek
2db14457f4 Delegate App calls to instance 2010-01-22 13:56:10 -06:00
Prem Sichanugrist
cc6f16685c Add test case for load initializers before routing behavior.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-01-22 17:58:03 +01:00
José Valim
4ae7936727 Got tests working once again. 2010-01-22 16:24:44 +01:00
José Valim
02c5137ead Add view paths to Engine setup. 2010-01-22 01:10:31 +01:00
Prem Sichanugrist
2df1810cf3 Add test case for load initializers before routing behavior.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-01-21 17:45:21 +01:00
José Valim
fc4f237864 Make filter parameters based on request, so they can be modified for anything in the middleware stack. 2010-01-21 16:52:49 +01:00
José Valim
04063393f9 Give higher priority to rails generators. 2010-01-21 14:11:24 +01:00
José Valim
378464a2e4 Default to sync instrumentation. 2010-01-21 13:09:12 +01:00
Prem Sichanugrist
b1bc3b3cd3 Add deprecation warning for calling filter_parameter_logging ActionController::Base, and allow it to be configured in config.filter_parameters
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-01-21 11:41:31 +01:00
José Valim
4ca9765088 Allow railties to specify generators paths. 2010-01-19 19:59:08 +01:00
José Valim
e8e8da5c85 Logging thread should not die on logging errors. 2010-01-19 16:13:27 +01:00
José Valim
c7255386cd script/generate mailer Notifier will now create a mailer at app/mailers. 2010-01-19 01:36:06 +01:00
José Valim
a18dd52d58 Get generators tests running on Ruby 1.9.1 2010-01-19 01:36:06 +01:00
José Valim
a2b76d1dde Improve generators help. 2010-01-18 16:21:11 +01:00
José Valim
61f77b1dcd More cleaning up on rails generators load path. 2010-01-18 16:21:11 +01:00
José Valim
9fffdc5cdb Generators load path now will be Ruby load path. If you want to use rspec:install generator, you need generators/rspec/install_generator in your load path. 2010-01-18 16:21:11 +01:00
José Valim
e75ea47434 Automatically remove :generators: from namespaces. 2010-01-18 16:21:10 +01:00
José Valim
a2e2e73c5e Ensure generators can be invoked by their shortcut and remove attr_reader tasks. 2010-01-18 16:21:10 +01:00
José Valim
58136e1bd3 Plugin generator should use templates. 2010-01-17 15:17:50 +01:00
Rizwan Reza
e3898bda9c Take --skip-activerecord into account boot.rb requires. [#3711 status:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-01-17 14:55:11 +01:00
José Valim
8f5e733998 Add notifications to default middleware stack and update subscriber tests. 2010-01-17 11:35:48 +01:00
Joshua Peek
eb39d0f7b9 Use backtrace cleaner for dev mode exception page 2010-01-16 21:34:35 -06:00
Joshua Peek
d2d4acf027 Cookies middleware 2010-01-16 17:22:27 -06:00
Joshua Peek
ead93c5be5 Move Flash into middleware 2010-01-15 14:55:13 -06:00
Joshua Peek
3eaf525213 Make HEAD method masquerade as GET so requests are routed correctly 2010-01-15 12:38:50 -06:00
José Valim
5252f5c1c9 Bundle automatically if --dev or --edge is given as option. 2010-01-15 13:39:56 +01:00
José Valim
6487d2871c Fix an issue where log was not being tailed in the first request. 2010-01-15 12:24:31 +01:00
José Valim
b0994be5bd LogTailer should be invoked after all logs in threads were flushed. 2010-01-15 12:24:31 +01:00
José Valim
b4019d5080 Rails::Subscriber is now responsible for flushing all loggers it's responsible for. 2010-01-15 12:24:31 +01:00
José Valim
743cafb7f4 Create Rails::Subscriber::TestHelper and use it to make ActiveRecord subscriber tests run in both sync and async scenarios. 2010-01-13 01:19:23 +01:00
José Valim
fe3ceabeed Set up subscriber on initialization. 2010-01-13 01:19:23 +01:00
José Valim
1a275730b2 Set deprecation warnings for RAILS_ENV and RAILS_DEFAULT_LOGGER. 2010-01-13 01:19:22 +01:00
José Valim
9dd4c79d61 Allow to add subscribers through Railtie. 2010-01-13 01:19:22 +01:00
José Valim
1e12dc04cb Stub initial Rails::Subscriber implementation. 2010-01-13 01:19:22 +01:00
José Valim
c4e3344a26 Revert "Add a generator_paths config option"
This reverts commit 8665c754cb61c947cd55f8886c28188050aed78d.
2010-01-13 01:19:22 +01:00
Joshua Peek
02bbde4e78 Cleanup junk metal and revise API
API Change: Returning a "X-Cascade: pass" header triggers the cascade
instead of a 404 response.
2010-01-10 23:09:10 -06:00
Joshua Peek
3921586091 Rewrite Metal tests 2010-01-10 22:33:34 -06:00
Yehuda Katz
8665c754cb Add a generator_paths config option 2010-01-09 11:04:06 -06:00
José Valim
ccc9f0b7de Ensure application names are not singularized. 2010-01-07 21:09:32 +01:00
Joshua Peek
8fe66f1af0 Run railtie and plugin initializers before app specific ones 2010-01-07 14:01:34 -06:00
José Valim
19e7c524d2 Ensure config/application.rb also uses app_const instead of app_name.classify. 2010-01-07 20:59:26 +01:00
Jeffrey Hardy
cfe0fcae06 Fix failing app generator test when using the --dev option 2010-01-06 14:22:51 -05:00
Joshua Peek
bbe80ae652 config.plugins should still work with an array of strings 2010-01-05 23:37:40 -06:00
Joshua Peek
8ff4faf66a assert_template depends on AV::Template monkey patches in action_view/test_case 2010-01-05 11:48:06 -06:00
Joshua Peek
3f28e0bda6 Trash string coercion rack hacks 2010-01-04 19:46:21 -06:00
Joshua Peek
76b5f18feb Default middleware stack needs to be available at configuration time 2010-01-04 19:40:16 -06:00
Joshua Peek
56b28ec8d6 Middleware configuration tests 2010-01-04 19:40:16 -06:00
Joshua Peek
947bbc170e Smoke test for test_help 2010-01-04 17:13:45 -06:00
Joshua Peek
2601a16ede Autoload AS test case 2010-01-04 16:22:46 -06:00
Joshua Peek
cf83a6f16b Autoload AC and AV test case classes 2010-01-04 16:22:46 -06:00
José Valim
b0947bf97c Bring generators tests back to life. 2010-01-04 00:31:53 +01:00
José Valim
271e7c803f Move all generators tests to use new test case syntax. 2010-01-03 17:14:50 +01:00
José Valim
441227a10f Create Rails::Generators::TestCase. 2010-01-03 17:14:49 +01:00
José Valim
e88ea3255f Assert for valid application names. [#3556 status:resolved] 2010-01-03 17:14:49 +01:00
José Valim
6716e4bc0c Use regexp in lookups instead of traversing namespaces. This removes the need of special cases. 2010-01-03 17:14:48 +01:00
Yehuda Katz
106d8f7688 AppName::Application.root should work 2010-01-02 22:49:40 -08:00
Carl Lerche
ae7ada1fde Some railties cleanup:
* Rename <framework>/rails.rb -> <framework>/railtie.rb
	* Rails::Plugin -> Rails::Railtie
	* Rails::Plugin::Vendored -> Rails::Plugin
2009-12-31 13:12:52 -08:00
Carl Lerche
e749424dfa Rename rails.rb -> rails/all.rb and rails/core.rb -> rails.rb 2009-12-31 13:12:52 -08:00
Carl Lerche
2f8643955a Raise a helpful error if config.frameworks is used 2009-12-31 11:57:59 -08:00
Carl Lerche
1e41097294 Fully remove config.frameworks in favor of requires in boot.rb 2009-12-31 11:57:59 -08:00
Jeremy Kemper
16f1a2b573 Clarify assertion 2009-12-30 23:21:10 -08:00
Jeremy Kemper
1fbd02e446 Revert "Add config.action_controller.include behavior to plugins."
This reverts commit 7e8b7f46bfc086a36db996420fbee93348c5268e.

Conflicts:

	railties/lib/rails/plugin.rb
2009-12-30 19:34:15 -08:00
Carl Lerche
e5c88434db Use the correct method for eager loading autoloads 2009-12-29 19:04:37 -08:00
José Valim
1a4d909c68 Add rails app --edge and rails app --dev 2009-12-29 23:58:34 +01:00
Carl Lerche
3cb7e04763 Finally remove rails/initializer.rb 2009-12-29 13:20:10 -08:00
Carl Lerche
4ee70643b3 Don't require initializer.rb in core.rb 2009-12-28 18:26:15 -08:00
Carl Lerche
c02f278263 Add the ability to have plugins load rake tasks. 2009-12-28 17:53:04 -08:00
Jeremy Kemper
f95fcdd3af Fix copy/pasted test class name 2009-12-28 11:40:34 -08:00
Jeremy Kemper
4691cc43ee Fix ruby version test 2009-12-28 11:40:23 -08:00
José Valim
7e8b7f46bf Add config.action_controller.include behavior to plugins. 2009-12-27 13:31:36 +01:00
Carlhuda
84f1137ef8 Merge remote branch 'origin/master'
Conflicts:
	railties/lib/rails/application.rb
2009-12-23 19:18:11 -08:00
Carlhuda
c4d6d50a46 Rackup config.ru from the correct directory 2009-12-23 19:10:44 -08:00
Carlhuda
af5c3c852e Require active_support/all unless specifically requested to be left out. 2009-12-23 19:00:20 -08:00
Jeremy Kemper
7a6f73e79b Fix reference to Application#configuration to use #config 2009-12-23 17:47:38 -08:00
Carlhuda
d926fb62e8 Isolation tests intentionally avoid loading any state (because they're often testing things that have their own load path semantics that should not be polluted), so rack/test is not yet on the load path. Moving require "rack/test" into the setup means and after boot_rails means that it'll be required after the laod path has been altered to add in the Rails vendor/gems 2009-12-23 17:46:38 -08:00
Carlhuda
d2bd71a145 Finish moving config.frameworks-dependent code to the framework plugin 2009-12-23 17:23:29 -08:00
Carlhuda
61af34b001 Make /rails/info/properties work again. Also, the mocked up tests were passing so we added a test that actually tested this functionality. 2009-12-23 16:26:10 -08:00
Carlhuda
83be262b4b Isolation tests intentionally avoid loading any state (because they're often testing things that have their own load path semantics that should not be polluted), so rack/test is not yet on the load path. Moving require "rack/test" into the setup means and after boot_rails means that it'll be required after the laod path has been altered to add in the Rails vendor/gems 2009-12-23 16:14:34 -08:00
Carlhuda
38aeb1528c Moving out some framework specific initializers into the framework libraries. 2009-12-23 16:13:09 -08:00
Carlhuda
fa8dfc7d01 Raise an exception if an initializer is defined without a block 2009-12-23 15:16:38 -08:00
Carlhuda
dc677f7665 tests pass with requiring the frameworks in rails.rb 2009-12-23 15:16:38 -08:00
Joshua Peek
1de95077dc Merge branch 'master' of github.com:rails/rails
Conflicts:
	railties/test/initializer/initialize_i18n_test.rb
	railties/test/initializer/path_test.rb
2009-12-21 20:41:25 -06:00
Joshua Peek
426348b484 Update routes.rb template to use App name 2009-12-21 20:15:27 -06:00
Jeremy Kemper
2e571e8f99 Blog -> Blog::Application. Leave the toplevel module up for grabs. 2009-12-21 17:03:21 -08:00
Carlhuda
b0b4ae970c test.rb, dev.rb, and production.rb just reopen the Application class; no more hax required 2009-12-21 16:03:26 -08:00
Joshua Peek
880688a499 Default route was removed from default route config, patch up failing tests. 2009-12-21 17:47:03 -06:00
Carl Lerche
1b27f5c4f7 Add the ability for plugins to set default configuration settings. 2009-12-15 22:13:52 -08:00
Joshua Peek
f0bbc647c2 Procs don't call themselves
Fixes dev mode reloading [#3574 state:resolved]
2009-12-15 10:48:56 -06:00
Joshua Peek
ec99eca013 Fix loading plugin and engine route sets 2009-12-14 16:51:13 -06:00
Joshua Peek
0fec53f243 Scaffolding generates new routing dsl examples 2009-12-09 18:57:16 -06:00
Jeremy Kemper
adc2115132 Remove assert_raises usage that only test-unit 1 supports. Breaks minitest and test-unit 2. 2009-12-06 17:23:43 -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
Carlhuda
39034997d1 Add support for bare ActiveSupport via config.active_support.bare 2009-12-02 11:35:47 -08:00
Carlhuda
abfc4dad3e Remove global Rails initializers 2009-12-02 11:35:47 -08:00
Joshua Peek
30ae3538a3 Some basic route discovery tests 2009-12-01 21:19:20 -06:00
Jeremy Kemper
4f2a04cc08 Notifications: extract central Notifier, cordon off the internal Fanout implementation, and segregate instrumentation concerns 2009-11-28 12:50:09 -08:00
Carl Lerche
25b8e996bd Fix the rackup test to correctly use Rack::Builder.parse_file 2009-11-25 14:45:12 -08:00
Carlhuda
530b8ff5ae Have script/* and Rakefile use the application object 2009-11-24 14:36:30 -08:00
Joshua Peek
15ab3a98a1 Find all controllers in memory to use for routing 2009-11-23 20:20:50 -06:00
Carlhuda
c102db9367 Updates notifications tests in railties to reflect changes to the notifications API 2009-11-23 17:28:50 -08:00
José Valim
d0aa0cfbd7 Ensure generator fallbacks work even when a context is given.
Signed-off-by: Yehuda Katz <wycats@Yehuda-Katz.local>
2009-11-23 09:08:48 -08:00
José Valim
d6f10126eb Also load generators at lib/rails_generators.
Signed-off-by: Yehuda Katz <wycats@Yehuda-Katz.local>
2009-11-23 09:08:33 -08:00
Jeremy Kemper
795213a5f4 Just use abstract_unit 2009-11-14 03:27:18 -08:00
Jeremy Kemper
313a7ea9d6 Fix bundler environment check 2009-11-14 03:27:18 -08:00
Yehuda Katz + Carl Lerche
82b9b151ff Refactor plugins 2009-11-11 18:09:16 -08:00
Jeremy Kemper
322b6b29c2 test-unit 2: filter_backtrace is private 2009-11-10 21:04:00 -08:00
Joshua Peek
335c0e62cd Fix railties isolated tests if bundler environment doesn't exist 2009-11-09 22:36:30 -06:00
Jeremy Kemper
3ce6a10b67 Contortions to work around brittle naming dependency 2009-11-09 20:10:10 -08:00
Jeremy Kemper
a66449d852 Ruby 1.9.2: work around inherited hook being called before yielding to block 2009-11-09 14:36:49 -08:00
Jeremy Kemper
cb9a1759c0 Fix generators tests that expect a class name 2009-11-05 16:12:02 -08:00
Jeremy Kemper
60911c3933 Ruby 1.9: Rack apps must *always* take an env arg on 1.9 2009-11-05 16:12:02 -08:00
Yehuda Katz
b0dfd1d19b Update Ruby version check to 1.8.7 2009-11-05 15:38:25 -08:00
Yehuda Katz + Carl Lerche
4369426993 Add the ability to merge initializers from various objects in order. 2009-11-05 14:45:53 -08:00
Yehuda Katz + Carl Lerche
897164ddb7 Conceptually unify instance & global initializers 2009-11-05 14:44:29 -08:00
Jeremy Kemper
a3d5274e67 Configure generator when needed rather than during initialization 2009-11-03 18:58:40 -08:00
José Valim
d627c932bd Pass config.generators options along when RAILS_GENERATORS is set and show --force-plural message just once.
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-11-03 18:22:05 -08:00
José Valim
3b8e29fe56 Remove --freeze (since Rails will come bundled in all new apps) and update gem action to change Gemfile instead of config.environment.
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-11-03 16:32:47 -08:00
José Valim
e15b5eda2b Avoid duplicated names on help description and show proper error message if trying to load a Rails 2.x generator.
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-11-03 16:32:47 -08:00
José Valim
d226f17507 Ensure that generators can be invoked from any directory.
Signed-off-by: Engine Yard <engineyard@Engine-Yards-MacBook-Pro.local>
2009-11-02 18:20:16 -08:00
Yehuda Katz
14370e1aab CI breakage
This reverts commit a288b74f1c75c6f100de7611a5093a421f1ad6d1.
2009-11-02 17:12:01 -08:00
José Valim
a288b74f1c Generators should use Rails.root instead of Dir.pwd [#3408 status:resolved]
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-10-28 16:54:38 -04:00
Yehuda Katz
86596975be Tests pass again 2009-10-27 19:05:47 -07:00
Yehuda Katz + Carl Lerche
df95f16570 Update initializable 2009-10-27 17:01:33 -07:00
Jeremy Kemper
b30294b54a Fix broken tests 2009-10-27 09:34:17 -07:00
Carl Lerche
8a0f456443 Refactored railties' isolation tests to be able to run script/* scripts. 2009-10-21 15:46:22 -07:00
Yehuda Katz + Carl Lerche
4f6d6f7031 Have all the tests running off a single Gemfile 2009-10-20 16:34:44 -07:00
Joshua Peek
fa1926ddaa Exclude gem backtrace filter if rubygems is not loaded 2009-10-20 09:32:26 -05:00
Jeremy Kemper
4f6d8ceb04 Bundle for railties tests too 2009-10-19 19:22:23 -07:00
Jeremy Kemper
acb1624f27 Merge commit 'josevalim/fixes'
Conflicts:
	railties/test/generators/app_generator_test.rb
2009-10-19 18:37:19 -07:00
Mike Gunderloy
77bb129fdb Fix bad assumption in BacktraceCleaner test [#3249 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-10-18 17:17:09 -02:00
Joshua Peek
51e1260b18 Rails info tests needs use_controllers 2009-10-18 11:13:57 -05:00
Joshua Peek
01e04a446c Use Rails.root in railties tests 2009-10-18 10:53:43 -05:00
Joshua Peek
f74e04c21d RAILS_GEM_VERSION is obsolete 2009-10-18 10:44:05 -05:00
Carl Lerche
d0f4d93df8 Remove some remnants of config.gem 2009-10-17 14:38:40 -07:00
José Valim
1f9d234a6b By default use ActiveModel API in controller generators, unless otherwise specified [#3123 status:resolved] 2009-10-17 15:56:44 -03:00
José Valim
03c5a0e5c4 Make app generatoor specs green once again. 2009-10-17 15:54:58 -03:00
Carl Lerche
e1fdc8bba3 Remove config.gem in favor of using the bundler. This makes config/boot.rb obsolete.
The bundler library is at: http://github.com/wycats/bundler/ and is a rubygem.
2009-10-16 18:10:52 -07:00
Joshua Peek
c1261b5484 Use Rails.application where we want a valid rack app 2009-10-16 19:04:28 -05:00
Joshua Peek
d859402696 Use Rails.initialize! where we just want to run the initializers and aren't concerned about the config 2009-10-16 18:58:35 -05:00
Joshua Peek
3971d972c3 Expand paths in i18n initializer tests 2009-10-16 18:42:55 -05:00
Carl Lerche
c296b33ef1 Make the railties tests pass 2009-10-16 16:31:05 -07:00
Carl Lerche
2110a524a4 Deprecate RAILS_ROOT in favor of Rails.root (which proxies to the application's object root) 2009-10-16 12:51:02 -07:00
Jeremy Kemper
b0f55dc1f8 Remove framework subscriber tests which depends on AR, which isn't loaded 2009-10-15 21:51:24 -07:00
Jeremy Kemper
71f7e75d95 Merge branch 'master' into orchestra 2009-10-15 17:36:54 -07:00
Carl Lerche
97296b11e2 Have config/application.rb contain the application definition and require that file instead of config/boot.rb or config/environment.rb in script/*. 2009-10-15 14:54:12 -07:00
José Valim
2d7abe245e Renamed Orchestra to Notifications once again [#3321 state:resolved] 2009-10-15 18:51:51 -03:00