Module: Sprout::System

Defined in:
sprout/lib/sprout/system.rb,
sprout/lib/sprout/system/win_system.rb,
sprout/lib/sprout/system/osx_system.rb,
sprout/lib/sprout/system/java_system.rb,
sprout/lib/sprout/system/base_system.rb,
sprout/lib/sprout/system/unix_system.rb,
sprout/lib/sprout/system/vista_system.rb,
flashsdk/lib/flashplayer/system_mixins.rb,
sprout/lib/sprout/system/win_nix_system.rb

Defined Under Namespace

Classes: BaseSystem, JavaSystem, OSXSystem, ThreadMock, UnixSystem, VistaSystem, WinNixSystem, WinSystem

Class Method Summary (collapse)

Class Method Details

+ (Object) create

This is the factory that one should generally be used to create new, concrete System objects.

A typical example follows:

system = System.create
Dir.chdir system.home
system.execute "pwd" # /home/yourusername


23
24
25
26
27
28
29
30
31
# File 'sprout/lib/sprout/system.rb', line 23

def self.create
  p = Sprout::Platform.new
  return VistaSystem.new  if p.vista?
  return WinNixSystem.new if p.windows_nix?
  return WinSystem.new    if p.windows?
  return JavaSystem.new   if p.java?
  return OSXSystem.new    if p.mac?
  return UnixSystem.new 
end