Skip to content

Commit

Permalink
We won't be publishing tars and zips anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
josh committed Oct 16, 2009
1 parent a565c19 commit 6094e65
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 38 deletions.
6 changes: 2 additions & 4 deletions actionmailer/Rakefile
Expand Up @@ -50,19 +50,17 @@ spec = eval(File.read('actionmailer.gemspec'))


Rake::GemPackageTask.new(spec) do |p| Rake::GemPackageTask.new(spec) do |p|
p.gem_spec = spec p.gem_spec = spec
p.need_tar = true
p.need_zip = true
end end


desc "Publish the API documentation" desc "Publish the API documentation"
task :pgem => [:package] do task :pgem => [:package] do
require 'rake/contrib/sshpublisher' require 'rake/contrib/sshpublisher'
Rake::SshFilePublisher.new("gems.rubyonrails.org", "/u/sites/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload Rake::SshFilePublisher.new("gems.rubyonrails.org", "/u/sites/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload
`ssh gems.rubyonrails.org '/u/sites/gems/gemupdate.sh'` `ssh gems.rubyonrails.org '/u/sites/gems/gemupdate.sh'`
end end


desc "Publish the API documentation" desc "Publish the API documentation"
task :pdoc => [:rdoc] do task :pdoc => [:rdoc] do
require 'rake/contrib/sshpublisher' require 'rake/contrib/sshpublisher'
Rake::SshDirPublisher.new("wrath.rubyonrails.org", "public_html/am", "doc").upload Rake::SshDirPublisher.new("wrath.rubyonrails.org", "public_html/am", "doc").upload
end end
Expand Down
12 changes: 5 additions & 7 deletions actionpack/Rakefile
Expand Up @@ -56,7 +56,7 @@ Rake::RDocTask.new { |rdoc|
rdoc.options << '--line-numbers' << '--inline-source' rdoc.options << '--line-numbers' << '--inline-source'
rdoc.options << '--charset' << 'utf-8' rdoc.options << '--charset' << 'utf-8'
rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo' rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo'
if ENV['DOC_FILES'] if ENV['DOC_FILES']
rdoc.rdoc_files.include(ENV['DOC_FILES'].split(/,\s*/)) rdoc.rdoc_files.include(ENV['DOC_FILES'].split(/,\s*/))
else else
rdoc.rdoc_files.include('README', 'RUNNING_UNIT_TESTS', 'CHANGELOG') rdoc.rdoc_files.include('README', 'RUNNING_UNIT_TESTS', 'CHANGELOG')
Expand All @@ -70,8 +70,6 @@ spec = eval(File.read('actionpack.gemspec'))


Rake::GemPackageTask.new(spec) do |p| Rake::GemPackageTask.new(spec) do |p|
p.gem_spec = spec p.gem_spec = spec
p.need_tar = true
p.need_zip = true
end end


task :lines do task :lines do
Expand All @@ -88,10 +86,10 @@ task :lines do
codelines += 1 codelines += 1
end end
puts "L: #{sprintf("%4d", lines)}, LOC #{sprintf("%4d", codelines)} | #{file_name}" puts "L: #{sprintf("%4d", lines)}, LOC #{sprintf("%4d", codelines)} | #{file_name}"

total_lines += lines total_lines += lines
total_codelines += codelines total_codelines += codelines

lines, codelines = 0, 0 lines, codelines = 0, 0
end end


Expand All @@ -112,14 +110,14 @@ task :update_js => [ :update_scriptaculous ]
# Publishing ------------------------------------------------------ # Publishing ------------------------------------------------------


desc "Publish the API documentation" desc "Publish the API documentation"
task :pgem => [:package] do task :pgem => [:package] do
require 'rake/contrib/sshpublisher' require 'rake/contrib/sshpublisher'
Rake::SshFilePublisher.new("gems.rubyonrails.org", "/u/sites/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload Rake::SshFilePublisher.new("gems.rubyonrails.org", "/u/sites/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload
`ssh gems.rubyonrails.org '/u/sites/gems/gemupdate.sh'` `ssh gems.rubyonrails.org '/u/sites/gems/gemupdate.sh'`
end end


desc "Publish the API documentation" desc "Publish the API documentation"
task :pdoc => [:rdoc] do task :pdoc => [:rdoc] do
require 'rake/contrib/sshpublisher' require 'rake/contrib/sshpublisher'
Rake::SshDirPublisher.new("wrath.rubyonrails.org", "public_html/ap", "doc").upload Rake::SshDirPublisher.new("wrath.rubyonrails.org", "public_html/ap", "doc").upload
end end
Expand Down
4 changes: 1 addition & 3 deletions activemodel/Rakefile
Expand Up @@ -11,7 +11,7 @@ require 'rake/testtask'


task :default => :test task :default => :test


Rake::TestTask.new do |t| Rake::TestTask.new do |t|
t.libs << "test" t.libs << "test"
t.test_files = Dir.glob("test/cases/**/*_test.rb").sort t.test_files = Dir.glob("test/cases/**/*_test.rb").sort
t.verbose = true t.verbose = true
Expand Down Expand Up @@ -47,6 +47,4 @@ spec = eval(File.read('activemodel.gemspec'))


Rake::GemPackageTask.new(spec) do |p| Rake::GemPackageTask.new(spec) do |p|
p.gem_spec = spec p.gem_spec = spec
p.need_tar = true
p.need_zip = true
end end
2 changes: 0 additions & 2 deletions activerecord/Rakefile
Expand Up @@ -195,8 +195,6 @@ spec = eval(File.read('activerecord.gemspec'))


Rake::GemPackageTask.new(spec) do |p| Rake::GemPackageTask.new(spec) do |p|
p.gem_spec = spec p.gem_spec = spec
p.need_tar = true
p.need_zip = true
end end


task :lines do task :lines do
Expand Down
10 changes: 4 additions & 6 deletions activeresource/Rakefile
Expand Up @@ -62,8 +62,6 @@ spec = eval(File.read('activeresource.gemspec'))


Rake::GemPackageTask.new(spec) do |p| Rake::GemPackageTask.new(spec) do |p|
p.gem_spec = spec p.gem_spec = spec
p.need_tar = true
p.need_zip = true
end end


task :lines do task :lines do
Expand All @@ -80,10 +78,10 @@ task :lines do
codelines += 1 codelines += 1
end end
puts "L: #{sprintf("%4d", lines)}, LOC #{sprintf("%4d", codelines)} | #{file_name}" puts "L: #{sprintf("%4d", lines)}, LOC #{sprintf("%4d", codelines)} | #{file_name}"

total_lines += lines total_lines += lines
total_codelines += codelines total_codelines += codelines

lines, codelines = 0, 0 lines, codelines = 0, 0
end end


Expand All @@ -94,14 +92,14 @@ end
# Publishing ------------------------------------------------------ # Publishing ------------------------------------------------------


desc "Publish the beta gem" desc "Publish the beta gem"
task :pgem => [:package] do task :pgem => [:package] do
require 'rake/contrib/sshpublisher' require 'rake/contrib/sshpublisher'
Rake::SshFilePublisher.new("gems.rubyonrails.org", "/u/sites/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload Rake::SshFilePublisher.new("gems.rubyonrails.org", "/u/sites/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload
`ssh gems.rubyonrails.org '/u/sites/gems/gemupdate.sh'` `ssh gems.rubyonrails.org '/u/sites/gems/gemupdate.sh'`
end end


desc "Publish the API documentation" desc "Publish the API documentation"
task :pdoc => [:rdoc] do task :pdoc => [:rdoc] do
require 'rake/contrib/sshpublisher' require 'rake/contrib/sshpublisher'
Rake::SshDirPublisher.new("wrath.rubyonrails.org", "public_html/ar", "doc").upload Rake::SshDirPublisher.new("wrath.rubyonrails.org", "public_html/ar", "doc").upload
end end
Expand Down
30 changes: 14 additions & 16 deletions activesupport/Rakefile
Expand Up @@ -49,8 +49,6 @@ spec = eval(File.read('activesupport.gemspec'))


Rake::GemPackageTask.new(spec) do |p| Rake::GemPackageTask.new(spec) do |p|
p.gem_spec = spec p.gem_spec = spec
p.need_tar = true
p.need_zip = true
end end


desc "Publish the beta gem" desc "Publish the beta gem"
Expand All @@ -61,7 +59,7 @@ task :pgem => [:package] do
end end


desc "Publish the API documentation" desc "Publish the API documentation"
task :pdoc => [:rdoc] do task :pdoc => [:rdoc] do
require 'rake/contrib/sshpublisher' require 'rake/contrib/sshpublisher'
Rake::SshDirPublisher.new("wrath.rubyonrails.org", "public_html/as", "doc").upload Rake::SshDirPublisher.new("wrath.rubyonrails.org", "public_html/as", "doc").upload
end end
Expand All @@ -88,23 +86,23 @@ namespace :tzinfo do
Rake::Task['tzinfo:cleanup_tmp'].invoke Rake::Task['tzinfo:cleanup_tmp'].invoke
puts <<-EOV puts <<-EOV
*** FINAL TZINFO BUNDLING STEPS *** *** FINAL TZINFO BUNDLING STEPS ***
1. Update TZInfo version in lib/active_support/vendor.rb 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 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 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. 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. In this case, just change the MAPPING value to the correct identifier, and unpack TZInfo again.
EOV EOV
end end

task :unpack_gem do task :unpack_gem do
mkdir_p "tmp" mkdir_p "tmp"
cd "tmp" cd "tmp"
sh "gem unpack --version #{ENV['VERSION'] || "'> 0'"} tzinfo" sh "gem unpack --version #{ENV['VERSION'] || "'> 0'"} tzinfo"
cd ".." cd ".."
end end

task :copy_classes => :unpack_gem do task :copy_classes => :unpack_gem do
mkdir_p "#{destination_path}/tzinfo" mkdir_p "#{destination_path}/tzinfo"
cp "#{tmp_path}/lib/tzinfo.rb", destination_path cp "#{tmp_path}/lib/tzinfo.rb", destination_path
Expand All @@ -118,7 +116,7 @@ namespace :tzinfo do
end end
end end
end end

task :copy_definitions => :unpack_gem do task :copy_definitions => :unpack_gem do
definitions_path = "#{destination_path}/tzinfo/definitions/" definitions_path = "#{destination_path}/tzinfo/definitions/"
mkdir_p definitions_path mkdir_p definitions_path
Expand All @@ -135,11 +133,11 @@ namespace :tzinfo do
task :cleanup_tmp do task :cleanup_tmp do
rm_rf "tmp" rm_rf "tmp"
end end

def comment_requires_for_excluded_classes!(file) def comment_requires_for_excluded_classes!(file)
lines = open("#{destination_path}/#{file}") {|f| f.readlines} lines = open("#{destination_path}/#{file}") {|f| f.readlines}
updated = false updated = false

new_lines = [] new_lines = []
lines.each do |line| lines.each do |line|
if Regexp.new("require 'tzinfo/(#{excluded_classes.join('|')})'") === line if Regexp.new("require 'tzinfo/(#{excluded_classes.join('|')})'") === line
Expand All @@ -149,29 +147,29 @@ namespace :tzinfo do
new_lines << line new_lines << line
end end
end end

if updated if updated
open("#{destination_path}/#{file}", "w") {|f| f.write(new_lines.join)} open("#{destination_path}/#{file}", "w") {|f| f.write(new_lines.join)}
end end
end end

def version def version
ENV['VERSION'] ||= get_unpacked_version ENV['VERSION'] ||= get_unpacked_version
end end

def get_unpacked_version def get_unpacked_version
m = (FileList["tmp/tzinfo-*"].to_s.match /\d+\.\d+\.\d+/) 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") m ? m[0] : raise(LoadError, "TZInfo gem must be installed locally. `gem install tzinfo` and try again")
end end

def tmp_path def tmp_path
"tmp/tzinfo-#{version}" "tmp/tzinfo-#{version}"
end end

def destination_path def destination_path
"lib/active_support/vendor/tzinfo-#{version}" "lib/active_support/vendor/tzinfo-#{version}"
end end

def excluded_classes def excluded_classes
%w(country country_index_definition country_info country_timezone timezone_index_definition timezone_proxy tzdataparser) %w(country country_index_definition country_info country_timezone timezone_index_definition timezone_proxy tzdataparser)
end end
Expand Down

0 comments on commit 6094e65

Please sign in to comment.