Sha256: 334e935737a41abbb2adf855dac7ec7d9d94c82c12aa138aef47180355bba443

Contents?: true

Size: 1010 Bytes

Versions: 2

Compression:

Stored size: 1010 Bytes

Contents

# frozen_string_literal: true

require "anycable"
require "anycable/rails/version"
require "anycable/rails/config"
require "anycable/rails/rack"

module AnyCable
  # Rails handler for AnyCable
  module Rails
    require "anycable/rails/railtie"

    ADAPTER_ALIASES = %w[any_cable anycable].freeze

    def self.compatible_adapter?(adapter)
      ADAPTER_ALIASES.include?(adapter)
    end
  end
end

# Warn if application has been already initialized.
# AnyCable should be loaded before initialization in order to work correctly.
if defined?(::Rails) && ::Rails.application && ::Rails.application.initialized?
  puts("\n**************************************************")
  puts(
    "⛔️  WARNING: AnyCable loaded after application initialization. Might not work correctly.\n"\
    "Please, make sure to remove `require: false` in your Gemfile or "\
    "require manually in `environment.rb` before `Rails.application.initialize!`"
  )
  puts("**************************************************\n\n")
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
anycable-rails-1.0.0.preview2 lib/anycable/rails.rb
anycable-rails-1.0.0.preview1 lib/anycable/rails.rb