Commit Graph

242 Commits

Author SHA1 Message Date
Yehuda Katz + Carl Lerche
f2aea4d3ea Get initializer_test.rb to pass with the new initializer. 2009-06-23 14:49:03 -07:00
Yehuda Katz + Carl Lerche
a3309e4d70 Started making progress on implementing a new initializer.
Class.any_instance.expects(:require).raises(LoadError)
	... w0t
2009-06-23 14:49:03 -07:00
Yehuda Katz + Carl Lerche
d8f352e970 Rename ActionView::Template::Path ActionView::Resolver 2009-06-17 15:32:55 -07:00
Tim Connor
6a3f8ae407 Work around a gem dependency edge case that prevents Rails from booting..
If you have a frozen gem with unfrozen dependencies (for instance if the
dependency has native extensions so can't be frozen) you can have a
nightmare upgrade problem, where you cannot rake gems:install, because
rake is broken by a gem loading problem.

If you bump up your frozen gem to a newer version that requires a newer
dependency, everybody else on the team will have rake broken by that
dependency mismatch, since you will have had to specify the dependency
in your config.gems, otherwise nobody will have installed it, since the
parent is frozen. And now the config.gems loading code will kill rake.

[#2609 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-06-05 21:54:56 -07:00
Luke Melia
54984f0f24 Avoid loading the ActiveRecord::SessionStore class on initialization if it is not in use [#2737 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-05-30 09:35:25 -05:00
Jeremy Kemper
cf3ccd7be0 Ruby 1.9: use UTF-8 for default internal and external encodings. 2009-05-28 17:12:48 -05:00
calavera
0d9e904da3 ensure initialize_database_middleware doesn't use ActionController if action_controller framework is not enabled [#2680 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-05-27 14:56:14 -05:00
Jeremy Kemper
5f222c524e Remove 'core' fluff. Hookable ActiveSupport.load_all! 2009-05-20 18:12:44 -07:00
Joshua Peek
092089015b Extract generic callbacks middleware from dispatcher 2009-05-17 13:39:55 -05:00
Joshua Peek
8118fca9be Merge Failsafe middleware into ShowExceptions 2009-05-17 12:24:59 -05:00
Yehuda Katz
4fa871654d Get Railties passing again 2009-05-16 12:28:25 -07:00
Jeremy Kemper
e8550ee032 Cherry-pick core extensions 2009-05-13 12:00:15 -07:00
Jeremy Kemper
bd7659e014 Fix old reference to ActionController::Failsafe 2009-05-06 01:28:06 -07:00
David Dollar
599f2cfb4a Attempt to deal with more cases of gems with native components.
This commit adds a rudimentary check for 'unbuilt' gems, so that we can abort
the application load if there are any gems that have native components that
have not yet been built.

The rake task gems:build has now only builds 'unbuilt' gems as a result.

The rake task gems:build:force has been added to deal with cases of incomplete
builds, or any case where you need to force the build of all of your gems.

Changes the gems:build task to get its gem list by parsing directory entries
in vendor/gems, which sidesteps the chicken/egg issues involved with having a
gem unpacked into vendor/gems without before its native bits are compiled.

[#2266 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-04-28 23:16:47 -07:00
Jeremy Kemper
acd5db300b Rejig active support dependencies to behave better with the boot process 2009-04-28 18:25:35 -07:00
Hongli Lai (Phusion)
cd9bb88eef Remove reference to Rack::RewindableInput, which has been removed a while ago.
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-04-26 11:22:03 -05:00
Carl Lerche & Yehuda Katz
3c1187699a Makes rails-dev-boost work again 2009-04-14 18:32:31 -07:00
Carl Lerche & Yehuda Katz
d9afc51391 Rails server boots again 2009-04-13 17:16:07 -07:00
Carl Lerche & Yehuda Katz
906aebceed Bring abstract_controller up to date with rails/master
Resolved all the conflicts since 2.3.0 -> HEAD. Following is a list
of commits that could not be applied cleanly or are obviated with the
abstract_controller refactor. They all need to be revisited to ensure
that fixes made in 2.3 do not reappear in 3.0:

2259ecf368e6a6715966f69216e3ee86bf1a82a7
AR not available
  * This will be reimplemented with ActionORM or equivalent

06182ea02e92afad579998aa80144588e8865ac3
implicitly rendering a js response should not use the default layout
[#1844 state:resolved]
  * This will be handled generically

893e9eb99504705419ad6edac14d00e71cef5f12
Improve view rendering performance in development mode and reinstate
template recompiling in production [#1909 state:resolved]
  * We will need to reimplement rails-dev-boost on top of the refactor;
    the changes here are very implementation specific and cannot be
    cleanly applied. The following commits are implicated:

      199e750d46c04970b5e7684998d09405648ecbd4
      3942cb406e1d5db0ac00e03153809cc8dc4cc4db
      f8ea9f85d4f1e3e6f3b5d895bef6b013aa4b0690
      e3b166aab37ddc2fbab030b146eb61713b91bf55
      ae9f258e03c9fd5088da12c1c6cd216cc89a01f7
      44423126c6f6133a1d9cf1d0832b527e8711d40f

0cb020b4d6d838025859bd60fb8151c8e21b8e84
workaround for picking layouts based on wrong view_paths
[#1974 state:resolved]
  * The specifics of this commit no longer apply. Since it is a two-line
    commit, we will reimplement this change.

8c5cc66a831aadb159f3daaffa4208064c30af0e
make action_controller/layouts pick templates from the current instance's
view_paths instead of the class view_paths [#1974 state:resolved]
  * This does not apply at all. It should be trivial to apply the feature
    to the reimplemented ActionController::Base.

87e8b162463f13bd50d27398f020769460a770e3
fix HTML fallback for explicit templates [#2052 state:resolved]
  * There were a number of patches related to this that simply compounded
    each other. Basically none of them apply cleanly, and the underlying
    issue needs to be revisited. After discussing the underlying problem
    with Koz, we will defer these fixes for further discussion.
2009-04-13 15:18:45 -07:00
David Dollar
99d75a7b02 Makes the gem system understand development vs. runtime dependencies [#2195 state:resolved]
The patch also fixes:

* Fixes the chicken/egg problem present in the current gem system when
  gems are defined in the config that are not yet installed.

* Remove the need to have hoe as a dependency of your production app.

* Makes the gem 'unpacking' system a lot less fragile.

Signed-off-by: Matt Jones <al2o3cr@gmail.com>
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-03-13 10:20:23 +00:00
Simon Jefford
4d4d2c3896 Enhanced Rails Metal - the load order of metals can now be configured [#2057 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-03-03 12:39:19 -06:00
Matthew Rudy Jacobs
319106d09c Metal can now line in plugins under app/metal [#2045 state:committed]
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
2009-02-27 14:37:11 +01:00
Joshua Peek
1b22071b27 Ensure ActiveRecord session store's connections are checked in after each request [#1927 state:resolved] 2009-02-24 11:34:32 -06:00
Pratik Naik
53cd102b39 Merge with docrails 2009-02-24 12:29:25 +00:00
Sven Fuchs
441e4e2235 load plugin view_paths to action_mailer view_paths and make action_mailer use them [#2031 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-02-22 10:39:56 -06:00
David Heinemeier Hansson
b61cad6ae1 Ensure that the app routes file is loaded even when engines are in play (Thjis) [#1970 state:committed] 2009-02-22 16:04:04 +01:00
Matt Jones
01c818e99f break out of initializer early if gems aren't loaded [#1750 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-02-20 14:16:07 -06:00
Joshua Peek
69c049f5ab Move development mode reloading up the stack to avoid issues with class reloading in middleware 2009-02-20 12:04:57 -06:00
thedarkone
3942cb406e Port fast reloadable templates from rails-dev-boost. 2009-02-12 13:04:12 -06:00
Andrew White
199e750d46 Fix some edge cases when the same template is called with different local assigns
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-02-10 12:09:49 -06:00
Gaspard Bucher
1dab1d3803 Fixes a typo in initializer.rb producing error: undefined local variable or method `view_path'. 2009-02-10 12:00:22 -06:00
Joshua Peek
5c63be1f92 Still need to setup view paths 2009-02-09 14:53:14 -06:00
Andrew White
893e9eb995 Improve view rendering performance in development mode and reinstate template recompiling in production [#1909 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-02-09 14:20:30 -06:00
Joshua Peek
c96382a71a Make sure all autoload constants are pulled in when using config.threadsafe! [#1831 state:resolved] 2009-02-05 16:39:32 -06:00
Joshua Peek
f716ab92bf Disable eager loading for all rake tasks [#802 state:resolved] 2009-01-27 15:53:02 -06:00
Joshua Peek
73cc5f270a Setup ActiveRecord QueryCache middleware in the initializer 2009-01-21 12:44:07 -06:00
Joshua Peek
82334a7431 Only insert metal middleware if any exist 2009-01-21 12:37:03 -06:00
Lourens Naude
b08c968875 Decouple the local cache strategy from MemCacheStore for reuse with other remote stores [#1653 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-01-17 18:05:48 -06:00
Nahum Wild
a53ad5bba3 Added in a local per request cache to MemCacheStore. It acts as a buffer to stop unneccessary requests being sent through to memcache [#1653 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-01-15 21:29:32 -06:00
Joshua Peek
b281a6a5b2 Use Rack's MethodOverride lib [#1699 state:resolved] 2009-01-13 17:26:29 -06:00
Joshua Peek
ed2e776bde Move metal above method piggybacking middleware and add some test coverage 2009-01-03 23:02:29 -06:00
Joshua Peek
558ab327b7 Clean up view path cruft and split path implementations into Template::Path and Template::EagerPath 2008-12-29 19:27:19 -06:00
Joshua Peek
61a41154f7 Make generated Metal bits a pure rack endpoint application (not middleware)
Instead of calling super to pass the request on, return a 404.
The modified app looks like this:

  # app/metal/poller.rb
  class Poller
    def self.call(env)
      if env["PATH_INFO"] =~ /^\/poller/
        [200, {"Content-Type" => "text/html"}, "Hello, World!"]
      else
        [404, {"Content-Type" => "text/html"}, "Not Found"]
      end
    end
  end

But you aren't locked in to just Rails:

  # app/metal/api.rb
  require 'sinatra'
  Sinatra::Application.default_options.merge!(:run => false, :env => :production)
  Api = Sinatra.application unless defined? Api

  get '/interesting/new/ideas' do
    'Hello Sinatra!'
  end
2008-12-17 09:53:56 -06:00
Joshua Peek
8c3a543664 Introduce Rails Metal
# app/metal/poller.rb
  class Poller < Rails::Rack::Metal
    def call(env)
      if env["PATH_INFO"] =~ /^\/poller/
        [200, {"Content-Type" => "application/json"}, Message.recent.to_json]
      else
        super
      end
    end
  end

* There is a generator to help you get started
    `script/generate metal poller`

* Also, metal bits can be ran standalone with rackup
    `rackup app/metal/poller.rb`
2008-12-16 13:15:06 -06:00
Joshua Peek
ed70830713 Switch to Rack based session stores. 2008-12-15 16:33:31 -06:00
Jeremy Kemper
57f0b9738e Remove config dir from the load path 2008-12-03 21:46:36 -06:00
Joshua Peek
06ed8e4511 Add internal middleware stack to Dispatcher
config.middleware.use Rack::Cache
2008-12-01 13:49:34 -06:00
David Heinemeier Hansson
be140e8c6b Changed Rails.root to return a Pathname object (allows for Rails.root.join("app", "controllers") => "#{RAILS_ROOT}/app/controllers") [#1482] 2008-11-30 15:59:30 -06:00
David Heinemeier Hansson
471f024018 Me loves me some whitespace 2008-11-30 14:58:42 -06:00
Jeremy Kemper
cfb2126726 Load app initializers by path relative to Rails.root 2008-11-29 20:06:49 -08:00