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

Fix to support windows #164

Merged
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### 0.9.2 (Next)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put back the line, please.

* [#163](https://github.com/slack-ruby/slack-ruby-client/pull/164): Use OpenSSL::X509::DEFAULT_CERT_DIR and OpenSSL::X509::DEFAULT_CERT_FILE for default ca_cert and ca_file [@leifcr](https://github.com/leifcr)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be good to highlight code constants as code with `CODE`

* [#161](https://github.com/slack-ruby/slack-ruby-client/pull/161): Added support for cursor pagination - [@dblock](https://github.com/dblock).
* Your contribution here.

Expand Down
5 changes: 3 additions & 2 deletions lib/slack/web/config.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require 'openssl'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would make OpenSSL hard dependency.

Might be better to wrap it in a block and rescue LoadError.

module Slack
module Web
module Config
Expand All @@ -21,8 +22,8 @@ module Config
def reset
self.endpoint = 'https://slack.com/api/'
self.user_agent = "Slack Ruby Client/#{Slack::VERSION}"
self.ca_path = `openssl version -a | grep OPENSSLDIR | awk '{print $2}'|sed -e 's/\"//g'`
self.ca_file = "#{ca_path}/ca-certificates.crt"
self.ca_path = OpenSSL::X509::DEFAULT_CERT_DIR
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If OpenSSL is not defined (guess we don't want hard dependency) then this would crash. So this can be done as

self.ca_path = OpenSSL::X509::DEFAULT_CERT_DIR if defined?(OpenSSL)

self.ca_file = OpenSSL::X509::DEFAULT_CERT_FILE
self.token = nil
self.proxy = nil
self.logger = nil
Expand Down