Module: RDoc::Generator

Defined in:
lib/rdoc/generator.rb,
lib/rdoc/generator/texinfo.rb

Defined Under Namespace

Modules: MarkUp Classes: AllReferences, CHM, Class, Context, File, HTML, HTMLInOne, Method, RI, Texinfo, TexinfoTemplate, XML

Constant Summary collapse

FILE_DIR =

Name of sub-direcory that holds file descriptions

"files"
CLASS_DIR =

Name of sub-direcory that holds class descriptions

"classes"
CSS_NAME =

Name of the RDoc CSS file

"rdoc-style.css"

Class Method Summary collapse

Class Method Details

.gen_url(path, target) ⇒ Object

Converts a target url to one that is relative to a given path



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/rdoc/generator.rb', line 27

def self.gen_url(path, target)
  from          = ::File.dirname path
  to, to_file   = ::File.split target

  from = from.split "/"
  to   = to.split "/"

  while from.size > 0 and to.size > 0 and from[0] == to[0] do
    from.shift
    to.shift
  end

  from.fill ".."
  from.concat to
  from << to_file
  ::File.join(*from)
end