Sha256: 0fe7150278d0a769e23eaec283b0fda0fda1070ed1f9918b8544491aceeda201

Contents?: true

Size: 1.06 KB

Versions: 43

Compression:

Stored size: 1.06 KB

Contents

module Publisher
  class Iis_appcmd
    attr_accessor :iis_appcmd_url
    attr_accessor :iis_appcmd_protocol
    attr_accessor :http_read_timeout

    def appcmd(value)
      Helper.validates_presence_of iis_appcmd_url, "IIS URL not set"
      Helper.validates_presence_of iis_appcmd_protocol, "Protocol not set"

      begin
        uri    = URI(iis_appcmd_protocol + '://' + iis_appcmd_url)
        Net::HTTP.start(uri.host, uri.port) do |http|
          http.read_timeout = http_read_timeout
          request = Net::HTTP::Post.new uri.request_uri
          request.set_form_data('value' => value)
          request.content_type = 'application/x-www-form-urlencoded;charset=utf-8'
          http.request request do |response|
            response.read_body do |chunk|
              $log.writer.info "#{chunk}"
            end
          end
        end
      rescue Exception => e
        $log.writer.error "Error: while connecting to IIS Server"
        $log.writer.error "Request was: #{uri.to_s}"
        $log.writer.error e.message
        exit 1
      end
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
depengine-0.0.24 lib/depengine/publisher/iis_appcmd.rb
depengine-0.0.23 lib/depengine/publisher/iis_appcmd.rb
depengine-0.0.22 lib/depengine/publisher/iis_appcmd.rb
depengine-0.0.21 lib/depengine/publisher/iis_appcmd.rb
depengine-0.0.20 lib/depengine/publisher/iis_appcmd.rb
depengine-0.0.19 lib/depengine/publisher/iis_appcmd.rb
depengine-0.0.18 lib/depengine/publisher/iis_appcmd.rb
depengine-0.0.17 lib/depengine/publisher/iis_appcmd.rb
depengine-0.0.16 lib/depengine/publisher/iis_appcmd.rb
depengine-0.0.15 lib/depengine/publisher/iis_appcmd.rb
depengine-0.0.14 lib/depengine/publisher/iis_appcmd.rb
depengine-0.0.13 lib/depengine/publisher/iis_appcmd.rb
depengine-0.0.12 lib/depengine/publisher/iis_appcmd.rb
depengine-0.0.11 lib/depengine/publisher/iis_appcmd.rb
depengine-0.0.10 lib/depengine/publisher/iis_appcmd.rb
depengine-0.0.9 lib/depengine/publisher/iis_appcmd.rb
depengine-0.0.8 lib/depengine/publisher/iis_appcmd.rb
depengine-0.0.7 lib/depengine/publisher/iis_appcmd.rb
depengine-0.0.5 lib/depengine/publisher/iis_appcmd.rb
depengine-0.0.4 lib/depengine/publisher/iis_appcmd.rb