Sha256: 32521af2b483b0bddd08f5a351d89561fe000ea41099519c11074c51eead654b

Contents?: true

Size: 962 Bytes

Versions: 18

Compression:

Stored size: 962 Bytes

Contents

module ::RailsConnector
  def self.load_platform_gem_if_present(name) # :nodoc:
    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 :fiona or :cloud depending on the app's configuration.
  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

18 entries across 18 versions & 1 rubygems

Version Path
infopark_rails_connector-6.8.0.23.da7f96b lib/infopark_rails_connector.rb
infopark_rails_connector-6.8.0.16.def5e85 lib/infopark_rails_connector.rb
infopark_rails_connector-6.8.0.15.a24f5ff lib/infopark_rails_connector.rb
infopark_rails_connector-6.8.0.beta.200.891.647580e lib/infopark_rails_connector.rb
infopark_rails_connector-6.8.0.beta.200.889.d503e42 lib/infopark_rails_connector.rb
infopark_rails_connector-6.8.0.beta.200.883.f5f063b lib/infopark_rails_connector.rb
infopark_rails_connector-6.8.0.beta.200.884.4bd86e6 lib/infopark_rails_connector.rb
infopark_rails_connector-6.8.0.beta.200.869.9609b39 lib/infopark_rails_connector.rb
infopark_rails_connector-6.8.0.beta.200.856.8c0fec5 lib/infopark_rails_connector.rb
infopark_rails_connector-6.8.0.beta.200.809.bdfa8c3 lib/infopark_rails_connector.rb
infopark_rails_connector-6.8.0.beta.200.785.05d4af9 lib/infopark_rails_connector.rb
infopark_rails_connector-6.8.0.beta.200.744.99f67fc lib/infopark_rails_connector.rb
infopark_rails_connector-6.8.0.beta.200.720.44fbabd lib/infopark_rails_connector.rb
infopark_rails_connector-6.8.0.beta.200.713.e5c3150 lib/infopark_rails_connector.rb
infopark_rails_connector-6.8.0.beta.200.681.7c84f4a lib/infopark_rails_connector.rb
infopark_rails_connector-6.8.0.beta.200.663.ceecdee lib/infopark_rails_connector.rb
infopark_rails_connector-6.8.0.beta.200.650.7c93155 lib/infopark_rails_connector.rb
infopark_rails_connector-6.8.0.beta.200.621.4c8e1b0 lib/infopark_rails_connector.rb