Top Level Namespace
Defined Under Namespace
Modules: Comment, Core, FileFinder, FileModification, HeaderDetector, HeaderGenerator, HeaderValidator, PrintUtils, Resources, TemplateUtils, XoltiVersion Classes: DefaultComment, PathRule, XoltiCLI, XoltiConfig
Instance Method Summary collapse
- #complex_comment(text, comment_tokens) ⇒ Object
- #parse_xoltignore(path) ⇒ Object
-
#simple_comment(text, comment_token) ⇒ Object
comment.rb Copyright © Rémi Even 2016.
Instance Method Details
#complex_comment(text, comment_tokens) ⇒ Object
22 23 24 25 26 27 |
# File 'lib/comment.rb', line 22 def complex_comment(text, comment_tokens) result = "#{comment_tokens[0]}\n" result << simple_comment(text, comment_tokens[1]) result << "#{comment_tokens[2]}\n" result end |
#parse_xoltignore(path) ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/file_finder.rb', line 21 def parse_xoltignore(path) xoltignore_path = "#{path}/.xoltignore" return [] if !File.file?(xoltignore_path) File.readlines(xoltignore_path) .reject {|line| line == "" || line[0] == "#"} .map {|line| line.chomp} .map {|line| PathRule.new(path, line)} end |
#simple_comment(text, comment_token) ⇒ Object
comment.rb Copyright © Rémi Even 2016
This file is part of Xolti.
Xolti is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Xolti is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Xolti. If not, see <www.gnu.org/licenses/>.
18 19 20 |
# File 'lib/comment.rb', line 18 def simple_comment(text, comment_token) text.lines.map{|line| "#{comment_token}#{line}".rstrip + "\n"}.join end |