Commit Graph

67 Commits

Author SHA1 Message Date
Travis Yoder
b0b4b176b0 better docs for Rails.root and Rails.public_path 2015-05-07 10:54:26 -06:00
Jeremy Kemper
5154089c18 Revert "Merge pull request #19404 from dmathieu/remove_rack_env"
Preserving RACK_ENV behavior.

This reverts commit 7bdc7635b885e473f6a577264fd8efad1c02174f, reversing
changes made to 45786be516e13d55a1fca9a4abaddd5781209103.
2015-03-20 08:14:11 -07:00
Damien Mathieu
d578cbfb5c don't fallback to RACK_ENV when RAILS_ENV is not present 2015-03-19 10:06:28 +01:00
Rafael Mendonça França
21f02f3485 Remove some comments about Ruby 1.9 behaviors 2015-01-04 15:55:28 -03:00
claudiob
a770d7e404 Add docs for Rails.env and Rails.env=
[ci skip]
2014-12-22 03:44:37 +01:00
Aaron Patterson
d25fe31c40 lazily instantiate application subclasses
this means we can meaningfully override methods in the subclass
2014-08-06 18:27:16 -07:00
Prem Sichanugrist
2dd2fcf896
Introduce Rails.gem_version
This method return `Gem::Version.new(Rails.version)`, suggesting a more
reliable way to perform version comparison.

Example:

    Rails.version #=> "4.1.2"
    Rails.gem_version #=> #<Gem::Version "4.1.2">

    Rails.version > "4.1.10" #=> false
    Rails.gem_version > Gem::Version.new("4.1.10") #=> true
    Gem::Requirement.new("~> 4.1.2") =~ Rails.gem_version #=> true

This was originally introduced as `.version` by @charliesome in #8501
but got reverted in #10002 since it was not backward compatible.

Also, updating template for `rake update_versions`.
2014-03-05 12:37:38 -05:00
Andrew White
d6dec7fcb6 Add mailer previews feature based on mail_view gem 2013-12-17 03:58:35 +00:00
Paul Nikitochkin
419f257b73 Removed unused deprecation requires. 2013-07-03 23:21:23 +03:00
Genadi Samokovarov
50be56dcde Refactor of ::Rails module
1. Used ActiveSupport::Autoload to dry-up the autoload definitions.
2. Used ActiveSupport's delegate to dry up the application proxied
   attributes.
3. Did a little white space change on Rails.groups.
2013-06-12 11:42:36 +03:00
Charlie Somerville
ceb3b8717b reverts changes to Rails.version made in #8501 2013-03-30 14:16:46 +11:00
Charlie Somerville
f0e6ab59f6 remove references to *::VERSION, replace with *.version 2013-03-21 19:56:07 +11:00
Jeremy Kemper
f9da785d0b Move background jobs to the 'jobs' branch until fully baked. Not shipping with Rails 4.0. 2012-12-21 16:29:47 -08:00
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