Commit Graph

54 Commits

Author SHA1 Message Date
Andy Lindeman
33b3fa67c4 Revert "Make sure that RAILS_ENV is set when accessing Rails.env"
This reverts commit b3125c89f42968bec6ee0b92ab93e36dbc36d5c3.

* It is not desirable to set `ENV['RAILS_ENV']`; otherwise, it will leak
  through to rake tasks such as `rake test` or `rake spec`. See #7175
  for more details.
2012-12-21 17:22:57 -05:00
schneems
baea5d69be Use Rails to Render Default Index Page
This is an alternative implementation to #7771 thanks to the advice of @spastorino

Rails is a dynamic framework that serves a static index.html by default. One of my first questions ever on IRC was solved by simply deleting my public/index.html file. This file is a source of confusion when starting as it over-rides any set "root" in the routes yet it itself is not listed in the routes. By making the page dynamic by default we can eliminate this confusion.

This PR moves the static index page to an internal controller/route/view similar to `rails/info`. When someone starts a rails server, if no root is defined, this route will take over and the "dynamic" index page from rails/welcome_controller will be rendered. These routes are only added in development. If a developer defines a root in their routes, it automatically takes precedence over this route and will be rendered, with no deleting of files required. 

In addition to removing this source of confusion for new devs, we can now use Rails view helpers to build and render this page. While not the primary intent, the added value of "dogfooding" should not be under-estimated.

The prior PR #7771 had push-back since it introduced developer facing files. This PR solves all of the same problems, but does not have any new developer facing files (it actually removes one). 

cc/ @wsouto, @dickeyxxx, @tyre, @ryanb, @josevalim, @maxim, @subdigital, @steveklabnik

ATP Railties and Actionpack.
2012-12-10 16:15:04 -08:00
Bjørn Arild Mæland
b9d1d2cdda Use attr_accessor for Rails.{application,cache,logger} 2012-12-01 21:41:54 +01:00
Steve Klabnik
b3125c89f4 Make sure that RAILS_ENV is set when accessing Rails.env
Fixes #8025
2012-10-31 17:05:26 -07:00
Robin Dupret
5ad7f8ab41 Use Ruby 1.9 Hash syntax in railties 2012-10-14 18:26:58 +02:00
Prem Sichanugrist
26fe77b27d Make Rails.public_path return a Pathname 2012-10-02 20:44:02 -04:00
Santiago Pastorino
8577687fcb Move queue classes to ActiveSupport 2012-09-14 14:10:00 -07:00
Francesco Rodriguez
17059a4868 Removing ==Examples and last blank lines of docs from railties 2012-05-14 10:50:59 -05:00
Yehuda Katz
adff4a706a Initial queue implementation 2012-04-26 21:38:27 -07:00
Roman V. Babenko
1e36e02df3 Class variables has been fixed to Singleton instance variables at Rails module 2012-04-06 07:59:57 +03:00
Franck Verrot
4882271f6b Rails.initialized? can be called at any time without raising an exception [Closes #2507]
Changes:

* `Rails.initialized=` has been removed
* `Rails.initialized?` and `Rails.application.initialized?` are now
* delegating to `MyApp::Application.initialized?`
2012-03-28 00:42:59 +02:00
kennyj
6f8159c421 Deprecate RAILS_CACHE constant. 2012-01-18 01:53:09 +09:00
José Valim
51095be1b0 Get rid of more 1.8.x dead code 2011-12-20 17:59:26 +01:00
Aaron Patterson
572c3d5178 * BufferedLogger is deprecated. Use ActiveSupport::Logger, or the logger
from Ruby stdlib.
2011-12-19 18:41:37 -08:00
Aaron Patterson
3096629d29 we are *sure* we want to set the encoding, so silence warnings around it 2011-08-24 16:23:38 -07:00
Oemuer Oezkir
71d18ce48e Changed a few instances of of words in the API docs written in British English to
American English(according to Weber)
2011-07-24 10:21:42 +00:00
José Valim
60076de1d4 Make Rails.groups accept arrays. 2011-07-10 08:36:08 -03:00
José Valim
a803aec00d Add Rails.groups to encapsulate available groups for require. 2011-06-21 11:24:05 -03:00
José Valim
d649bf158b Provide a cleaner syntax for paths configuration that does not rely on method_missing. 2010-10-06 17:20:15 +02:00
Piotr Sarnacki
939d4255e6 Removed most of deprecated stuff from Application and Engine 2010-09-03 22:59:04 +02:00
José Valim
800695ad4c Remove constants deprecation. 2010-08-29 20:48:32 -03:00
José Valim
6788db824a Move Rails::LogSubscriber to ActiveSupport::LogSubscriber, allowing frameworks like ActiveRecord and ActiveResource to log outsude Rails::Application [#4816 state:resolved] 2010-06-24 13:23:43 +02:00
Xavier Noria
f17159b029 edit pass: the names of Rails components have a space, ie, "Active Record", not "ActiveRecord" 2010-06-14 23:22:04 +02:00
Jeremy Kemper
1a5654851e Single ruby version requirement message 2010-06-11 11:02:47 -07:00
wycats
80b60671f7 Revert "Moved encoding work in progress to a feature branch."
This reverts commit ade756fe42423033bae8e5aea8f58782f7a6c517.
2010-05-17 19:41:54 +04:00
Jeremy Kemper
ade756fe42 Moved encoding work in progress to a feature branch.
This reverts commits af0d1a88157942c6e6398dbf73891cff1e152405 and 64d109e3539ad600f58536d3ecabd2f87b67fd1c.
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
José Valim
4e92134dfa Fix a bug in ActionDispatch::Static where Rails cannot find assets if started in another directory which is not the RAILS_ROOT. 2010-04-08 12:52:37 +02:00
Mikel Lindsaar
336cb3c0bf Adding Rails.env= to railties to allow changing of rails env on the fly for rake tasks etc
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-04-08 12:07:19 +02:00
Joshua Peek
fcc6b12e77 Autoload Rails::Info 2010-03-20 14:03:43 -05:00
Prem Sichanugrist
f0523f72b4 Rename Rails::Subscriber to Rails::LogSubscriber 2010-02-16 22:36:15 +01:00
José Valim
3b6f659fb6 Add active_model/railtie back to generated boot.rb, add models back to paths, load active_support/railtie since we need it and ensure default logger is set before config. 2010-01-25 01:12:22 +01:00
José Valim
b17e358e3d Move configuration to subfolders. 2010-01-23 22:30:17 +01:00
José Valim
2b75b94ac0 Plugin is now an Engine. 2010-01-23 17:51:48 +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
José Valim
7fcf8590e7 Massive cleanup in Railties and load stack. 2010-01-21 23:14:20 +01:00
José Valim
27d9836ad3 Add ActionDispatch::Railties::Subscriber and finish tidying up the logging. 2010-01-17 12:43:17 +01:00
José Valim
9dd4c79d61 Allow to add subscribers through Railtie. 2010-01-13 01:19:22 +01:00
José Valim
5f34bd61b0 As the other constants, RAILS_DEFAULT_LOGGER no more. 2010-01-13 01:19:22 +01:00
David Heinemeier Hansson
8cb594a2e1 Get everyone running on Rails.env and fix the broken environment settings for script/console and script/dbconsole 2010-01-11 14:01:28 -08:00
Joshua Peek
8fe66f1af0 Run railtie and plugin initializers before app specific ones 2010-01-07 14:01:34 -06: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
a23f4b6aee Add a /rails.rb for each framework for consistency 2009-12-31 11:57:59 -08:00
Carlhuda
dc677f7665 tests pass with requiring the frameworks in rails.rb 2009-12-23 15:16:38 -08:00
Carl Lerche
1b27f5c4f7 Add the ability for plugins to set default configuration settings. 2009-12-15 22:13:52 -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
Yehuda Katz + Carl Lerche
82b9b151ff Refactor plugins 2009-11-11 18:09:16 -08:00