提交 08acb95a 编写于 作者: J Jeremy Kemper

Improve script/plugin on Windows. Closes #2646.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2821 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 54a4e506
*SVN*
* Improve script/plugin on Windows. #2646 [Chad Fowler]
* The *_plugindoc Rake tasks look deeper into the plugins' lib directories. #2652 [bellis@deepthought.org]
* The PostgreSQL :db_structure_dump Rake task limits its dump to the schema search path in database.yml. [Anatol Pomozov <anatol.pomozov@gmail.com>]
......
......@@ -46,6 +46,12 @@
# Send patches to rtomayko@gmail.com
$verbose = false
`svn --version`
unless $?.success?
$stderr.puts "ERROR: Must have subversion (svn) available in the PATH to use plugin manager"
exit 1
end
require 'fileutils'
require 'tempfile'
......@@ -193,7 +199,7 @@ def rails_env
class Repositories
include Enumerable
def initialize(cache_file="~/.rails-plugin-sources")
def initialize(cache_file = File.join(find_home, ".rails-plugin-sources"))
@cache_file = File.expand_path(cache_file)
load!
end
......@@ -252,7 +258,25 @@ def defaults
http://svn.aviditybytes.com/rails/plugins/
REPOSITORIES
end
def find_home
['HOME', 'USERPROFILE'].each do |homekey|
return ENV[homekey] if ENV[homekey]
end
if ENV['HOMEDRIVE'] && ENV['HOMEPATH']
return "#{ENV['HOMEDRIVE']}:#{ENV['HOMEPATH']}"
end
begin
File.expand_path("~")
rescue StandardError => ex
if File::ALT_SEPARATOR
"C:/"
else
"/"
end
end
end
def self.instance
@instance ||= Repositories.new
end
......@@ -740,4 +764,4 @@ def parse!(args)
end
Commands::Plugin.parse!
\ No newline at end of file
Commands::Plugin.parse!
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册