Module RSCM::Platform
In: lib/rscm/platform.rb

Methods

family   prompt   user  

Public Instance methods

[Source]

    # File lib/rscm/platform.rb, line 5
 5:     def family
 6:       target_os = Config::CONFIG["target_os"] or ""
 7:       return "powerpc-darwin" if target_os.downcase =~ /darwin/
 8:       return "mswin32"  if target_os.downcase =~ /32/
 9:       return "cygwin" if target_os.downcase =~ /cyg/
10:       return "freebsd" if target_os.downcase =~ /freebsd/
11:       raise "Unsupported OS: #{target_os}"
12:     end

[Source]

    # File lib/rscm/platform.rb, line 20
20:     def prompt(dir=Dir.pwd)
21:       prompt = "#{dir.gsub(/\//, File::SEPARATOR)} #{user}$"
22:     end

[Source]

    # File lib/rscm/platform.rb, line 15
15:     def user
16:       family == "mswin32" ? ENV['USERNAME'] : ENV['USER']
17:     end

[Validate]