Sha256: 69692614c0d0e058fdd11c3e69d2572cf89effb15e758f873a6a15852e28be1e

Contents?: true

Size: 926 Bytes

Versions: 1

Compression:

Stored size: 926 Bytes

Contents

require 'deployml/shell'

module DeploYML
  #
  # Represents a shell running on the local system.
  #
  class LocalShell

    include Shell

    #
    # Runs a program locally.
    #
    # @param [String] program
    #   The name or path of the program to run.
    #
    # @param [Array<String>] args
    #   Additional arguments for the program.
    #
    def run(program,*args)
      system(program,*args)
    end

    #
    # Prints out a message.
    #
    # @param [String] message
    #   The message to print.
    #
    def echo(message)
      puts message
    end

    #
    # Changes the current working directory.
    #
    # @param [String] path
    #   The path of the new current working directory to use.
    #
    # @yield []
    #   If a block is given, then the directory will be changed back after
    #   the block has returned.
    #
    def cd(path,&block)
      Dir.chdir(path,&block)
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
deployml-0.4.0 lib/deployml/local_shell.rb