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 Method Summary collapse

Constructor Details

#initialize(config_file: DEFAULT_CONFIG_FILE) ⇒ Project

Returns a new instance of Project.


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

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

Instance Method Details

#compilerObject


16
17
18
# File 'lib/sitepress/project.rb', line 16

def compiler
  Compiler.new(site: site)
end

#serverObject


20
21
22
# File 'lib/sitepress/project.rb', line 20

def server
  Server.new(site: site)
end

#siteObject


24
25
26
# File 'lib/sitepress/project.rb', line 24

def site
  ConfigurationFile.new(path: @config_file).parse
end