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

Ticket #10034: piston_support.diff

File piston_support.diff, 1.2 kB (added by brainopia, 8 months ago)
  • railties/lib/commands/plugin.rb

    old new  
    162162    @uri =~ /svn(?:\+ssh)?:\/\/*/ 
    163163  end 
    164164   
    165   def installed
     165  def plugin_folder_exist
    166166    File.directory?("#{rails_env.root}/vendor/plugins/#{name}") \ 
    167167      or rails_env.externals.detect{ |name, repo| self.uri == repo } 
    168168  end 
    169    
     169 
     170  def under_piston_control? 
     171    return false unless rails_env.use_svn? 
     172    ext = `svn propget piston:root "#{rails_env.root}/vendor/plugins/#{name}"` 
     173    !ext.empty? 
     174  end 
     175 
     176  def installed? 
     177    plugin_folder_exist? && !under_piston_control? 
     178  end 
     179 
    170180  def install(method=nil, options = {}) 
    171181    method ||= rails_env.best_install_method? 
    172182    method   = :export if method == :http and svn_url? 
     
    174184    uninstall if installed? and options[:force] 
    175185 
    176186    unless installed? 
    177       send("install_using_#{method}", options) 
     187      send("install_using_#{method}", options) unless under_piston_control? 
    178188      run_install_hook 
    179189    else 
    180190      puts "already installed: #{name} (#{uri}).  pass --force to reinstall"