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.
27
28
29
30
31
32
33
34
|
# File 'lib/bitclust/subcommands/statichtml_command.rb', line 27
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.
25
26
27
|
# File 'lib/bitclust/subcommands/statichtml_command.rb', line 25
def bitclust_html_base
@bitclust_html_base
end
|
Instance Method Details
#canonical_url(current_url) ⇒ Object
89
90
91
|
# File 'lib/bitclust/subcommands/statichtml_command.rb', line 89
def canonical_url(current_url)
(@canonical_base_url + "/#{current_url}").sub(@bitclust_html_base, "").sub(/([^:])\/\/+/, "\\1/")
end
|
#class_url(name) ⇒ Object
44
45
46
|
# File 'lib/bitclust/subcommands/statichtml_command.rb', line 44
def class_url(name)
@bitclust_html_base + "/class/#{html_filename(encodename_package(name), @suffix)}"
end
|
65
66
67
|
# File 'lib/bitclust/subcommands/statichtml_command.rb', line 65
def css_url
@bitclust_html_base + "/" + @css_url
end
|
#custom_css_url(filename) ⇒ Object
69
70
71
|
# File 'lib/bitclust/subcommands/statichtml_command.rb', line 69
def custom_css_url(filename)
@bitclust_html_base + "/" + filename
end
|
#custom_js_url(filename) ⇒ Object
73
74
75
|
# File 'lib/bitclust/subcommands/statichtml_command.rb', line 73
def custom_js_url(filename)
@bitclust_html_base + "/" + filename
end
|
#document_url(name) ⇒ Object
60
61
62
63
|
# File 'lib/bitclust/subcommands/statichtml_command.rb', line 60
def document_url(name)
filename = html_filename(encodename_package(name), @suffix)
@bitclust_html_base + "/doc/#{filename}"
end
|
#edit_url(location) ⇒ Object
93
94
95
|
# File 'lib/bitclust/subcommands/statichtml_command.rb', line 93
def edit_url(location)
"#{@edit_base_url}/#{location.file}".sub(/([^:])\/\/+/, "\\1/")
end
|
#encodename_package(str) ⇒ Object
97
98
99
100
101
102
103
|
# File 'lib/bitclust/subcommands/statichtml_command.rb', line 97
def encodename_package(str)
if @fs_casesensitive
encodename_url(str)
else
encodename_fs(str)
end
end
|
#favicon_url ⇒ Object
77
78
79
|
# File 'lib/bitclust/subcommands/statichtml_command.rb', line 77
def favicon_url
@bitclust_html_base + "/" + @favicon_url
end
|
#function_index_url ⇒ Object
85
86
87
|
# File 'lib/bitclust/subcommands/statichtml_command.rb', line 85
def function_index_url
@bitclust_html_base + "/function/#{html_filename("index", @suffix)}"
end
|
#function_url(name) ⇒ Object
55
56
57
58
|
# File 'lib/bitclust/subcommands/statichtml_command.rb', line 55
def function_url(name)
filename = html_filename(name.empty? ? 'index' : name, @suffix)
@bitclust_html_base + "/function/#{filename}"
end
|
#library_index_url ⇒ Object
81
82
83
|
# File 'lib/bitclust/subcommands/statichtml_command.rb', line 81
def library_index_url
@bitclust_html_base + "/library/#{html_filename("index", @suffix)}"
end
|
#library_url(name) ⇒ Object
36
37
38
39
40
41
42
|
# File 'lib/bitclust/subcommands/statichtml_command.rb', line 36
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
48
49
50
51
52
53
|
# File 'lib/bitclust/subcommands/statichtml_command.rb', line 48
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
|