Class: Giteaucrat::Formatters::JavaFormatter
- Inherits:
-
Formatter
- Object
- SimpleDelegator
- Formatter
- Giteaucrat::Formatters::JavaFormatter
show all
- Defined in:
- lib/giteaucrat/formatters/java_formatter.rb
Constant Summary
collapse
%w[/* * */].freeze
- COPYRIGHT_REGEXP =
%r{/\*(?<ruler>\*+)\n(?<copyrights>(\s\*\s*[^\s\*]+.*\n)+)(\s\*\s*\*?\n(?<comment>(\s\*\s?.*\*?\n)+))?(\s\g<ruler>\**/\n+)}
Constants inherited
from Formatter
Formatter::HASHBANG_REGEXP
Instance Attribute Summary
Attributes inherited from Formatter
#comment_lines
Instance Method Summary
collapse
Methods inherited from Formatter
#add_copyright!, #comment?, #comment_parts, #format_copyright, #remove_copyright!, #ruler, #write_copyright!
Instance Method Details
26
27
28
|
# File 'lib/giteaucrat/formatters/java_formatter.rb', line 26
def (line_width)
" #{'*' * (line_width - 3)}*/"
end
|
18
19
20
|
# File 'lib/giteaucrat/formatters/java_formatter.rb', line 18
def format_line(line)
" * #{line} *"
end
|
22
23
24
|
# File 'lib/giteaucrat/formatters/java_formatter.rb', line 22
def (line_width)
"/*#{'*' * (line_width - 3)}"
end
|
30
31
32
33
34
35
|
# File 'lib/giteaucrat/formatters/java_formatter.rb', line 30
def ()
= .split("\n").map do |line|
line.sub(/\A\s\*\s?/, '').sub(/\s*\*\s*\Z/, '')
end
@comment_lines =
end
|