Class: BitClust::Subcommands::StatichtmlCommand::URLMapperEx
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, display_typemark, 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, #js_url, #opensearchdescription_url, #search_url, #spec_url
Constructor Details
Returns a new instance of URLMapperEx.
28
29
30
31
32
33
34
35
|
# File 'lib/bitclust/subcommands/statichtml_command.rb', line 28
def initialize(h)
super
@bitclust_html_base = ""
@suffix = h[:suffix]
@fs_casesensitive = h[:fs_casesensitive]
@canonical_base_url = h[:canonical_base_url]
@edit_base_url = h[:edit_base_url]
end
|
Instance Attribute Details
#bitclust_html_base ⇒ Object
Returns the value of attribute bitclust_html_base.
26
27
28
|
# File 'lib/bitclust/subcommands/statichtml_command.rb', line 26
def bitclust_html_base
@bitclust_html_base
end
|
Instance Method Details
#canonical_url(current_url) ⇒ Object
90
91
92
|
# File 'lib/bitclust/subcommands/statichtml_command.rb', line 90
def canonical_url(current_url)
(@canonical_base_url + "/#{current_url}").sub(@bitclust_html_base, "").sub(/([^:])\/\/+/, "\\1/")
end
|
#class_url(name) ⇒ Object
45
46
47
|
# File 'lib/bitclust/subcommands/statichtml_command.rb', line 45
def class_url(name)
@bitclust_html_base + "/class/#{html_filename(encodename_package(name), @suffix)}"
end
|
66
67
68
|
# File 'lib/bitclust/subcommands/statichtml_command.rb', line 66
def css_url
@bitclust_html_base + "/" + @css_url
end
|
#custom_css_url(filename) ⇒ Object
70
71
72
|
# File 'lib/bitclust/subcommands/statichtml_command.rb', line 70
def custom_css_url(filename)
@bitclust_html_base + "/" + filename
end
|
#custom_js_url(filename) ⇒ Object
74
75
76
|
# File 'lib/bitclust/subcommands/statichtml_command.rb', line 74
def custom_js_url(filename)
@bitclust_html_base + "/" + filename
end
|
#document_url(name) ⇒ Object
61
62
63
64
|
# File 'lib/bitclust/subcommands/statichtml_command.rb', line 61
def document_url(name)
filename = html_filename(encodename_package(name), @suffix)
@bitclust_html_base + "/doc/#{filename}"
end
|
#edit_url(location) ⇒ Object
94
95
96
|
# File 'lib/bitclust/subcommands/statichtml_command.rb', line 94
def edit_url(location)
"#{@edit_base_url}/#{location.file}".sub(/([^:])\/\/+/, "\\1/")
end
|
#encodename_package(str) ⇒ Object
98
99
100
101
102
103
104
|
# File 'lib/bitclust/subcommands/statichtml_command.rb', line 98
def encodename_package(str)
if @fs_casesensitive
encodename_url(str)
else
encodename_fs(str)
end
end
|
#favicon_url ⇒ Object
78
79
80
|
# File 'lib/bitclust/subcommands/statichtml_command.rb', line 78
def favicon_url
@bitclust_html_base + "/" + @favicon_url
end
|
#function_index_url ⇒ Object
86
87
88
|
# File 'lib/bitclust/subcommands/statichtml_command.rb', line 86
def function_index_url
@bitclust_html_base + "/function/#{html_filename("index", @suffix)}"
end
|
#function_url(name) ⇒ Object
56
57
58
59
|
# File 'lib/bitclust/subcommands/statichtml_command.rb', line 56
def function_url(name)
filename = html_filename(name.empty? ? 'index' : name, @suffix)
@bitclust_html_base + "/function/#{filename}"
end
|
#library_index_url ⇒ Object
82
83
84
|
# File 'lib/bitclust/subcommands/statichtml_command.rb', line 82
def library_index_url
@bitclust_html_base + "/library/#{html_filename("index", @suffix)}"
end
|
#library_url(name) ⇒ Object
37
38
39
40
41
42
43
|
# File 'lib/bitclust/subcommands/statichtml_command.rb', line 37
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
49
50
51
52
53
54
|
# File 'lib/bitclust/subcommands/statichtml_command.rb', line 49
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
|