Sha256: 5e64b3ee851a547427c5ddf647907a10e69a1a1a3992a01ccb6b7bea99a89ed0

Contents?: true

Size: 1.02 KB

Versions: 21

Compression:

Stored size: 1.02 KB

Contents

require 'rails_connector/core_extensions'

# @api public
module ::RailsConnector
  def self.load_platform_gem_if_present(name)
    if Gem.loaded_specs["infopark_#{name}_connector"]
      gem_name = "infopark_#{name}_connector"

      # ensure the other connector is present in exactly the same version
      gem gem_name, Gem.loaded_specs["infopark_rails_connector"].version

      require gem_name

      @platform = name
    end
  end

  # return either <tt>:fiona</tt> or <tt>:cloud</tt> depending on the app's configuration.
  # @return [Symbol]
  def self.platform
    @platform
  end
end

RailsConnector::load_platform_gem_if_present(:cloud)
RailsConnector::load_platform_gem_if_present(:fiona)

unless RailsConnector::platform
  raise "The infopark_rails_connector gem requires "\
    "either the infopark_cloud_connector gem (for use with Infopark Cloud Express) or "\
    "the infopark_fiona_connector gem (for use with Infopark CMS Fiona). "\
    "Add either gem to your Gemfile."
end

require "rails_connector/engine" if defined?(Rails)

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
infopark_rails_connector-6.8.3.115.227021242 lib/infopark_rails_connector.rb
infopark_rails_connector-6.8.3.73.75172665 lib/infopark_rails_connector.rb
infopark_rails_connector-6.8.3.2.153416031 lib/infopark_rails_connector.rb
infopark_rails_connector-6.8.3.67.110847540 lib/infopark_rails_connector.rb
infopark_rails_connector-6.8.3.1.23895778 lib/infopark_rails_connector.rb
infopark_rails_connector-6.8.2.36.82613853 lib/infopark_rails_connector.rb
infopark_rails_connector-6.8.2.7.128454143 lib/infopark_rails_connector.rb
infopark_rails_connector-6.8.1.26.236500544 lib/infopark_rails_connector.rb
infopark_rails_connector-6.8.1 lib/infopark_rails_connector.rb
infopark_rails_connector-6.8.0.539.93842523 lib/infopark_rails_connector.rb
infopark_rails_connector-6.8.0.529.114081979 lib/infopark_rails_connector.rb
infopark_rails_connector-6.8.0.518.30999728 lib/infopark_rails_connector.rb
infopark_rails_connector-6.8.0.515.34928522 lib/infopark_rails_connector.rb
infopark_rails_connector-6.8.0.498.46559598 lib/infopark_rails_connector.rb
infopark_rails_connector-6.8.0.480.261594408 lib/infopark_rails_connector.rb
infopark_rails_connector-6.8.0.444.171626367 lib/infopark_rails_connector.rb
infopark_rails_connector-6.8.0.406.131718077 lib/infopark_rails_connector.rb
infopark_rails_connector-6.8.0.356.19698103 lib/infopark_rails_connector.rb
infopark_rails_connector-6.8.0.348.160665197 lib/infopark_rails_connector.rb
infopark_rails_connector-6.8.0.328.4a753fc lib/infopark_rails_connector.rb