Sha256: 832f404aa09bb07259f7df61cfadad147ae7f183b941dfa5a9e9d347b0637e48

Contents?: true

Size: 1.71 KB

Versions: 7

Compression:

Stored size: 1.71 KB

Contents

# Copyright (C) 2011-2012 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 arbitrary 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

7 entries across 7 versions & 1 rubygems

Version Path
rconf-0.9.25 lib/rconf/configurators/execute_configurator.rb
rconf-0.9.24 lib/rconf/configurators/execute_configurator.rb
rconf-0.9.23 lib/rconf/configurators/execute_configurator.rb
rconf-0.9.22 lib/rconf/configurators/execute_configurator.rb
rconf-0.9.21 lib/rconf/configurators/execute_configurator.rb
rconf-0.9.20 lib/rconf/configurators/execute_configurator.rb
rconf-0.9.19 lib/rconf/configurators/execute_configurator.rb