Class: Murdoc::Languages::Base
- Inherits:
-
Object
- Object
- Murdoc::Languages::Base
show all
- Defined in:
- lib/murdoc/languages/base.rb
Overview
Base language module
Any new language module should inherit from Base, redefine .extensions and .comment_symbols methods, if needed, and add itself to Languages.map map.
Class Method Summary
collapse
Class Method Details
.annotation_only? ⇒ Boolean
17
18
19
|
# File 'lib/murdoc/languages/base.rb', line 17
def self.annotation_only?
false
end
|
.applies_for?(filename) ⇒ Boolean
9
10
11
12
13
14
15
|
# File 'lib/murdoc/languages/base.rb', line 9
def self.applies_for?(filename)
if extensions.include?(File.extname(filename).sub(/^\./, ''))
true
else
false
end
end
|
25
26
27
28
29
30
|
# File 'lib/murdoc/languages/base.rb', line 25
def self.
{
single_line: nil,
multiline: nil
}
end
|
.extensions ⇒ Object
21
22
23
|
# File 'lib/murdoc/languages/base.rb', line 21
def self.extensions
[]
end
|
.name ⇒ Object
32
33
34
35
36
|
# File 'lib/murdoc/languages/base.rb', line 32
def self.name
super.sub(/^(.*::)?([^:]+)$/, '\\2').
gsub(/([a-z])([A-Z])/, '\\1_\\2').
downcase.to_sym
end
|