Sha256: ca15c55d80394e47c9656134e0b93a79a86eabf8eeff8815ff9a9176bdf4b1a1

Contents?: true

Size: 1.13 KB

Versions: 11

Compression:

Stored size: 1.13 KB

Contents

require "sitepress-core"

module Sitepress
  # Contains singletons for rails and some configuration data.
  Configuration = Struct.new(:site, :routes, :parent_engine)

  # Rescued by ActionController to display page not found error.
  PageNotFoundError = Class.new(StandardError)

  autoload :RailsConfiguration,       "sitepress/rails_configuration"
  autoload :RouteConstraint,          "sitepress/route_constraint"
  module Extensions
    autoload :RailsRequestPaths,      "sitepress/extensions/rails_request_paths"
    autoload :PartialsRemover,        "sitepress/extensions/partials_remover"
    autoload :IndexRequestPath,       "sitepress/extensions/index_request_path"
  end

  # Make site available via Sitepress.site from Rails app.
  def self.site
    configuration.site
  end

  # Default configuration object for Sitepress Rails integration.
  def self.configuration
    @configuration ||= RailsConfiguration.new
  end

  def self.reset_configuration
    @configuration = nil
  end

  def self.configure(&block)
    block.call configuration
  end
end

# This can't be autoloaded; otherwise Rails won't pick up the engine.
require "sitepress/engine"

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
sitepress-rails-1.0.1 lib/sitepress/rails.rb
sitepress-rails-1.0.0 lib/sitepress/rails.rb
sitepress-rails-0.1.29 lib/sitepress/rails.rb
sitepress-rails-0.1.28 lib/sitepress/rails.rb
sitepress-rails-0.1.27 lib/sitepress/rails.rb
sitepress-rails-0.1.26 lib/sitepress/rails.rb
sitepress-rails-0.1.25 lib/sitepress/rails.rb
sitepress-rails-0.1.24 lib/sitepress/rails.rb
sitepress-rails-0.1.23 lib/sitepress/rails.rb
sitepress-rails-0.1.22 lib/sitepress/rails.rb
sitepress-rails-0.1.21 lib/sitepress/rails.rb