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