mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Harmonize framework require strategy. Don't add self to load path since Rails initializer and RubyGems handle it.
This commit is contained in:
parent
b7a37b742c
commit
172606e21f
6 changed files with 36 additions and 38 deletions
|
@ -21,13 +21,13 @@
|
||||||
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
#++
|
#++
|
||||||
|
|
||||||
unless defined?(ActionController)
|
|
||||||
begin
|
begin
|
||||||
$:.unshift "#{File.dirname(__FILE__)}/../../actionpack/lib"
|
|
||||||
require 'action_controller'
|
require 'action_controller'
|
||||||
rescue LoadError
|
rescue LoadError
|
||||||
require 'rubygems'
|
actionpack_path = "#{File.dirname(__FILE__)}/../../actionpack/lib"
|
||||||
gem 'actionpack', '>= 1.12.5'
|
if File.directory?(actionpack_path)
|
||||||
|
$:.unshift actionpack_path
|
||||||
|
require 'action_controller'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -21,16 +21,13 @@
|
||||||
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
#++
|
#++
|
||||||
|
|
||||||
$:.unshift(File.dirname(__FILE__)) unless
|
|
||||||
$:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
|
|
||||||
|
|
||||||
unless defined?(ActiveSupport)
|
|
||||||
begin
|
begin
|
||||||
$:.unshift "#{File.dirname(__FILE__)}/../../activesupport/lib"
|
|
||||||
require 'active_support'
|
require 'active_support'
|
||||||
rescue LoadError
|
rescue LoadError
|
||||||
require 'rubygems'
|
activesupport_path = "#{File.dirname(__FILE__)}/../../activesupport/lib"
|
||||||
gem 'activesupport'
|
if File.directory?(activesupport_path)
|
||||||
|
$:.unshift activesupport_path
|
||||||
|
require 'active_support'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,15 @@
|
||||||
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
#++
|
#++
|
||||||
|
|
||||||
|
begin
|
||||||
|
require 'active_support'
|
||||||
|
rescue LoadError
|
||||||
|
activesupport_path = "#{File.dirname(__FILE__)}/../../activesupport/lib"
|
||||||
|
if File.directory?(activesupport_path)
|
||||||
|
$:.unshift activesupport_path
|
||||||
|
require 'active_support'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
require 'action_view/template_handlers'
|
require 'action_view/template_handlers'
|
||||||
require 'action_view/renderable'
|
require 'action_view/renderable'
|
||||||
|
@ -35,7 +44,7 @@ require 'action_view/partials'
|
||||||
require 'action_view/template_error'
|
require 'action_view/template_error'
|
||||||
|
|
||||||
I18n.backend.populate do
|
I18n.backend.populate do
|
||||||
I18n.load_translations File.dirname(__FILE__) + '/action_view/locale/en-US.yml'
|
I18n.load_translations "#{File.dirname(__FILE__)}/action_view/locale/en-US.yml"
|
||||||
end
|
end
|
||||||
|
|
||||||
require 'action_view/helpers'
|
require 'action_view/helpers'
|
||||||
|
|
|
@ -21,18 +21,15 @@
|
||||||
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
#++
|
#++
|
||||||
|
|
||||||
$:.unshift(File.dirname(__FILE__)) unless
|
begin
|
||||||
$:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
|
|
||||||
|
|
||||||
active_support_path = File.dirname(__FILE__) + "/../../activesupport/lib"
|
|
||||||
if File.exist?(active_support_path)
|
|
||||||
$:.unshift active_support_path
|
|
||||||
require 'active_support'
|
require 'active_support'
|
||||||
else
|
rescue LoadError
|
||||||
require 'rubygems'
|
activesupport_path = "#{File.dirname(__FILE__)}/../../activesupport/lib"
|
||||||
gem 'activesupport'
|
if File.directory?(activesupport_path)
|
||||||
|
$:.unshift activesupport_path
|
||||||
require 'active_support'
|
require 'active_support'
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
require 'active_record/base'
|
require 'active_record/base'
|
||||||
require 'active_record/named_scope'
|
require 'active_record/named_scope'
|
||||||
|
|
|
@ -21,16 +21,13 @@
|
||||||
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
#++
|
#++
|
||||||
|
|
||||||
$:.unshift(File.dirname(__FILE__)) unless
|
|
||||||
$:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
|
|
||||||
|
|
||||||
unless defined?(ActiveSupport)
|
|
||||||
begin
|
begin
|
||||||
$:.unshift(File.dirname(__FILE__) + "/../../activesupport/lib")
|
|
||||||
require 'active_support'
|
require 'active_support'
|
||||||
rescue LoadError
|
rescue LoadError
|
||||||
require 'rubygems'
|
activesupport_path = "#{File.dirname(__FILE__)}/../../activesupport/lib"
|
||||||
gem 'activesupport'
|
if File.directory?(activesupport_path)
|
||||||
|
$:.unshift activesupport_path
|
||||||
|
require 'active_support'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -21,8 +21,6 @@
|
||||||
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
#++
|
#++
|
||||||
|
|
||||||
$:.unshift(File.dirname(__FILE__))
|
|
||||||
|
|
||||||
require 'active_support/vendor'
|
require 'active_support/vendor'
|
||||||
require 'active_support/basic_object'
|
require 'active_support/basic_object'
|
||||||
require 'active_support/inflector'
|
require 'active_support/inflector'
|
||||||
|
|
Loading…
Reference in a new issue