T
Trans
Hi---
When using the GemPackageTask, one has to build the GemSpec in order
to define the task. For a large project and/or slow machine this
actualy can take a second or so. So everytime I run "rake -T" there's
a very noticable delay (not to mention wasted CPU cycles). Not sure
what other solutions there might be, but one is to have GemPackageTask
accept the parameters that will build the GemSpec when needed, but not
before. So, instead of
spec = Gem::Specification.new do |s|
s.platform = Gem:latform::RUBY
s.summary = "Ruby based make-like utility."
s.name = 'rake'
s.files = FileList.new('**/*').to_a
...
end
Rake::GemPackageTask.new(spec) do |pkg|
pkg.need_zip = true
pkg.need_tar = true
end
It could be:
Rake::GemPackageTask.new do |pkg|
pkg.platform = 'ruby'
pkg.summary = "Ruby based make-like utility."
pkg.name = 'rake'
pkg.files.include '**/*'
pkg.need_zip = true
pkg.need_tar = true
end
Note the difference in 'platform' and more importantly 'files'. The
GemPackageTask would work those out and build the GemSpec at runtime
rather then definition time.
Thanks,
T.
When using the GemPackageTask, one has to build the GemSpec in order
to define the task. For a large project and/or slow machine this
actualy can take a second or so. So everytime I run "rake -T" there's
a very noticable delay (not to mention wasted CPU cycles). Not sure
what other solutions there might be, but one is to have GemPackageTask
accept the parameters that will build the GemSpec when needed, but not
before. So, instead of
spec = Gem::Specification.new do |s|
s.platform = Gem:latform::RUBY
s.summary = "Ruby based make-like utility."
s.name = 'rake'
s.files = FileList.new('**/*').to_a
...
end
Rake::GemPackageTask.new(spec) do |pkg|
pkg.need_zip = true
pkg.need_tar = true
end
It could be:
Rake::GemPackageTask.new do |pkg|
pkg.platform = 'ruby'
pkg.summary = "Ruby based make-like utility."
pkg.name = 'rake'
pkg.files.include '**/*'
pkg.need_zip = true
pkg.need_tar = true
end
Note the difference in 'platform' and more importantly 'files'. The
GemPackageTask would work those out and build the GemSpec at runtime
rather then definition time.
Thanks,
T.