Module: Parchemin::Config

Defined in:
lib/parchemin/config/config.rb

Overview

This class holds all the configuration variables of the application

Class Method Summary collapse

Class Method Details

.articles_pathObject

return the directory where to find the articles



78
79
80
# File 'lib/parchemin/config/config.rb', line 78

def self.articles_path
  @articles_path ||= "#{root_path}/articles"
end

.articles_path=(path) ⇒ Object

sets the directory where to find the articles. By defaut it is sets to ROOT_PATH/articles



73
74
75
# File 'lib/parchemin/config/config.rb', line 73

def self.articles_path=(path)
  @articles_path = path
end

.assets_pathObject

return the directory where to find the assets



68
69
70
# File 'lib/parchemin/config/config.rb', line 68

def self.assets_path
  @assets_path ||= "#{root_path}/assets"
end

.assets_path=(path) ⇒ Object

sets the directory where to find the assets. By defaut it is sets to ROOT_PATH/assets



63
64
65
# File 'lib/parchemin/config/config.rb', line 63

def self.assets_path=(path)
  @assets_path = path
end

.author_nameObject

returns the blog’s author name



14
15
16
17
# File 'lib/parchemin/config/config.rb', line 14

def self.author_name
  raise "The author_name configuration variable has not been set" if @author_name.nil?
  @author_name
end

.author_name=(name) ⇒ Object

sets the blog’a author name



9
10
11
# File 'lib/parchemin/config/config.rb', line 9

def self.author_name=(name)
  @author_name = name
end

.blog_nameObject

return the name of the blog



25
26
27
28
# File 'lib/parchemin/config/config.rb', line 25

def self.blog_name
  raise "The blog_name configuration variable has not been set" if @blog_name.nil?
  @blog_name
end

.blog_name=(name) ⇒ Object

sets the name of the blog



20
21
22
# File 'lib/parchemin/config/config.rb', line 20

def self.blog_name=(name)
  @blog_name = name
end

.db_name=(name) ⇒ Object

sets the name of the MongoDB database where the comments are stored



93
94
95
96
97
98
# File 'lib/parchemin/config/config.rb', line 93

def self.db_name=(name)
  Mongoid.configure do |config|
    config.allow_dynamic_fields = false
    config.master = Mongo::Connection.new.db(name)
  end
end

.hostObject

returns the host of the application



36
37
38
39
# File 'lib/parchemin/config/config.rb', line 36

def self.host
  raise "The host configuration variable has not been set" if @host.nil?
  @host
end

.host=(host) ⇒ Object

sets the host of the application. This variable is useful for define the RSS feed



31
32
33
# File 'lib/parchemin/config/config.rb', line 31

def self.host=(host)
  @host = host
end

.root_pathObject

returns the application’s root directory



47
48
49
50
# File 'lib/parchemin/config/config.rb', line 47

def self.root_path
  raise "The root_path configuration variable has not been set" if @root_path.nil?
  @root_path
end

.root_path=(path) ⇒ Object

sets the application’s root directory



42
43
44
# File 'lib/parchemin/config/config.rb', line 42

def self.root_path=(path)
  @root_path = path
end

.statics_pathObject

returns the directory where to find the static content such as about page.



88
89
90
# File 'lib/parchemin/config/config.rb', line 88

def self.statics_path
  @statics_path ||= "#{root_path}/statics"
end

.statics_path=(path) ⇒ Object

sets the directory where to find the static content such as about page. By defaut it is sets to ROOT_PATH/statics



83
84
85
# File 'lib/parchemin/config/config.rb', line 83

def self.statics_path=(path)
  @statics_path = path
end

.views_pathObject

return the directory where to find the views



58
59
60
# File 'lib/parchemin/config/config.rb', line 58

def self.views_path
  @views_path ||= "#{root_path}/views"
end

.views_path=(path) ⇒ Object

sets the directory where to find the views. By defaut it is sets to ROOT_PATH/views



53
54
55
# File 'lib/parchemin/config/config.rb', line 53

def self.views_path=(path)
  @views_path = path
end