Sha256: 341601389ed9e75dbb7730ef76f52203d0e51299cd9670b01c412ef6be4cd1e0

Contents?: true

Size: 1.54 KB

Versions: 1

Compression:

Stored size: 1.54 KB

Contents

# 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.
module Ronn
  autoload :Document, 'ronn/document'
  autoload :Index,    'ronn/index'
  autoload :Template, 'ronn/template'
  autoload :Roff,     'ronn/roff'
  autoload :Server,   'ronn/server'

  # Create a new Ronn::Document for the given ronn file. See
  # Ronn::Document.new for usage information.
  def self.new(filename, attributes = {}, &block)
    Document.new(filename, attributes, &block)
  end

  # truthy when this a release (\d\.\d\.\d) version.
  def self.release?
    revision != '' && !revision.include?('-')
  end

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

  # 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
  def self.revision
    REV
  end

  # value generated by: rake rev
  REV = '0.10.2'.freeze
  VERSION = version
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nronn-0.10.2 lib/ronn.rb