diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2007-09-30 22:53:27 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2007-09-30 22:53:27 +0000 |
commit | 00cecf83b5a3303d9b879746fdcc3405cf834974 (patch) | |
tree | 31e5cf1b319365ebd31e6bc8e9a5e0f56add1274 | |
parent | 7275d2749cb829d89bffe7e6aa87c99084351f6a (diff) | |
download | rails-00cecf83b5a3303d9b879746fdcc3405cf834974.tar.gz rails-00cecf83b5a3303d9b879746fdcc3405cf834974.tar.bz2 rails-00cecf83b5a3303d9b879746fdcc3405cf834974.zip |
Fixed that installing plugins from SVN repositories that use trunk/ will work (closes #8188) [evan]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7698 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r-- | railties/CHANGELOG | 2 | ||||
-rw-r--r-- | railties/lib/commands/plugin.rb | 20 |
2 files changed, 14 insertions, 8 deletions
diff --git a/railties/CHANGELOG b/railties/CHANGELOG index 0a26159fbf..3f24ca8a01 100644 --- a/railties/CHANGELOG +++ b/railties/CHANGELOG @@ -1,5 +1,7 @@ *2.0.0 [Preview Release]* (September 29th, 2007) [Includes duplicates of changes from 1.1.4 - 1.2.3] +* Fixed that installing plugins from SVN repositories that use trunk/ will work #8188 [evan] + * Moved the SourceAnnotationExtractor to a separate file in case libraries try to load the rails rake tasks twice. [Rick] * Moved Dispatcher to ActionController::Dispatcher. [Jeremy Kemper] diff --git a/railties/lib/commands/plugin.rb b/railties/lib/commands/plugin.rb index b0d1d50600..014b268635 100644 --- a/railties/lib/commands/plugin.rb +++ b/railties/lib/commands/plugin.rb @@ -91,7 +91,7 @@ class RailsEnvironment unless plugin.nil? plugin.install else - puts "plugin not found: #{name_uri_or_plugin}" + puts "Plugin not found: #{name_uri_or_plugin}" end end @@ -239,10 +239,10 @@ class Plugin def install_using_http(options = {}) root = rails_env.root - mkdir_p "#{root}/vendor/plugins" - Dir.chdir "#{root}/vendor/plugins" do + mkdir_p "#{root}/vendor/plugins/#{@name}" + Dir.chdir "#{root}/vendor/plugins/#{@name}" do puts "fetching from '#{uri}'" if $verbose - fetcher = RecursiveHTTPFetcher.new(uri) + fetcher = RecursiveHTTPFetcher.new(uri, -1) fetcher.quiet = true if options[:quiet] fetcher.fetch end @@ -765,8 +765,9 @@ module Commands args.each do |name| ::Plugin.find(name).install(install_method, @options) end - rescue + rescue StandardError => e puts "Plugin not found: #{args.inspect}" + puts e.inspect if $verbose exit 1 end end @@ -853,7 +854,8 @@ end class RecursiveHTTPFetcher attr_accessor :quiet - def initialize(urls_to_fetch, cwd = ".") + def initialize(urls_to_fetch, level = 1, cwd = ".") + @level = level @cwd = cwd @urls_to_fetch = urls_to_fetch.to_a @quiet = false @@ -907,12 +909,14 @@ class RecursiveHTTPFetcher end def fetch_dir(url) - push_d(File.basename(url)) + @level += 1 + push_d(File.basename(url)) if @level > 0 open(url) do |stream| contents = stream.read fetch(links(url, contents)) end - pop_d + pop_d if @level > 0 + @level -= 1 end end |