aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable/lib/action_cable/subscription_adapter
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2016-08-06 19:13:46 +0200
committerXavier Noria <fxn@hashref.com>2016-08-06 19:13:46 +0200
commitb678eb57e93423ac8e2a0cc0b083ce556c6fb130 (patch)
tree7cba336a3a15179b3b549c34a4b0d0e2474f62cd /actioncable/lib/action_cable/subscription_adapter
parentb91ff557ef6f621d1b921f358fd5b8a5d9e9090e (diff)
downloadrails-b678eb57e93423ac8e2a0cc0b083ce556c6fb130.tar.gz
rails-b678eb57e93423ac8e2a0cc0b083ce556c6fb130.tar.bz2
rails-b678eb57e93423ac8e2a0cc0b083ce556c6fb130.zip
applies new string literal convention in actioncable/lib
The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
Diffstat (limited to 'actioncable/lib/action_cable/subscription_adapter')
-rw-r--r--actioncable/lib/action_cable/subscription_adapter/async.rb2
-rw-r--r--actioncable/lib/action_cable/subscription_adapter/evented_redis.rb10
-rw-r--r--actioncable/lib/action_cable/subscription_adapter/postgresql.rb8
-rw-r--r--actioncable/lib/action_cable/subscription_adapter/redis.rb14
4 files changed, 17 insertions, 17 deletions
diff --git a/actioncable/lib/action_cable/subscription_adapter/async.rb b/actioncable/lib/action_cable/subscription_adapter/async.rb
index 10b3ac8cd8..46819dbfec 100644
--- a/actioncable/lib/action_cable/subscription_adapter/async.rb
+++ b/actioncable/lib/action_cable/subscription_adapter/async.rb
@@ -1,4 +1,4 @@
-require 'action_cable/subscription_adapter/inline'
+require "action_cable/subscription_adapter/inline"
module ActionCable
module SubscriptionAdapter
diff --git a/actioncable/lib/action_cable/subscription_adapter/evented_redis.rb b/actioncable/lib/action_cable/subscription_adapter/evented_redis.rb
index 4735a4bfa8..bcd46d2a0e 100644
--- a/actioncable/lib/action_cable/subscription_adapter/evented_redis.rb
+++ b/actioncable/lib/action_cable/subscription_adapter/evented_redis.rb
@@ -1,9 +1,9 @@
-require 'thread'
+require "thread"
-gem 'em-hiredis', '~> 0.3.0'
-gem 'redis', '~> 3.0'
-require 'em-hiredis'
-require 'redis'
+gem "em-hiredis", "~> 0.3.0"
+gem "redis", "~> 3.0"
+require "em-hiredis"
+require "redis"
EventMachine.epoll if EventMachine.epoll?
EventMachine.kqueue if EventMachine.kqueue?
diff --git a/actioncable/lib/action_cable/subscription_adapter/postgresql.rb b/actioncable/lib/action_cable/subscription_adapter/postgresql.rb
index 66c7852f6e..2637bfbea3 100644
--- a/actioncable/lib/action_cable/subscription_adapter/postgresql.rb
+++ b/actioncable/lib/action_cable/subscription_adapter/postgresql.rb
@@ -1,6 +1,6 @@
-gem 'pg', '~> 0.18'
-require 'pg'
-require 'thread'
+gem "pg", "~> 0.18"
+require "pg"
+require "thread"
module ActionCable
module SubscriptionAdapter
@@ -33,7 +33,7 @@ module ActionCable
pg_conn = ar_conn.raw_connection
unless pg_conn.is_a?(PG::Connection)
- raise 'ActiveRecord database must be Postgres in order to use the Postgres ActionCable storage adapter'
+ raise "ActiveRecord database must be Postgres in order to use the Postgres ActionCable storage adapter"
end
yield pg_conn
diff --git a/actioncable/lib/action_cable/subscription_adapter/redis.rb b/actioncable/lib/action_cable/subscription_adapter/redis.rb
index 65434f7107..62bd284a6b 100644
--- a/actioncable/lib/action_cable/subscription_adapter/redis.rb
+++ b/actioncable/lib/action_cable/subscription_adapter/redis.rb
@@ -1,7 +1,7 @@
-require 'thread'
+require "thread"
-gem 'redis', '~> 3.0'
-require 'redis'
+gem "redis", "~> 3.0"
+require "redis"
module ActionCable
module SubscriptionAdapter
@@ -72,7 +72,7 @@ module ActionCable
conn.without_reconnect do
original_client = conn.client
- conn.subscribe('_action_cable_internal') do |on|
+ conn.subscribe("_action_cable_internal") do |on|
on.subscribe do |chan, count|
@subscription_lock.synchronize do
if count == 1
@@ -111,7 +111,7 @@ module ActionCable
return if @thread.nil?
when_connected do
- send_command('unsubscribe')
+ send_command("unsubscribe")
@raw_client = nil
end
end
@@ -123,13 +123,13 @@ module ActionCable
@subscription_lock.synchronize do
ensure_listener_running
@subscribe_callbacks[channel] << on_success
- when_connected { send_command('subscribe', channel) }
+ when_connected { send_command("subscribe", channel) }
end
end
def remove_channel(channel)
@subscription_lock.synchronize do
- when_connected { send_command('unsubscribe', channel) }
+ when_connected { send_command("unsubscribe", channel) }
end
end