Fix the i18n dependency problem

This commit is contained in:
David Heinemeier Hansson 2009-12-27 14:43:06 -08:00
parent 9521fcbcc2
commit 1cd949006a
6 changed files with 8 additions and 8 deletions

@ -70,6 +70,3 @@ module ActiveSupport
end end
require 'active_support/vendor' require 'active_support/vendor'
require 'i18n'
I18n.load_path << "#{File.dirname(__FILE__)}/active_support/locale/en.yml"

@ -1,3 +1,4 @@
require 'active_support' require 'active_support'
require 'active_support/i18n'
require 'active_support/time' require 'active_support/time'
require 'active_support/core_ext' require 'active_support/core_ext'

@ -1,6 +1,7 @@
require 'active_support/core_ext/hash/keys' require 'active_support/core_ext/hash/keys'
require 'active_support/core_ext/hash/reverse_merge' require 'active_support/core_ext/hash/reverse_merge'
require 'active_support/inflector' require 'active_support/inflector'
require 'active_support/i18n'
class Array class Array
# Converts the array to a comma-separated sentence where the last element is joined by the connector word. Options: # Converts the array to a comma-separated sentence where the last element is joined by the connector word. Options:

@ -0,0 +1,2 @@
require 'i18n'
I18n.load_path << "#{File.dirname(__FILE__)}/locale/en.yml"

@ -20,7 +20,7 @@ end
ARGV << "--help" if ARGV.empty? ARGV << "--help" if ARGV.empty?
require 'rails'
require 'rails/generators' require 'rails/generators'
require 'rails/generators/rails/app/app_generator' require 'rails/generators/rails/app/app_generator'

@ -4,8 +4,7 @@
require 'active_support' require 'active_support'
require 'active_support/core_ext/object/blank' require 'active_support/core_ext/object/blank'
require 'active_support/core_ext/object/metaclass' require 'active_support/core_ext/object/metaclass'
require 'active_support/core_ext/array' require 'active_support/core_ext/array/extract_options'
require 'active_support/core_ext/hash'
require 'active_support/core_ext/module/attribute_accessors' require 'active_support/core_ext/module/attribute_accessors'
require 'active_support/core_ext/string/inflections' require 'active_support/core_ext/string/inflections'
@ -95,7 +94,7 @@ def self.gems_generators_paths #:nodoc:
end end
def self.plugins_generators_paths #:nodoc: def self.plugins_generators_paths #:nodoc:
return [] unless Rails.root return [] unless defined?(Rails.root)
Dir[File.join(Rails.root, "vendor", "plugins", "*", "lib", "{generators,rails_generators}")] Dir[File.join(Rails.root, "vendor", "plugins", "*", "lib", "{generators,rails_generators}")]
end end
@ -136,7 +135,7 @@ def self.no_color!
def self.load_paths def self.load_paths
@load_paths ||= begin @load_paths ||= begin
paths = [] paths = []
paths += Dir[File.join(Rails.root, "lib", "{generators,rails_generators}")] if Rails.root paths += Dir[File.join(Rails.root, "lib", "{generators,rails_generators}")] if defined?(Rails.root)
paths += Dir[File.join(Thor::Util.user_home, ".rails", "{generators,rails_generators}")] paths += Dir[File.join(Thor::Util.user_home, ".rails", "{generators,rails_generators}")]
paths += self.plugins_generators_paths paths += self.plugins_generators_paths
paths += self.gems_generators_paths paths += self.gems_generators_paths