public
Fork of rails/rails
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/josh/rails.git
Search Repo:
Enhances plugin#discover allowing it to discover svn:// like URIs (closes 
#4565) [ruben.nine@gmail.com]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4186 
5ecf4fe2-1ee6-0310-87b1-e25e094e27de
technoweenie (author)
Thu Apr 06 08:31:41 -0700 2006
commit  9935a3561e0bc9f356b8c0213cec65fc853fd7d6
tree    66c9e9c23b8c37603ab996d1a95ee808d4f75a68
parent  52d298a8bd5800d9149b0b288bd8a929110b5260
...
1
2
 
 
3
4
5
...
1
2
3
4
5
6
7
0
@@ -1,5 +1,7 @@
0
 *1.1.1* (April 6th, 2005)
0
 
0
+* Enhances plugin#discover allowing it to discover svn:// like URIs (closes #4565) [ruben.nine@gmail.com]
0
+
0
 * Update to Prototype 1.5.0_rc0 [Sam Stephenson]
0
 
0
 * Fixed that the -r/--ruby path option of the rails command was not being respected #4549 [ryan.raaum@gmail.com]
...
31
32
33
34
 
35
36
37
...
107
108
109
110
 
111
112
113
...
161
162
163
 
164
165
166
...
655
656
657
658
 
659
660
661
...
813
814
815
816
817
818
 
 
 
 
 
 
 
819
820
821
...
31
32
33
 
34
35
36
37
...
107
108
109
 
110
111
112
113
...
161
162
163
164
165
166
167
...
656
657
658
 
659
660
661
662
...
814
815
816
 
 
 
817
818
819
820
821
822
823
824
825
826
0
@@ -31,7 +31,7 @@
0
 # look like subversion repositories with plugins:
0
 # http://wiki.rubyonrails.org/rails/pages/Plugins
0
 #
0
-# * Unless you specify that you want to use svn, script/plugin uses plain ole
0
+# * Unless you specify that you want to use svn, script/plugin uses plain old
0
 # HTTP for downloads. The following bullets are true if you specify
0
 # that you want to use svn.
0
 #
0
@@ -107,7 +107,7 @@ class RailsEnvironment
0
 
0
   def use_checkout?
0
     # this is a bit of a guess. we assume that if the rails environment
0
- # is under subversion than they probably want the plugin checked out
0
+ # is under subversion then they probably want the plugin checked out
0
     # instead of exported. This can be overridden on the command line
0
     File.directory?("#{root}/.svn")
0
   end
0
@@ -161,6 +161,7 @@ class Plugin
0
   
0
   def install(method=nil, options = {})
0
     method ||= rails_env.best_install_method?
0
+ method = :export if method == :http and @uri =~ /svn:\/\/*/
0
 
0
     uninstall if installed? and options[:force]
0
 
0
@@ -655,7 +656,7 @@ module Commands
0
       puts "Scraping #{uri}" if $verbose
0
       dupes = []
0
       content = open(uri).each do |line|
0
- if line =~ /<a[^>]*href=['"]([^'"]*)['"]/
0
+ if line =~ /<a[^>]*href=['"]([^'"]*)['"]/ or line =~ /(svn:\/\/[^<|\n]*)/
0
           uri = $1
0
           if uri =~ /\/plugins\// and uri !~ /\/browser\//
0
             uri = extract_repository_uri(uri)
0
@@ -813,9 +814,13 @@ class RecursiveHTTPFetcher
0
 
0
   def ls
0
     @urls_to_fetch.collect do |url|
0
- open(url) do |stream|
0
- links("", stream.read)
0
- end rescue nil
0
+ if url =~ /^svn:\/\/.*/
0
+ `svn ls #{url}`.split("\n").map {|entry| "/#{entry}"} rescue nil
0
+ else
0
+ open(url) do |stream|
0
+ links("", stream.read)
0
+ end rescue nil
0
+ end
0
     end.flatten
0
   end
0
 

Comments

    No one has commented yet.