Patch #1724 » rdm-mailhandler.rb.patch
| rdm-mailhandler.rb (working copy) | ||
|---|---|---|
|
require 'uri'
|
||
|
require 'getoptlong'
|
||
|
# easy way to use https
|
||
|
# from http://www.missiondata.com/blog/ruby/65/building-a-better-world-with-google-spreadsheets/
|
||
|
module Net
|
||
|
class HTTPS < HTTP
|
||
|
def initialize(address, port = nil)
|
||
|
super(address, port)
|
||
|
self.use_ssl = true
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
class RedmineMailHandler
|
||
|
VERSION = '0.1'
|
||
|
|
||
| ... | ... | |
|
issue_attributes.each { |attr, value| data["issue[#{attr}]"] = value }
|
||
|
|
||
|
debug "Posting to #{uri}..."
|
||
|
response = Net::HTTP.post_form(URI.parse(uri), data)
|
||
|
response = Net::HTTPS.post_form(URI.parse(uri), data)
|
||
|
debug "Response received: #{response.code}"
|
||
|
response.code == 201 ? 0 : 1
|
||
|
end
|
||