Module: Ronn

Defined in:
lib/ronn.rb,
lib/ronn/roff.rb,
lib/ronn/index.rb,
lib/ronn/utils.rb,
lib/ronn/server.rb,
lib/ronn/document.rb,
lib/ronn/template.rb

Overview

Ronn is a humane text format and toolchain for authoring manpages (and things that appear as manpages from a distance). Use it to build / install standard Unix roff(7) formatted manpages or to generate beautiful HTML manpages.

Defined Under Namespace

Modules: Server, Utils Classes: Document, Index, Reference, RoffFilter, Template

Constant Summary collapse

REV =

value generated by: rake rev

'0.11.1'.freeze
VERSION =
version

Class Method Summary collapse

Class Method Details

.new(filename, attributes = {}, &block) ⇒ Object

Create a new Ronn::Document for the given ronn file. See Ronn::Document.new for usage information.



14
15
16
# File 'lib/ronn.rb', line 14

def self.new(filename, attributes = {}, &block)
  Document.new(filename, attributes, &block)
end

.release?Boolean

truthy when this a release (d.d.d) version.

Returns:

  • (Boolean)


19
20
21
# File 'lib/ronn.rb', line 19

def self.release?
  revision != '' && !revision.include?('-')
end

.revisionObject

The string revision as reported by: git-describe –tags. This is just the tag name when a tag references the HEAD commit (e.g. v0.6.25). When the HEAD commit is not tagged, this is a “<tag>-<offset>-<sha1>” string:

<tag>    - closest tag name
<offset> - number of commits ahead of <tag>
<sha1>   - 7c short SHA1 for HEAD


38
39
40
# File 'lib/ronn.rb', line 38

def self.revision
  REV
end

.versionObject

A semantic version number based on the git revision. The third element of the version is incremented by the commit offset, such that version v0.6.6-5-gdacd74b => 0.6.11



26
27
28
29
30
# File 'lib/ronn.rb', line 26

def self.version
  ver = revision.sub(/\Av/, '')[/^[0-9.-]+/].split(/[.-]/).map(&:to_i)
  ver[2] += ver.pop while ver.size > 3
  ver.join('.')
end