Class: Sitepress::Project

Inherits:
Object
  • Object
show all
Defined in:
lib/sitepress/project.rb

Overview

Configures a site server, compiler, etc from a single configuration file. Useful for static sites or anything that’s running outside of a framework like Rails.

Constant Summary collapse

DEFAULT_CONFIG_FILE =

Default path of project configuration file.

"site.rb".freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config_file: DEFAULT_CONFIG_FILE) ⇒ Project

Returns a new instance of Project.



14
15
16
# File 'lib/sitepress/project.rb', line 14

def initialize(config_file: DEFAULT_CONFIG_FILE)
  @config_file = config_file
end

Instance Attribute Details

#siteObject (readonly)

Returns the value of attribute site.



12
13
14
# File 'lib/sitepress/project.rb', line 12

def site
  @site
end

Instance Method Details

#compilerObject



18
19
20
# File 'lib/sitepress/project.rb', line 18

def compiler
  Compiler.new(site: site)
end

#serverObject



22
23
24
# File 'lib/sitepress/project.rb', line 22

def server
  Server.new(site: site)
end