diff --git a/CHANGELOG b/CHANGELOG index bfbce97b..8f5be5a2 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,6 @@ === Edge +* Fix uninitialized constant Gem::Specification::PLATFORM_CROSS_TARGETS in Rails [Jason Garber] * Allow uppercase letters in ID attribute even though it's invalid [Jason Garber] * Fix compatibility with newer Echoe, by using full-name for Platform [Flameeyes] * Fixes for PPC/PPC64 [Flameeyes] diff --git a/lib/tasks/pureruby.rake b/lib/tasks/pureruby.rake index 1f7a8244..c0565434 100644 --- a/lib/tasks/pureruby.rake +++ b/lib/tasks/pureruby.rake @@ -1,12 +1,17 @@ -Gem::Specification::PLATFORM_CROSS_TARGETS << "pureruby" +# Apparently this file gets loaded by Rails. Only want to define the pureruby +# task in the context of RedCloth compilation (echoe loaded). -task 'pureruby' do - reset_target 'pureruby' -end +if Gem::Specification.const_defined?(:PLATFORM_CROSS_TARGETS) + Gem::Specification::PLATFORM_CROSS_TARGETS << "pureruby" -if target = ARGV.detect do |arg| - # Hack to get the platform set before the Rakefile evaluates - Gem::Specification::PLATFORM_CROSS_TARGETS.include? arg + task 'pureruby' do + reset_target 'pureruby' end - reset_target target -end + + if target = ARGV.detect do |arg| + # Hack to get the platform set before the Rakefile evaluates + Gem::Specification::PLATFORM_CROSS_TARGETS.include? arg + end + reset_target target + end +end \ No newline at end of file