Module: Sitepress

Defined in:
lib/sitepress/model.rb,
lib/sitepress/rails.rb,
lib/sitepress/engine.rb,
lib/sitepress/compiler.rb,
lib/sitepress/rendition.rb,
lib/sitepress/renderers/server.rb,
lib/sitepress/route_constraint.rb,
lib/sitepress/models/collection.rb,
lib/sitepress/rails_configuration.rb,
lib/sitepress/renderers/controller.rb,
lib/sitepress/build_paths/root_path.rb,
lib/sitepress/build_paths/index_path.rb,
lib/sitepress/build_paths/directory_index_path.rb

Defined Under Namespace

Modules: BuildPaths, Compiler, Models, Renderers Classes: Engine, Model, RailsConfiguration, Rendition, RouteConstraint

Constant Summary collapse

NotFoundError =

Base class for errors if Sitepress can’t find a resource, model, etc.

Class.new(StandardError)
ResourceNotFoundError =

Rescued by ActionController to display page not found error.

Class.new(NotFoundError)
ResourceNotFound =

Accidentally left out ‘Error` in the constant name, so I’m setting that up here for backwards compatability.

ResourceNotFoundError
ModelNotFoundError =

Raised if a model isn’t found.

Class.new(NotFoundError)
RenderingError =

Raised when any of the Render subclasses can’t render a page.

Class.new(RuntimeError)

Class Method Summary collapse

Class Method Details

.configurationObject

Default configuration object for Sitepress Rails integration.



43
44
45
# File 'lib/sitepress/rails.rb', line 43

def self.configuration
  @configuration ||= RailsConfiguration.new
end

.configure(&block) ⇒ Object



51
52
53
# File 'lib/sitepress/rails.rb', line 51

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

.reset_configurationObject



47
48
49
# File 'lib/sitepress/rails.rb', line 47

def self.reset_configuration
  @configuration = nil
end

.siteObject

Make site available via Sitepress.site from Rails app.



38
39
40
# File 'lib/sitepress/rails.rb', line 38

def self.site
  configuration.site
end