Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace from HTTPClient to Rest-Client #158

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
source 'https://rubygems.org'

gem "httpclient"
gem "rest-client"
6 changes: 2 additions & 4 deletions lib/redmine_slack/listener.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require 'httpclient'
require 'rest-client'

module RedmineSlack
class Listener < Redmine::Hook::Listener
Expand Down Expand Up @@ -157,10 +158,7 @@ def speak(msg, channel, attachment=nil, url=nil)
end

begin
client = HTTPClient.new
client.ssl_config.cert_store.set_default_paths
client.ssl_config.ssl_version = :auto
client.post_async url, {:payload => params.to_json}
RestClient.post url, {:payload => params.to_json}
rescue Exception => e
Rails.logger.warn("cannot connect to #{url}")
Rails.logger.warn(e)
Expand Down