Class: Sitepress::RailsConfiguration

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/sitepress/rails_configuration.rb

Overview

Configuration object for rails application.

Constant Summary collapse

DEFAULT_SITE_ROOT =

Store in ./app/content by default.

"app/content".freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRailsConfiguration

Set defaults.


17
18
19
# File 'lib/sitepress/rails_configuration.rb', line 17

def initialize
  self.routes = true
end

Instance Attribute Details

#parent_engineObject


21
22
23
# File 'lib/sitepress/rails_configuration.rb', line 21

def parent_engine
  @parent_engine ||= Rails.application
end

#routesObject

Returns the value of attribute routes


9
10
11
# File 'lib/sitepress/rails_configuration.rb', line 9

def routes
  @routes
end

#siteObject


25
26
27
28
29
30
# File 'lib/sitepress/rails_configuration.rb', line 25

def site
  @site ||= Site.new(root_path: default_root).tap do |site|
    site.resources_pipeline << Extensions::PartialsRemover.new
    site.resources_pipeline << Extensions::RailsRequestPaths.new
  end
end