diff options
-rw-r--r-- | railties/CHANGELOG | 2 | ||||
-rw-r--r-- | railties/lib/tasks/framework.rake | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/railties/CHANGELOG b/railties/CHANGELOG index d0faa1f0a7..719148791c 100644 --- a/railties/CHANGELOG +++ b/railties/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Fix freeze_gems so that the latest rails version is dumped by default. [Nicholas Seckar] + * script/plugin: handle root paths and plugin names which contain spaces. #2995 [justin@aspect.net] * Model generator: correct relative path to test_helper in unit test. [Jeremy Kemper] diff --git a/railties/lib/tasks/framework.rake b/railties/lib/tasks/framework.rake index 37452a37b1..59f8f51381 100644 --- a/railties/lib/tasks/framework.rake +++ b/railties/lib/tasks/framework.rake @@ -8,6 +8,7 @@ task :freeze_gems do else Gem.cache.search('rails').sort_by { |g| g.version }.last end + version ||= rails.version unless rails puts "No rails gem #{version} is installed. Do 'gem list rails' to see what you have available." @@ -21,8 +22,8 @@ task :freeze_gems do rails.dependencies.select { |g| deps.include? g.name }.each do |g| system "cd vendor/rails; gem unpack -v '#{g.version_requirements}' #{g.name}; mv #{g.name}* #{g.name}" end - system "cd vendor/rails; gem unpack -v '= #{version}' rails" - + system "cd vendor/rails; gem unpack -v '=#{version}' rails" + FileUtils.mv(Dir.glob("vendor/rails/rails*").first, "vendor/rails/railties") end |