mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Move railties/builtin into lib
This commit is contained in:
parent
f868c2afa9
commit
f38e89cfba
12 changed files with 12 additions and 17 deletions
|
@ -1,2 +0,0 @@
|
||||||
module Rails::InfoHelper
|
|
||||||
end
|
|
|
@ -1,5 +1,4 @@
|
||||||
require 'fileutils'
|
require 'fileutils'
|
||||||
require 'rails/railties_path'
|
|
||||||
require 'rails/plugin'
|
require 'rails/plugin'
|
||||||
require 'rails/engine'
|
require 'rails/engine'
|
||||||
|
|
||||||
|
|
|
@ -78,7 +78,7 @@ module Rails
|
||||||
end
|
end
|
||||||
|
|
||||||
def builtin_controller
|
def builtin_controller
|
||||||
File.join(RAILTIES_PATH, "builtin", "rails_info") if Rails.env.development?
|
File.expand_path('../info_routes', __FILE__) if Rails.env.development?
|
||||||
end
|
end
|
||||||
|
|
||||||
def log_level
|
def log_level
|
||||||
|
@ -96,4 +96,4 @@ module Rails
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -23,7 +23,7 @@ module Rails
|
||||||
|
|
||||||
initializer :add_builtin_route do |app|
|
initializer :add_builtin_route do |app|
|
||||||
if Rails.env.development?
|
if Rails.env.development?
|
||||||
app.routes_reloader.paths << File.join(RAILTIES_PATH, 'builtin', 'routes.rb')
|
app.routes_reloader.paths << File.expand_path('../../info_routes.rb', __FILE__)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -45,4 +45,4 @@ module Rails
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
RAILTIES_PATH = File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
|
|
|
@ -66,13 +66,14 @@ namespace :doc do
|
||||||
task :plugins => plugins.collect { |plugin| "doc:plugins:#{plugin}" }
|
task :plugins => plugins.collect { |plugin| "doc:plugins:#{plugin}" }
|
||||||
|
|
||||||
desc "Remove plugin documentation"
|
desc "Remove plugin documentation"
|
||||||
task :clobber_plugins do
|
task :clobber_plugins do
|
||||||
rm_rf 'doc/plugins' rescue nil
|
rm_rf 'doc/plugins' rescue nil
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "Generate Rails guides"
|
desc "Generate Rails guides"
|
||||||
task :guides do
|
task :guides do
|
||||||
require File.join(RAILTIES_PATH, "guides/rails_guides")
|
# FIXME: Reaching outside lib directory is a bad idea
|
||||||
|
require File.expand_path('../../../../guides/rails_guides', __FILE__)
|
||||||
RailsGuides::Generator.new(Rails.root.join("doc/guides")).generate
|
RailsGuides::Generator.new(Rails.root.join("doc/guides")).generate
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -92,7 +93,7 @@ namespace :doc do
|
||||||
|
|
||||||
files.include("#{plugin_base}/lib/**/*.rb")
|
files.include("#{plugin_base}/lib/**/*.rb")
|
||||||
if File.exist?("#{plugin_base}/README")
|
if File.exist?("#{plugin_base}/README")
|
||||||
files.include("#{plugin_base}/README")
|
files.include("#{plugin_base}/README")
|
||||||
options << "--main '#{plugin_base}/README'"
|
options << "--main '#{plugin_base}/README'"
|
||||||
end
|
end
|
||||||
files.include("#{plugin_base}/CHANGELOG") if File.exist?("#{plugin_base}/CHANGELOG")
|
files.include("#{plugin_base}/CHANGELOG") if File.exist?("#{plugin_base}/CHANGELOG")
|
||||||
|
|
|
@ -15,7 +15,6 @@ end
|
||||||
|
|
||||||
desc 'Explain the current environment'
|
desc 'Explain the current environment'
|
||||||
task :about do
|
task :about do
|
||||||
$LOAD_PATH.unshift "#{RAILTIES_PATH}/builtin/rails_info"
|
|
||||||
require 'rails/info'
|
require 'rails/info'
|
||||||
puts Rails::Info
|
puts Rails::Info
|
||||||
end
|
end
|
||||||
|
@ -26,12 +25,12 @@ namespace :time do
|
||||||
task :all do
|
task :all do
|
||||||
build_time_zone_list(:all)
|
build_time_zone_list(:all)
|
||||||
end
|
end
|
||||||
|
|
||||||
desc 'Displays names of US time zones recognized by the Rails TimeZone class, grouped by offset. Results can be filtered with optional OFFSET parameter, e.g., OFFSET=-6'
|
desc 'Displays names of US time zones recognized by the Rails TimeZone class, grouped by offset. Results can be filtered with optional OFFSET parameter, e.g., OFFSET=-6'
|
||||||
task :us do
|
task :us do
|
||||||
build_time_zone_list(:us_zones)
|
build_time_zone_list(:us_zones)
|
||||||
end
|
end
|
||||||
|
|
||||||
desc 'Displays names of time zones recognized by the Rails TimeZone class with the same offset as the system local time'
|
desc 'Displays names of time zones recognized by the Rails TimeZone class with the same offset as the system local time'
|
||||||
task :local do
|
task :local do
|
||||||
require 'active_support'
|
require 'active_support'
|
||||||
|
@ -41,7 +40,7 @@ namespace :time do
|
||||||
offset = jan_offset < jul_offset ? jan_offset : jul_offset
|
offset = jan_offset < jul_offset ? jan_offset : jul_offset
|
||||||
build_time_zone_list(:all, offset)
|
build_time_zone_list(:all, offset)
|
||||||
end
|
end
|
||||||
|
|
||||||
# to find UTC -06:00 zones, OFFSET can be set to either -6, -6:00 or 21600
|
# to find UTC -06:00 zones, OFFSET can be set to either -6, -6:00 or 21600
|
||||||
def build_time_zone_list(method, offset = ENV['OFFSET'])
|
def build_time_zone_list(method, offset = ENV['OFFSET'])
|
||||||
require 'active_support'
|
require 'active_support'
|
||||||
|
|
|
@ -13,7 +13,7 @@ Gem::Specification.new do |s|
|
||||||
s.homepage = 'http://www.rubyonrails.org'
|
s.homepage = 'http://www.rubyonrails.org'
|
||||||
s.rubyforge_project = 'rails'
|
s.rubyforge_project = 'rails'
|
||||||
|
|
||||||
s.files = Dir['CHANGELOG', 'README', 'bin/**/*', 'builtin/**/*', 'guides/**/*', 'lib/**/{*,.[a-z]*}']
|
s.files = Dir['CHANGELOG', 'README', 'bin/**/*', 'guides/**/*', 'lib/**/{*,.[a-z]*}']
|
||||||
s.require_path = 'lib'
|
s.require_path = 'lib'
|
||||||
s.bindir = 'bin'
|
s.bindir = 'bin'
|
||||||
s.executables = ['rails']
|
s.executables = ['rails']
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
ORIG_ARGV = ARGV.dup
|
ORIG_ARGV = ARGV.dup
|
||||||
|
|
||||||
require File.expand_path("../../../load_paths", __FILE__)
|
require File.expand_path("../../../load_paths", __FILE__)
|
||||||
$:.unshift File.expand_path("../../builtin/rails_info", __FILE__)
|
|
||||||
|
|
||||||
require 'stringio'
|
require 'stringio'
|
||||||
require 'test/unit'
|
require 'test/unit'
|
||||||
|
|
Loading…
Reference in a new issue