diff options
author | José Valim <jose.valim@gmail.com> | 2009-11-02 23:46:00 -0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2009-11-02 23:46:00 -0200 |
commit | d002826e54415a340e55fdbf363d005faebf8fc5 (patch) | |
tree | 431146dfb0b15c4507fd49bb7d6f18bd40ccf839 /activesupport/Rakefile | |
parent | 9ba83cce0318fa5051764f4a16c286adf30169e2 (diff) | |
parent | 14370e1aab6ddfb5b86cf50bd7e5abcebae0684c (diff) | |
download | rails-d002826e54415a340e55fdbf363d005faebf8fc5.tar.gz rails-d002826e54415a340e55fdbf363d005faebf8fc5.tar.bz2 rails-d002826e54415a340e55fdbf363d005faebf8fc5.zip |
Merge branch 'master' of git://github.com/rails/rails
Diffstat (limited to 'activesupport/Rakefile')
-rw-r--r-- | activesupport/Rakefile | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/activesupport/Rakefile b/activesupport/Rakefile index c27167287d..2ada91830f 100644 --- a/activesupport/Rakefile +++ b/activesupport/Rakefile @@ -49,8 +49,6 @@ spec = eval(File.read('activesupport.gemspec')) Rake::GemPackageTask.new(spec) do |p| p.gem_spec = spec - p.need_tar = true - p.need_zip = true end desc "Publish the beta gem" @@ -61,7 +59,7 @@ task :pgem => [:package] do end desc "Publish the API documentation" -task :pdoc => [:rdoc] do +task :pdoc => [:rdoc] do require 'rake/contrib/sshpublisher' Rake::SshDirPublisher.new("wrath.rubyonrails.org", "public_html/as", "doc").upload end @@ -88,39 +86,39 @@ namespace :tzinfo do Rake::Task['tzinfo:cleanup_tmp'].invoke puts <<-EOV *** FINAL TZINFO BUNDLING STEPS *** - + 1. Update TZInfo version in lib/active_support/vendor.rb 2. gem uninstall tzinfo on local system before running tests, to ensure tests are running against bundled version - + If a test fails because a particular zone can't be found, it's likely because the TZInfo identifier in the ActiveSupport::TimeZone::MAPPING hash is referencing a linked timezone instead of referencing the timezone directly. In this case, just change the MAPPING value to the correct identifier, and unpack TZInfo again. EOV end - + task :unpack_gem do mkdir_p "tmp" cd "tmp" sh "gem unpack --version #{ENV['VERSION'] || "'> 0'"} tzinfo" cd ".." end - + task :copy_classes => :unpack_gem do - mkdir_p "#{destination_path}/tzinfo" - cp "#{tmp_path}/lib/tzinfo.rb", destination_path - comment_requires_for_excluded_classes!('tzinfo.rb') + mkdir_p "#{destination_path}/lib/tzinfo" + cp "#{tmp_path}/lib/tzinfo.rb", "#{destination_path}/lib" + comment_requires_for_excluded_classes!('lib/tzinfo.rb') files = FileList["#{tmp_path}/lib/tzinfo/*.rb"] files.each do |file| filename = File.basename(file) unless excluded_classes.include? filename.sub(/.rb$/, '') - cp "#{tmp_path}/lib/tzinfo/#{filename}", "#{destination_path}/tzinfo" - comment_requires_for_excluded_classes!("tzinfo/#{filename}") + cp "#{tmp_path}/lib/tzinfo/#{filename}", "#{destination_path}/lib/tzinfo" + comment_requires_for_excluded_classes!("lib/tzinfo/#{filename}") end end end - + task :copy_definitions => :unpack_gem do - definitions_path = "#{destination_path}/tzinfo/definitions/" + definitions_path = "#{destination_path}/lib/tzinfo/definitions/" mkdir_p definitions_path ActiveSupport::TimeZone::MAPPING.values.each do |zone| subdir = nil @@ -135,11 +133,11 @@ namespace :tzinfo do task :cleanup_tmp do rm_rf "tmp" end - + def comment_requires_for_excluded_classes!(file) lines = open("#{destination_path}/#{file}") {|f| f.readlines} updated = false - + new_lines = [] lines.each do |line| if Regexp.new("require 'tzinfo/(#{excluded_classes.join('|')})'") === line @@ -149,29 +147,29 @@ namespace :tzinfo do new_lines << line end end - + if updated open("#{destination_path}/#{file}", "w") {|f| f.write(new_lines.join)} end end - + def version ENV['VERSION'] ||= get_unpacked_version end - + def get_unpacked_version m = (FileList["tmp/tzinfo-*"].to_s.match /\d+\.\d+\.\d+/) m ? m[0] : raise(LoadError, "TZInfo gem must be installed locally. `gem install tzinfo` and try again") end - + def tmp_path "tmp/tzinfo-#{version}" end - + def destination_path "lib/active_support/vendor/tzinfo-#{version}" end - + def excluded_classes %w(country country_index_definition country_info country_timezone timezone_index_definition timezone_proxy tzdataparser) end |