2008-03-29 22:17:28 -04:00
|
|
|
desc "List the gems that this rails application depends on"
|
2008-05-31 19:36:34 -04:00
|
|
|
task :gems => 'gems:base' do
|
2008-03-29 22:17:28 -04:00
|
|
|
Rails.configuration.gems.each do |gem|
|
Fix a number of errors in the config.gem mechanism.
* Rails::GemDependency was missing definitions for hash and eql?, causing Array#uniq to not work.
* If several versions of a gem are unpacked in vendor, now chooses the highest if no version is specified.
* streamlined add_load_path. Now sets up Rubygems correctly to allow 'gem' to find frozen gems, with
gems frozen to vendor/gems and specifications in vendor/gems/<gem-name>/.specification
* Rails::GemDependency#specification would return a spec for the highest installed version, even for
frozen gems and/or previously loaded lower versions. See in part ticket #1123.
* removed vendor from default_load_paths - it was causing autoloading to append Gems::Gems::<gem-dir> to
constant names
* added additional tests for loading frozen gems.
* incorporates the fix from #1107 for vendor rails
* defers to freeze:gems for handling the Rails framework. gems:unpack WILL NOT place a copy of Rails
in vendor/gems. Should close #1123 completely.
* incorporates, via using the gem loader for frozen gems, fixes corresponding to #227, #324, #362, #527, and #742.
* gem plugins now work the same whether frozen or not. Correctness of the behavior is a matter for another ticket...
Signed-off-by: rick <technoweenie@gmail.com>
2008-10-04 13:51:23 -04:00
|
|
|
print_gem_status(gem)
|
2008-03-29 22:17:28 -04:00
|
|
|
end
|
2008-04-08 00:21:32 -04:00
|
|
|
puts
|
|
|
|
puts "I = Installed"
|
|
|
|
puts "F = Frozen"
|
2008-03-29 22:17:28 -04:00
|
|
|
end
|
|
|
|
|
Fix a number of errors in the config.gem mechanism.
* Rails::GemDependency was missing definitions for hash and eql?, causing Array#uniq to not work.
* If several versions of a gem are unpacked in vendor, now chooses the highest if no version is specified.
* streamlined add_load_path. Now sets up Rubygems correctly to allow 'gem' to find frozen gems, with
gems frozen to vendor/gems and specifications in vendor/gems/<gem-name>/.specification
* Rails::GemDependency#specification would return a spec for the highest installed version, even for
frozen gems and/or previously loaded lower versions. See in part ticket #1123.
* removed vendor from default_load_paths - it was causing autoloading to append Gems::Gems::<gem-dir> to
constant names
* added additional tests for loading frozen gems.
* incorporates the fix from #1107 for vendor rails
* defers to freeze:gems for handling the Rails framework. gems:unpack WILL NOT place a copy of Rails
in vendor/gems. Should close #1123 completely.
* incorporates, via using the gem loader for frozen gems, fixes corresponding to #227, #324, #362, #527, and #742.
* gem plugins now work the same whether frozen or not. Correctness of the behavior is a matter for another ticket...
Signed-off-by: rick <technoweenie@gmail.com>
2008-10-04 13:51:23 -04:00
|
|
|
def print_gem_status(gem, indent=1)
|
|
|
|
code = gem.loaded? ? (gem.frozen? ? "F" : "I") : " "
|
|
|
|
puts " "*(indent-1)+" - [#{code}] #{gem.name} #{gem.requirement.to_s}"
|
|
|
|
gem.dependencies.each { |g| print_gem_status(g, indent+1)}
|
|
|
|
end
|
|
|
|
|
2008-03-29 22:17:28 -04:00
|
|
|
namespace :gems do
|
2008-05-31 19:36:34 -04:00
|
|
|
task :base do
|
|
|
|
$rails_gem_installer = true
|
|
|
|
Rake::Task[:environment].invoke
|
|
|
|
end
|
|
|
|
|
2008-04-02 13:48:30 -04:00
|
|
|
desc "Build any native extensions for unpacked gems"
|
|
|
|
task :build do
|
2008-05-31 19:36:34 -04:00
|
|
|
$rails_gem_installer = true
|
2008-04-08 00:21:32 -04:00
|
|
|
require 'rails/gem_builder'
|
Fix a number of errors in the config.gem mechanism.
* Rails::GemDependency was missing definitions for hash and eql?, causing Array#uniq to not work.
* If several versions of a gem are unpacked in vendor, now chooses the highest if no version is specified.
* streamlined add_load_path. Now sets up Rubygems correctly to allow 'gem' to find frozen gems, with
gems frozen to vendor/gems and specifications in vendor/gems/<gem-name>/.specification
* Rails::GemDependency#specification would return a spec for the highest installed version, even for
frozen gems and/or previously loaded lower versions. See in part ticket #1123.
* removed vendor from default_load_paths - it was causing autoloading to append Gems::Gems::<gem-dir> to
constant names
* added additional tests for loading frozen gems.
* incorporates the fix from #1107 for vendor rails
* defers to freeze:gems for handling the Rails framework. gems:unpack WILL NOT place a copy of Rails
in vendor/gems. Should close #1123 completely.
* incorporates, via using the gem loader for frozen gems, fixes corresponding to #227, #324, #362, #527, and #742.
* gem plugins now work the same whether frozen or not. Correctness of the behavior is a matter for another ticket...
Signed-off-by: rick <technoweenie@gmail.com>
2008-10-04 13:51:23 -04:00
|
|
|
Dir[File.join(Rails::GemDependency.unpacked_path, '*')].each do |gem_dir|
|
2008-04-02 13:48:30 -04:00
|
|
|
spec_file = File.join(gem_dir, '.specification')
|
|
|
|
next unless File.exists?(spec_file)
|
|
|
|
specification = YAML::load_file(spec_file)
|
|
|
|
next unless ENV['GEM'].blank? || ENV['GEM'] == specification.name
|
|
|
|
Rails::GemBuilder.new(specification, gem_dir).build_extensions
|
|
|
|
puts "Built gem: '#{gem_dir}'"
|
|
|
|
end
|
|
|
|
end
|
Fix a number of errors in the config.gem mechanism.
* Rails::GemDependency was missing definitions for hash and eql?, causing Array#uniq to not work.
* If several versions of a gem are unpacked in vendor, now chooses the highest if no version is specified.
* streamlined add_load_path. Now sets up Rubygems correctly to allow 'gem' to find frozen gems, with
gems frozen to vendor/gems and specifications in vendor/gems/<gem-name>/.specification
* Rails::GemDependency#specification would return a spec for the highest installed version, even for
frozen gems and/or previously loaded lower versions. See in part ticket #1123.
* removed vendor from default_load_paths - it was causing autoloading to append Gems::Gems::<gem-dir> to
constant names
* added additional tests for loading frozen gems.
* incorporates the fix from #1107 for vendor rails
* defers to freeze:gems for handling the Rails framework. gems:unpack WILL NOT place a copy of Rails
in vendor/gems. Should close #1123 completely.
* incorporates, via using the gem loader for frozen gems, fixes corresponding to #227, #324, #362, #527, and #742.
* gem plugins now work the same whether frozen or not. Correctness of the behavior is a matter for another ticket...
Signed-off-by: rick <technoweenie@gmail.com>
2008-10-04 13:51:23 -04:00
|
|
|
|
2008-03-29 22:17:28 -04:00
|
|
|
desc "Installs all required gems for this application."
|
2008-05-31 19:36:34 -04:00
|
|
|
task :install => :base do
|
2008-03-29 22:17:28 -04:00
|
|
|
require 'rubygems'
|
|
|
|
require 'rubygems/gem_runner'
|
|
|
|
Rails.configuration.gems.each { |gem| gem.install unless gem.loaded? }
|
|
|
|
end
|
|
|
|
|
|
|
|
desc "Unpacks the specified gem into vendor/gems."
|
2008-05-31 19:36:34 -04:00
|
|
|
task :unpack => :base do
|
2008-03-29 22:17:28 -04:00
|
|
|
require 'rubygems'
|
|
|
|
require 'rubygems/gem_runner'
|
2008-04-02 13:48:30 -04:00
|
|
|
Rails.configuration.gems.each do |gem|
|
2008-04-08 00:21:32 -04:00
|
|
|
next unless !gem.frozen? && (ENV['GEM'].blank? || ENV['GEM'] == gem.name)
|
Fix a number of errors in the config.gem mechanism.
* Rails::GemDependency was missing definitions for hash and eql?, causing Array#uniq to not work.
* If several versions of a gem are unpacked in vendor, now chooses the highest if no version is specified.
* streamlined add_load_path. Now sets up Rubygems correctly to allow 'gem' to find frozen gems, with
gems frozen to vendor/gems and specifications in vendor/gems/<gem-name>/.specification
* Rails::GemDependency#specification would return a spec for the highest installed version, even for
frozen gems and/or previously loaded lower versions. See in part ticket #1123.
* removed vendor from default_load_paths - it was causing autoloading to append Gems::Gems::<gem-dir> to
constant names
* added additional tests for loading frozen gems.
* incorporates the fix from #1107 for vendor rails
* defers to freeze:gems for handling the Rails framework. gems:unpack WILL NOT place a copy of Rails
in vendor/gems. Should close #1123 completely.
* incorporates, via using the gem loader for frozen gems, fixes corresponding to #227, #324, #362, #527, and #742.
* gem plugins now work the same whether frozen or not. Correctness of the behavior is a matter for another ticket...
Signed-off-by: rick <technoweenie@gmail.com>
2008-10-04 13:51:23 -04:00
|
|
|
gem.unpack_to(Rails::GemDependency.unpacked_path) if gem.loaded?
|
2008-03-29 22:17:28 -04:00
|
|
|
end
|
|
|
|
end
|
Fix a number of errors in the config.gem mechanism.
* Rails::GemDependency was missing definitions for hash and eql?, causing Array#uniq to not work.
* If several versions of a gem are unpacked in vendor, now chooses the highest if no version is specified.
* streamlined add_load_path. Now sets up Rubygems correctly to allow 'gem' to find frozen gems, with
gems frozen to vendor/gems and specifications in vendor/gems/<gem-name>/.specification
* Rails::GemDependency#specification would return a spec for the highest installed version, even for
frozen gems and/or previously loaded lower versions. See in part ticket #1123.
* removed vendor from default_load_paths - it was causing autoloading to append Gems::Gems::<gem-dir> to
constant names
* added additional tests for loading frozen gems.
* incorporates the fix from #1107 for vendor rails
* defers to freeze:gems for handling the Rails framework. gems:unpack WILL NOT place a copy of Rails
in vendor/gems. Should close #1123 completely.
* incorporates, via using the gem loader for frozen gems, fixes corresponding to #227, #324, #362, #527, and #742.
* gem plugins now work the same whether frozen or not. Correctness of the behavior is a matter for another ticket...
Signed-off-by: rick <technoweenie@gmail.com>
2008-10-04 13:51:23 -04:00
|
|
|
|
2008-04-11 18:25:11 -04:00
|
|
|
namespace :unpack do
|
|
|
|
desc "Unpacks the specified gems and its dependencies into vendor/gems"
|
|
|
|
task :dependencies => :unpack do
|
|
|
|
require 'rubygems'
|
|
|
|
require 'rubygems/gem_runner'
|
|
|
|
Rails.configuration.gems.each do |gem|
|
|
|
|
next unless ENV['GEM'].blank? || ENV['GEM'] == gem.name
|
|
|
|
gem.dependencies.each do |dependency|
|
|
|
|
next if dependency.frozen?
|
Fix a number of errors in the config.gem mechanism.
* Rails::GemDependency was missing definitions for hash and eql?, causing Array#uniq to not work.
* If several versions of a gem are unpacked in vendor, now chooses the highest if no version is specified.
* streamlined add_load_path. Now sets up Rubygems correctly to allow 'gem' to find frozen gems, with
gems frozen to vendor/gems and specifications in vendor/gems/<gem-name>/.specification
* Rails::GemDependency#specification would return a spec for the highest installed version, even for
frozen gems and/or previously loaded lower versions. See in part ticket #1123.
* removed vendor from default_load_paths - it was causing autoloading to append Gems::Gems::<gem-dir> to
constant names
* added additional tests for loading frozen gems.
* incorporates the fix from #1107 for vendor rails
* defers to freeze:gems for handling the Rails framework. gems:unpack WILL NOT place a copy of Rails
in vendor/gems. Should close #1123 completely.
* incorporates, via using the gem loader for frozen gems, fixes corresponding to #227, #324, #362, #527, and #742.
* gem plugins now work the same whether frozen or not. Correctness of the behavior is a matter for another ticket...
Signed-off-by: rick <technoweenie@gmail.com>
2008-10-04 13:51:23 -04:00
|
|
|
dependency.unpack_to(Rails::GemDependency.unpacked_path)
|
2008-04-11 18:25:11 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2008-03-29 22:17:28 -04:00
|
|
|
end
|