Permalink
Browse files

Added install.rbs for all frameworks and made all of them generic eno…

…ugh not to require maintenance #1013, #1012

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1053 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
dhh committed Apr 2, 2005
1 parent 998ab50 commit 8d488264b5177966217982740cdd152bfc4f8903
Showing with 82 additions and 157 deletions.
  1. +7 −38 actionmailer/install.rb
  2. +8 −77 actionpack/install.rb
  3. +30 −0 actionwebservice/install.rb
  4. +7 −42 activerecord/install.rb
  5. +30 −0 activesupport/install.rb
View
@@ -18,44 +18,13 @@
end
end
-makedirs = %w{ action_mailer/vendor action_mailer/vendor/text action_mailer/vendor/tmail }
-makedirs.each {|f| File::makedirs(File.join($sitedir, *f.split(/\//)))}
-
-# deprecated files that should be removed
-# deprecated = %w{ }
-
-# files to install in library path
-files = %w-
- action_mailer.rb
- action_mailer/base.rb
- action_mailer/mail_helper.rb
- action_mailer/vendor/text/format.rb
- action_mailer/vendor/tmail.rb
- action_mailer/vendor/tmail/address.rb
- action_mailer/vendor/tmail/base64.rb
- action_mailer/vendor/tmail/config.rb
- action_mailer/vendor/tmail/encode.rb
- action_mailer/vendor/tmail/facade.rb
- action_mailer/vendor/tmail/header.rb
- action_mailer/vendor/tmail/info.rb
- action_mailer/vendor/tmail/loader.rb
- action_mailer/vendor/tmail/mail.rb
- action_mailer/vendor/tmail/mailbox.rb
- action_mailer/vendor/tmail/mbox.rb
- action_mailer/vendor/tmail/net.rb
- action_mailer/vendor/tmail/obsolete.rb
- action_mailer/vendor/tmail/parser.rb
- action_mailer/vendor/tmail/port.rb
- action_mailer/vendor/tmail/scanner.rb
- action_mailer/vendor/tmail/scanner_r.rb
- action_mailer/vendor/tmail/stringio.rb
- action_mailer/vendor/tmail/tmail.rb
- action_mailer/vendor/tmail/utils.rb
--
-
# the acual gruntwork
Dir.chdir("lib")
-# File::safe_unlink *deprecated.collect{|f| File.join($sitedir, f.split(/\//))}
-files.each {|f|
- File::install(f, File.join($sitedir, *f.split(/\//)), 0644, true)
+
+Find.find("action_mailer", "action_mailer.rb") { |f|
+ if f[-3..-1] == ".rb"
+ File::install(f, File.join($sitedir, *f.split(/\//)), 0644, true)
+ else
+ File::makedirs(File.join($sitedir, *f.split(/\//)))
+ end
}
View
@@ -18,82 +18,13 @@
end
end
-makedirs = %w{ action_controller/assertions action_controller/cgi_ext
- action_controller/session action_controller/support
- action_controller/templates action_controller/templates/rescues
- action_controller/templates/scaffolds
- action_view/helpers action_view/vendor action_view/vendor/builder
-}
-
-
-makedirs.each {|f| File::makedirs(File.join($sitedir, *f.split(/\//)))}
-
-# deprecated files that should be removed
-# deprecated = %w{ }
-
-# files to install in library path
-files = %w-
- action_controller.rb
- action_controller/assertions/action_pack_assertions.rb
- action_controller/assertions/active_record_assertions.rb
- action_controller/base.rb
- action_controller/benchmarking.rb
- action_controller/cgi_ext/cgi_ext.rb
- action_controller/cgi_ext/cgi_methods.rb
- action_controller/cgi_ext/cookie_performance_fix.rb
- action_controller/cgi_ext/raw_post_data_fix.rb
- action_controller/caching.rb
- action_controller/cgi_process.rb
- action_controller/cookies.rb
- action_controller/dependencies.rb
- action_controller/filters.rb
- action_controller/flash.rb
- action_controller/helpers.rb
- action_controller/layout.rb
- action_controller/request.rb
- action_controller/rescue.rb
- action_controller/response.rb
- action_controller/scaffolding.rb
- action_controller/session/active_record_store.rb
- action_controller/session/drb_server.rb
- action_controller/session/drb_store.rb
- action_controller/session/mem_cache_store.rb
- action_controller/session.rb
- action_controller/templates/rescues/_request_and_response.rhtml
- action_controller/templates/rescues/diagnostics.rhtml
- action_controller/templates/rescues/layout.rhtml
- action_controller/templates/rescues/missing_template.rhtml
- action_controller/templates/rescues/template_error.rhtml
- action_controller/templates/rescues/unknown_action.rhtml
- action_controller/templates/scaffolds/edit.rhtml
- action_controller/templates/scaffolds/layout.rhtml
- action_controller/templates/scaffolds/list.rhtml
- action_controller/templates/scaffolds/new.rhtml
- action_controller/templates/scaffolds/show.rhtml
- action_controller/test_process.rb
- action_controller/url_rewriter.rb
- action_view.rb
- action_view/base.rb
- action_view/helpers/active_record_helper.rb
- action_view/helpers/date_helper.rb
- action_view/helpers/debug_helper.rb
- action_view/helpers/form_helper.rb
- action_view/helpers/form_options_helper.rb
- action_view/helpers/text_helper.rb
- action_view/helpers/tag_helper.rb
- action_view/helpers/url_helper.rb
- action_view/partials.rb
- action_view/template_error.rb
- action_view/vendor/builder.rb
- action_view/vendor/builder/blankslate.rb
- action_view/vendor/builder/xmlbase.rb
- action_view/vendor/builder/xmlevents.rb
- action_view/vendor/builder/xmlmarkup.rb
--
-
# the acual gruntwork
Dir.chdir("lib")
-# File::safe_unlink *deprecated.collect{|f| File.join($sitedir, f.split(/\//))}
-files.each {|f|
- File::install(f, File.join($sitedir, *f.split(/\//)), 0644, true)
-}
+
+Find.find("action_controller", "action_controller.rb", "action_view", "action_view.rb") { |f|
+ if f[-3..-1] == ".rb"
+ File::install(f, File.join($sitedir, *f.split(/\//)), 0644, true)
+ else
+ File::makedirs(File.join($sitedir, *f.split(/\//)))
+ end
+}
@@ -0,0 +1,30 @@
+require 'rbconfig'
+require 'find'
+require 'ftools'
+
+include Config
+
+# this was adapted from rdoc's install.rb by ways of Log4r
+
+$sitedir = CONFIG["sitelibdir"]
+unless $sitedir
+ version = CONFIG["MAJOR"] + "." + CONFIG["MINOR"]
+ $libdir = File.join(CONFIG["libdir"], "ruby", version)
+ $sitedir = $:.find {|x| x =~ /site_ruby/ }
+ if !$sitedir
+ $sitedir = File.join($libdir, "site_ruby")
+ elsif $sitedir !~ Regexp.quote(version)
+ $sitedir = File.join($sitedir, version)
+ end
+end
+
+# the acual gruntwork
+Dir.chdir("lib")
+
+Find.find("action_web_service", "action_web_service.rb") { |f|
+ if f[-3..-1] == ".rb"
+ File::install(f, File.join($sitedir, *f.split(/\//)), 0644, true)
+ else
+ File::makedirs(File.join($sitedir, *f.split(/\//)))
+ end
+}
View
@@ -18,48 +18,13 @@
end
end
-makedirs = %w{ active_record/associations active_record/connection_adapters active_record/support active_record/vendor active_record/acts }
-makedirs.each {|f| File::makedirs(File.join($sitedir, *f.split(/\//)))}
-
-# deprecated files that should be removed
-# deprecated = %w{ }
-
-# files to install in library path
-files = %w-
- active_record.rb
- active_record/aggregations.rb
- active_record/associations.rb
- active_record/associations/association_collection.rb
- active_record/associations/has_and_belongs_to_many_association.rb
- active_record/associations/has_many_association.rb
- active_record/base.rb
- active_record/callbacks.rb
- active_record/connection_adapters/abstract_adapter.rb
- active_record/connection_adapters/db2_adapter.rb
- active_record/connection_adapters/mysql_adapter.rb
- active_record/connection_adapters/oracle_adapter.rb
- active_record/connection_adapters/postgresql_adapter.rb
- active_record/connection_adapters/sqlite_adapter.rb
- active_record/connection_adapters/sqlserver_adapter.rb
- active_record/deprecated_associations.rb
- active_record/fixtures.rb
- active_record/locking.rb
- active_record/observer.rb
- active_record/reflection.rb
- active_record/acts/list.rb
- active_record/acts/tree.rb
- active_record/timestamp.rb
- active_record/transactions.rb
- active_record/validations.rb
- active_record/vendor/db2.rb
- active_record/vendor/mysql.rb
- active_record/vendor/mysql411.rb
- active_record/vendor/simple.rb
--
-
# the acual gruntwork
Dir.chdir("lib")
-# File::safe_unlink *deprecated.collect{|f| File.join($sitedir, f.split(/\//))}
-files.each {|f|
- File::install(f, File.join($sitedir, *f.split(/\//)), 0644, true)
+
+Find.find("active_record", "active_record.rb") { |f|
+ if f[-3..-1] == ".rb"
+ File::install(f, File.join($sitedir, *f.split(/\//)), 0644, true)
+ else
+ File::makedirs(File.join($sitedir, *f.split(/\//)))
+ end
}
View
@@ -0,0 +1,30 @@
+require 'rbconfig'
+require 'find'
+require 'ftools'
+
+include Config
+
+# this was adapted from rdoc's install.rb by ways of Log4r
+
+$sitedir = CONFIG["sitelibdir"]
+unless $sitedir
+ version = CONFIG["MAJOR"] + "." + CONFIG["MINOR"]
+ $libdir = File.join(CONFIG["libdir"], "ruby", version)
+ $sitedir = $:.find {|x| x =~ /site_ruby/ }
+ if !$sitedir
+ $sitedir = File.join($libdir, "site_ruby")
+ elsif $sitedir !~ Regexp.quote(version)
+ $sitedir = File.join($sitedir, version)
+ end
+end
+
+# the acual gruntwork
+Dir.chdir("lib")
+
+Find.find("active_support", "active_support.rb") { |f|
+ if f[-3..-1] == ".rb"
+ File::install(f, File.join($sitedir, *f.split(/\//)), 0644, true)
+ else
+ File::makedirs(File.join($sitedir, *f.split(/\//)))
+ end
+}

0 comments on commit 8d48826

Please sign in to comment.