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__)}/..").expand_path

Class Method Summary collapse

Class Method Details

.aboutObject

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.timestamp.year} #{about_info.authors.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_infoObject

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_htmlObject

Render about text to HTML.



116
117
118
# File 'lib/postview.rb', line 116

def about_to_html
  Maruku.new(about).to_html
end

.pathObject

Current application path.



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

def path
  @path ||= Pathname.new(Dir.pwd).expand_path
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).expand_path
end

.version_specObject

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_summaryObject

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_tagObject

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