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
-
.articles_path ⇒ Object
return the directory where to find the articles.
-
.articles_path=(path) ⇒ Object
sets the directory where to find the articles.
-
.assets_path ⇒ Object
return the directory where to find the assets.
-
.assets_path=(path) ⇒ Object
sets the directory where to find the assets.
-
.author_name ⇒ Object
returns the blog’s author name.
-
.author_name=(name) ⇒ Object
sets the blog’a author name.
-
.blog_name ⇒ Object
return the name of the blog.
-
.blog_name=(name) ⇒ Object
sets the name of the blog.
-
.db_name=(name) ⇒ Object
sets the name of the MongoDB database where the comments are stored.
-
.host ⇒ Object
returns the host of the application.
-
.host=(host) ⇒ Object
sets the host of the application.
-
.root_path ⇒ Object
returns the application’s root directory.
-
.root_path=(path) ⇒ Object
sets the application’s root directory.
-
.statics_path ⇒ Object
returns the directory where to find the static content such as about page.
-
.statics_path=(path) ⇒ Object
sets the directory where to find the static content such as about page.
-
.views_path ⇒ Object
return the directory where to find the views.
-
.views_path=(path) ⇒ Object
sets the directory where to find the views.
Class Method Details
.articles_path ⇒ Object
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_path ⇒ Object
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_name ⇒ Object
returns the blog’s author name
14 15 16 17 |
# File 'lib/parchemin/config/config.rb', line 14 def self. raise "The author_name configuration variable has not been set" if .nil? end |
.author_name=(name) ⇒ Object
sets the blog’a author name
9 10 11 |
# File 'lib/parchemin/config/config.rb', line 9 def self.=(name) = name end |
.blog_name ⇒ Object
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 |
.host ⇒ Object
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_path ⇒ Object
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_path ⇒ Object
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_path ⇒ Object
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 |