Sha256: eb45cb9e4b2039fa08a22b80a78bc9d3dcb6ff931c5daa1e5f907caf1561fe6d

Contents?: true

Size: 1.71 KB

Versions: 5

Compression:

Stored size: 1.71 KB

Contents

# Copyright (C) 2011 RightScale, Inc, All Rights Reserved Worldwide.
#
# THIS PROGRAM IS CONFIDENTIAL AND PROPRIETARY TO RIGHTSCALE
# AND CONSTITUTES A VALUABLE TRADE SECRET. Any unauthorized use,
# reproduction, modification, or disclosure of this program is
# strictly prohibited. Any use of this program by an authorized
# licensee is strictly subject to the terms and conditions,
# including confidentiality obligations, set forth in the applicable
# License Agreement between RightScale.com, Inc. and
# the licensee

module RightConf

  class ExecuteConfigurator

    include Configurator

    register :execute

    description 'Run arbitraty shell commands'

    settings :command_line     => 'Command line to run',
             :message          => 'Progress message to display if any while command is running',
             :abort_on_failure => 'Message to display when aborting configuration if command fails. ' +
                                  'Do not abort if not set'

    validate_has_settings :command_line

    # No way to check, return false
    #
    # === Return
    # false:: Always return false
    def check_linux
      false
    end
    alias :check_darwin :check_linux
    alias :check_windows :check_linux

    # Run command line
    #
    # === Return
    # true:: Always return true
    def run_linux
      report_check message if message
      args = command_line.split(' ')
      args += [ { :abort_on_failure => abort_on_failure } ] if abort_on_failure
      Command.execute(*args)
      report_success if message
      true
    end
    alias :run_darwin :run_linux

    # Run command line on Windows
    #
    # === Return
    # true:: Always return true
    def run_windows
      true # TBD
    end

  end
end



Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rconf-0.8.10 lib/rconf/configurators/execute_configurator.rb
rconf-0.8.9 lib/rconf/configurators/execute_configurator.rb
rconf-0.8.8 lib/rconf/configurators/execute_configurator.rb
rconf-0.8.5 lib/rconf/configurators/execute_configurator.rb
rconf-0.8.4 lib/rconf/configurators/execute_configurator.rb