Module: Postview
- Defined in:
- lib/postview.rb,
lib/postview/cli.rb,
lib/postview/site.rb,
lib/postview/helpers.rb,
lib/postview/settings.rb,
lib/postview/application.rb,
lib/postview/authentication.rb,
lib/postview/application/blog.rb,
lib/postview/cli/create_command.rb,
lib/postview/cli/server_command.rb
Overview
theme. To help for this, read Helpers for more informations.
Defined Under Namespace
Modules: Application, Authentication, CLI, Helpers Classes: Settings, Site
Constant Summary collapse
- ROOT =
Root path for Postview source.
Pathname.new("#{File.dirname(__FILE__)}/..").
Class Method Summary collapse
-
.about ⇒ Object
About text.
-
.about_info ⇒ Object
About information loaded from
ABOUT
file. -
.about_to_html ⇒ Object
Render about text to HTML.
-
.path ⇒ Object
Current application path.
-
.path=(pathname) ⇒ Object
Change current directory path for load all settings from other path.
-
.version_spec ⇒ Object
Version specification loaded from
VERSION
file. -
.version_summary ⇒ Object
Version information.
-
.version_tag ⇒ Object
Current version tag.
Class Method Details
.about ⇒ Object
About text.
101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/postview.rb', line 101 def about <<-end_info.gsub(/^[ ]{8}/,'') #{version_summary} Copyright (C) #{version_spec..year} #{about_info..join(', ')} #{about_info.description} For more information, please see the project homepage #{about_info.homepage}. Bugs, enhancements and improvements, please send message to #{about_info.email}. end_info end |
.about_info ⇒ Object
About information loaded from ABOUT
file.
96 97 98 |
# File 'lib/postview.rb', line 96 def about_info @about_info ||= OpenStruct.new(YAML.load_file(File.join(ROOT, "ABOUT"))) end |
.about_to_html ⇒ Object
Render about text to HTML.
116 117 118 |
# File 'lib/postview.rb', line 116 def about_to_html Maruku.new(about).to_html end |
.path ⇒ Object
Current application path.
68 69 70 |
# File 'lib/postview.rb', line 68 def path @path ||= Pathname.new(Dir.pwd). end |
.path=(pathname) ⇒ Object
Change current directory path for load all settings from other path.
74 75 76 |
# File 'lib/postview.rb', line 74 def path=(pathname) @path = Pathname.new(pathname). end |
.version_spec ⇒ Object
Version specification loaded from VERSION
file.
79 80 81 |
# File 'lib/postview.rb', line 79 def version_spec @version_spec ||= OpenStruct.new(YAML.load_file(ROOT.join("VERSION"))) end |
.version_summary ⇒ Object
Version information.
91 92 93 |
# File 'lib/postview.rb', line 91 def version_summary "#{name.sub(/::.*/,'')} v#{version_tag} (#{version_spec.date.strftime('%B %d, %Y')}, #{version_spec.cycle})" end |
.version_tag ⇒ Object
Current version tag.
84 85 86 87 88 |
# File 'lib/postview.rb', line 84 def version_tag %w{major minor patch release}.map do |tag| version_spec.send(tag) end.compact.join(".") end |