Class: BitClust::Subcommands::StatichtmlCommand::URLMapperEx

Inherits:
URLMapper show all
Includes:
NameUtils
Defined in:
lib/bitclust/subcommands/statichtml_command.rb

Constant Summary

Constants included from NameUtils

NameUtils::CHAR_TO_MARK, NameUtils::CHAR_TO_NAME, NameUtils::CLASS_NAME_RE, NameUtils::CLASS_PATH_RE, NameUtils::CONST_PATH_RE, NameUtils::CONST_RE, NameUtils::GVAR_RE, NameUtils::LIBNAME_RE, NameUtils::MARK_TO_CHAR, NameUtils::MARK_TO_NAME, NameUtils::METHOD_NAME_RE, NameUtils::METHOD_SPEC_RE, NameUtils::MID, NameUtils::NAME_TO_CHAR, NameUtils::NAME_TO_MARK, NameUtils::TYPEMARK_RE

Instance Attribute Summary collapse

Attributes inherited from URLMapper

#base_url

Instance Method Summary collapse

Methods included from NameUtils

build_method_id, classid2name, classname2id, classname?, decodeid, decodename_fs, decodename_url, encodeid, encodename_fs, encodename_rdocurl, encodename_url, functionname?, gvarname?, html_filename, libid2name, libname2id, libname?, method_spec?, methodid2classid, methodid2libid, methodid2mname, methodid2specparts, methodid2specstring, methodid2typechar, methodid2typemark, methodid2typename, methodname?, split_method_id, split_method_spec, typechar2mark, typechar2name, typechar?, typemark2char, typemark2name, typemark?, typename2char, typename2mark, typename?

Methods inherited from URLMapper

#cgi_url, #custom_css_url, #custom_js_url, #js_url, #opensearchdescription_url, #search_url, #spec_url

Constructor Details

#initialize(h) ⇒ URLMapperEx

Returns a new instance of URLMapperEx.


25
26
27
28
29
# File 'lib/bitclust/subcommands/statichtml_command.rb', line 25

def initialize(h)
  super
  @bitclust_html_base = ""
  @suffix = h[:suffix]
end

Instance Attribute Details

#bitclust_html_baseObject

Returns the value of attribute bitclust_html_base


23
24
25
# File 'lib/bitclust/subcommands/statichtml_command.rb', line 23

def bitclust_html_base
  @bitclust_html_base
end

Instance Method Details

#class_url(name) ⇒ Object


39
40
41
# File 'lib/bitclust/subcommands/statichtml_command.rb', line 39

def class_url(name)
  @bitclust_html_base + "/class/#{html_filename(encodename_package(name), @suffix)}"
end

#css_urlObject


60
61
62
# File 'lib/bitclust/subcommands/statichtml_command.rb', line 60

def css_url
  @bitclust_html_base + "/" + @css_url
end

#document_url(name) ⇒ Object


55
56
57
58
# File 'lib/bitclust/subcommands/statichtml_command.rb', line 55

def document_url(name)
  filename = html_filename(encodename_package(name), @suffix)
  @bitclust_html_base + "/doc/#{filename}"
end

#encodename_package(str) ⇒ Object


76
77
78
79
80
81
82
# File 'lib/bitclust/subcommands/statichtml_command.rb', line 76

def encodename_package(str)
  if @fs_casesensitive
    encodename_url(str)
  else
    encodename_fs(str)
  end
end

#favicon_urlObject


64
65
66
# File 'lib/bitclust/subcommands/statichtml_command.rb', line 64

def favicon_url
  @bitclust_html_base + "/" + @favicon_url
end

#function_index_urlObject


72
73
74
# File 'lib/bitclust/subcommands/statichtml_command.rb', line 72

def function_index_url
  @bitclust_html_base + "/function/#{html_filename("index", @suffix)}"
end

#function_url(name) ⇒ Object


50
51
52
53
# File 'lib/bitclust/subcommands/statichtml_command.rb', line 50

def function_url(name)
  filename = html_filename(name.empty? ? 'index' : name, @suffix)
  @bitclust_html_base + "/function/#{filename}"
end

#library_index_urlObject


68
69
70
# File 'lib/bitclust/subcommands/statichtml_command.rb', line 68

def library_index_url
  @bitclust_html_base + "/library/#{html_filename("index", @suffix)}"
end

#library_url(name) ⇒ Object


31
32
33
34
35
36
37
# File 'lib/bitclust/subcommands/statichtml_command.rb', line 31

def library_url(name)
  if name == '/'
    @bitclust_html_base + "/library/#{html_filename("index", @suffix)}"
  else
    @bitclust_html_base + "/library/#{html_filename(encodename_package(name), @suffix)}"
  end
end

#method_url(spec) ⇒ Object


43
44
45
46
47
48
# File 'lib/bitclust/subcommands/statichtml_command.rb', line 43

def method_url(spec)
  cname, tmark, mname = *split_method_spec(spec)
  filename = html_filename(encodename_package(mname), @suffix)
  @bitclust_html_base +
    "/method/#{encodename_package(cname)}/#{typemark2char(tmark)}/#{filename}"
end