Sha256: 6ea587b88bd0c82893a931d044fedcadbc645e0142e2159cdc46a37756c3ab25

Contents?: true

Size: 756 Bytes

Versions: 3

Compression:

Stored size: 756 Bytes

Contents

module IISConfig

  class Runner

    def self.execute_command(args)
      args = [args].flatten
      tool = :appcmd

      safe_command = args.map { |v| v.is_a?(IISConfig::Command) ? v.safe_command : v }
      command = args.map { |v| v.is_a?(IISConfig::Command) ? v.command : v }

      puts  "  #{tool.to_s} #{safe_command.join(' ')}"

      unless IISConfiguration.dry_run?
        result = `c:/windows/system32/inetsrv/appcmd #{command.join(' ')}"`
        puts result if IISConfiguration.verbose?
        raise Exception.new($?.exitstatus) unless $?.success?
        result
      end
    end

    def self.run_commands(commands)
      commands.each do |c|
        Runner.execute_command c
      end
    end

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
iisconfig-0.8.0 lib/iisconfig/runner.rb
iisconfig-0.7.0 lib/iisconfig/runner.rb
iisconfig-0.6.0 lib/iisconfig/runner.rb