Sha256: 0dfe7f4f34a076d63369064a582cf8f4c01659f5e2cedc4837b9c90d952d087b

Contents?: true

Size: 882 Bytes

Versions: 39

Compression:

Stored size: 882 Bytes

Contents

require 'sprout/system/base_system'
require 'sprout/system/unix_system'
require 'sprout/system/java_system'
require 'sprout/system/osx_system'
require 'sprout/system/win_system'
require 'sprout/system/win_nix_system'
require 'sprout/system/vista_system'

module Sprout

  module System

    # 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
    #
    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

  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
sprout-1.1.18.pre lib/sprout/system.rb
sprout-1.1.17.pre lib/sprout/system.rb
sprout-1.1.16.pre lib/sprout/system.rb
sprout-1.1.15.pre lib/sprout/system.rb
sprout-1.1.14.pre lib/sprout/system.rb
sprout-1.1.13.pre lib/sprout/system.rb
sprout-1.1.11.pre lib/sprout/system.rb
sprout-1.1.10.pre lib/sprout/system.rb
sprout-1.1.7.pre lib/sprout/system.rb
sprout-1.1.5.pre lib/sprout/system.rb
sprout-1.1.4.pre lib/sprout/system.rb
sprout-1.1.3.pre lib/sprout/system.rb
sprout-1.1.2.pre lib/sprout/system.rb
sprout-1.0.35.pre lib/sprout/system.rb
sprout-1.0.32.pre lib/sprout/system.rb
sprout-1.0.31.pre lib/sprout/system.rb
sprout-1.0.29.pre lib/sprout/system.rb
sprout-1.0.26.pre lib/sprout/system.rb
sprout-1.0.25.pre lib/sprout/system.rb
sprout-1.0.24.pre lib/sprout/system.rb