mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	on Windows. [ruby-core:21339] * lib/rake/win32.rb (Rake::Win32#rake_system): ditto. * lib/rake/win32.rb (Rake::Win32#win32_system_dir): no longer needs environment variables other than APPDATA now. * lib/rake.rb (Rake::Application#standard_system_dir): uses platfrom specific definition on Windows system. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
		
			
				
	
	
		
			34 lines
		
	
	
	
		
			963 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
			
		
		
	
	
			34 lines
		
	
	
	
		
			963 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
module Rake
 | 
						|
 | 
						|
  # Win 32 interface methods for Rake. Windows specific functionality
 | 
						|
  # will be placed here to collect that knowledge in one spot.
 | 
						|
  module Win32
 | 
						|
    class << self
 | 
						|
      # True if running on a windows system.
 | 
						|
      def windows?
 | 
						|
        # assume other DOSish systems are extinct.
 | 
						|
        File::ALT_SEPARATOR == '\\'
 | 
						|
      end
 | 
						|
    end
 | 
						|
 | 
						|
    class << self
 | 
						|
      # The standard directory containing system wide rake files on
 | 
						|
      # Win 32 systems. Try the following environment variables (in
 | 
						|
      # order):
 | 
						|
      #
 | 
						|
      # * APPDATA
 | 
						|
      # * HOME
 | 
						|
      # * HOMEDRIVE + HOMEPATH
 | 
						|
      # * USERPROFILE
 | 
						|
      #
 | 
						|
      # If the above are not defined, retruns the personal folder.
 | 
						|
      def win32_system_dir #:nodoc:
 | 
						|
        win32_shared_path = ENV['APPDATA']
 | 
						|
        if !win32_shared_path or win32_shared_path.empty?
 | 
						|
          win32_shared_path = '~'
 | 
						|
        end
 | 
						|
        File.expand_path('Rake', win32_shared_path)
 | 
						|
      end
 | 
						|
    end if windows?
 | 
						|
  end
 | 
						|
end
 |