module Apipie::Helpers

Attributes

url_prefix[RW]

Public Instance Methods

full_url(path) click to toggle source
# File lib/apipie/helpers.rb, line 9
def full_url(path)
  unless @url_prefix
    @url_prefix = ""
    if rails_prefix = ENV["RAILS_RELATIVE_URL_ROOT"]
      @url_prefix << rails_prefix
    end
    @url_prefix << Apipie.configuration.doc_base_url
  end
  path = path.sub(%r^\//,"")
  ret = "#{@url_prefix}/#{path}"
  ret.insert(0,"/") unless ret =~ %r\A[.\/]/
  ret.sub!(%r\/*\Z/,"")
  ret
end
markup_to_html(text) click to toggle source
# File lib/apipie/helpers.rb, line 3
def markup_to_html(text)
  Apipie.configuration.markup.to_html(text.strip_heredoc)
end