Skip to content

Commit 0d0514f

Browse files
ianksdblock
authored andcommitted
Remove ActiveSupport dependency.
1 parent 5da44ae commit 0d0514f

File tree

15 files changed

+23
-30
lines changed

15 files changed

+23
-30
lines changed

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Metrics/BlockLength:
2020
Metrics/ClassLength:
2121
Max: 250
2222
Metrics/LineLength:
23-
Max: 100
23+
Max: 128
2424
Style/Documentation:
2525
Enabled: false
2626
Style/ModuleFunction:

.rubocop_todo.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2020-06-22 23:35:07 +0800 using RuboCop version 0.82.0.
3+
# on 2020-06-29 08:44:31 -0400 using RuboCop version 0.82.0.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
@@ -30,7 +30,7 @@ Lint/SuppressedException:
3030
Metrics/AbcSize:
3131
Max: 39
3232

33-
# Offense count: 1
33+
# Offense count: 2
3434
# Configuration parameters: IgnoredMethods.
3535
Metrics/CyclomaticComplexity:
3636
Max: 9

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* [#324](https://github.com/slack-ruby/slack-ruby-client/pull/324): Upgrade slack-ruby-danger, rubocop, rubocop-rspec and rubocop-performance - [@dblock](https://github.com/dblock).
66
* [#327](https://github.com/slack-ruby/slack-ruby-client/pull/327), [#326](https://github.com/slack-ruby/slack-ruby-client/pull/326): Added `admin_conversations_whitelist`, `admin_usergroups`, `calls` and `calls_participants` endpoints - [@wasabigeek](https://github.com/wasabigeek).
77
* [#329](https://github.com/slack-ruby/slack-ruby-client/pull/329): Log when methods are deprecated - [@wasabigeek](https://github.com/wasabigeek).
8+
* [#325](https://github.com/slack-ruby/slack-ruby-client/pull/325): Remove activesupport dependency - [@ianks](https://github.com/ianks).
89
* Your contribution here.
910

1011
### 0.14.6 (2020/3/28)

UPGRADING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Upgrading Slack-Ruby-Client
22
===========================
33

4+
### Upgrading to >= 0.15.0
5+
6+
As of 0.15.0, `activesupport` is no longer required. Add `gem 'activesupport'` to your Gemfile if you required ActiveSupport via this library.
7+
8+
See [#325](https://github.com/slack-ruby/slack-ruby-client/pull/325) for more information.
9+
410
### Upgrading to >= 0.14.0
511

612
If you are using async-websocket, lock down its version to 0.8.0 as newer versions are currently incompatible.

lib/slack-ruby-client.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@
3737
require_relative 'slack/web/client'
3838

3939
# RealTime API
40-
require 'active_support'
41-
require 'active_support/core_ext'
4240
require_relative 'slack/real_time/concurrency'
4341
require_relative 'slack/real_time/socket'
4442
require_relative 'slack/real_time/api/message_id'

lib/slack/messages/message.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
module Slack
33
module Messages
44
class Message < Hashie::Mash
5-
def presence
6-
super['presence']
7-
end
8-
95
def to_s
106
keys.sort_by(&:to_s).map do |key|
117
"#{key}=#{self[key]}"

lib/slack/real_time/concurrency/async.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,7 @@ def build_ssl_context
114114

115115
def build_endpoint
116116
endpoint = ::Async::IO::Endpoint.tcp(addr, port)
117-
if secure?
118-
endpoint = ::Async::IO::SSLEndpoint.new(endpoint, ssl_context: build_ssl_context)
119-
end
117+
endpoint = ::Async::IO::SSLEndpoint.new(endpoint, ssl_context: build_ssl_context) if secure?
120118
endpoint
121119
end
122120

lib/slack/real_time/concurrency/eventmachine.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ module Concurrency
88
module Eventmachine
99
class Client < Faye::WebSocket::Client
1010
def initialize(url, protocols = nil, options = {})
11-
@logger =
12-
options.fetch(:logger) || Slack::RealTime::Config.logger || Slack::Config.logger
13-
super url, protocols, options.except(:logger)
11+
options = options.dup
12+
@logger = options.delete(:logger) || Slack::RealTime::Config.logger || Slack::Config.logger
13+
super url, protocols, options
1414
end
1515

1616
def parse(data)

lib/slack/real_time/models/base.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ module Slack
33
module RealTime
44
module Models
55
class Base < Hashie::Mash
6-
def presence
7-
super['presence']
8-
end
9-
106
# see https://github.com/intridea/hashie/issues/394
117
def log_built_in_message(*); end
128
end

lib/slack/real_time/socket.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ class Socket
88

99
def initialize(url, options = {})
1010
@url = url
11-
@options = options
11+
@options = options.dup
1212
@driver = nil
13-
@logger = options.delete(:logger) || Slack::RealTime::Config.logger || Slack::Config.logger
13+
@logger = @options.delete(:logger) || Slack::RealTime::Config.logger || Slack::Config.logger
1414
@last_message_at = nil
1515
end
1616

0 commit comments

Comments
 (0)