Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 7698

Show
Ignore:
Timestamp:
09/30/07 22:53:27 (1 year ago)
Author:
david
Message:

Fixed that installing plugins from SVN repositories that use trunk/ will work (closes #8188) [evan]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/railties/CHANGELOG

    r7685 r7698  
    11*2.0.0 [Preview Release]* (September 29th, 2007) [Includes duplicates of changes from 1.1.4 - 1.2.3] 
     2 
     3* Fixed that installing plugins from SVN repositories that use trunk/ will work #8188 [evan] 
    24 
    35* Moved the SourceAnnotationExtractor to a separate file in case libraries try to load the rails rake tasks twice. [Rick] 
  • trunk/railties/lib/commands/plugin.rb

    r7666 r7698  
    9292      plugin.install 
    9393    else 
    94       puts "plugin not found: #{name_uri_or_plugin}" 
     94      puts "Plugin not found: #{name_uri_or_plugin}" 
    9595    end 
    9696  end 
     
    240240    def install_using_http(options = {}) 
    241241      root = rails_env.root 
    242       mkdir_p "#{root}/vendor/plugins
    243       Dir.chdir "#{root}/vendor/plugins" do 
     242      mkdir_p "#{root}/vendor/plugins/#{@name}
     243      Dir.chdir "#{root}/vendor/plugins/#{@name}" do 
    244244        puts "fetching from '#{uri}'" if $verbose 
    245         fetcher = RecursiveHTTPFetcher.new(uri
     245        fetcher = RecursiveHTTPFetcher.new(uri, -1
    246246        fetcher.quiet = true if options[:quiet] 
    247247        fetcher.fetch 
     
    766766        ::Plugin.find(name).install(install_method, @options) 
    767767      end 
    768     rescue 
     768    rescue StandardError => e 
    769769      puts "Plugin not found: #{args.inspect}" 
     770      puts e.inspect if $verbose 
    770771      exit 1 
    771772    end 
     
    854855class RecursiveHTTPFetcher 
    855856  attr_accessor :quiet 
    856   def initialize(urls_to_fetch, cwd = ".") 
     857  def initialize(urls_to_fetch, level = 1, cwd = ".") 
     858    @level = level 
    857859    @cwd = cwd 
    858860    @urls_to_fetch = urls_to_fetch.to_a 
     
    908910   
    909911  def fetch_dir(url) 
    910     push_d(File.basename(url)) 
     912    @level += 1 
     913    push_d(File.basename(url)) if @level > 0 
    911914    open(url) do |stream| 
    912915      contents =  stream.read 
    913916      fetch(links(url, contents)) 
    914917    end 
    915     pop_d 
     918    pop_d if @level > 0 
     919    @level -= 1 
    916920  end 
    917921end