Module: Sprout::System
- Defined in:
- lib/sprout/system.rb,
lib/sprout/system/osx_system.rb,
lib/sprout/system/win_system.rb,
lib/sprout/system/unix_system.rb,
lib/sprout/system/java_system.rb,
lib/sprout/system/base_system.rb,
lib/sprout/system/vista_system.rb,
lib/sprout/system/win_nix_system.rb
Defined Under Namespace
Classes: BaseSystem, JavaSystem, OSXSystem, ThreadMock, UnixSystem, VistaSystem, WinNixSystem, WinSystem
Class Method Summary (collapse)
-
+ (Object) create
This is the factory that one should generally be used to create new, concrete System objects.
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 '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 |