class Matrixeval::Gitignore
Public Class Methods
update()
click to toggle source
# File lib/matrixeval/gitignore.rb, line 5 def update ignore_paths.map do |path| ignore(path) end end
Private Class Methods
docker_compose()
click to toggle source
# File lib/matrixeval/gitignore.rb, line 17 def docker_compose ".matrixeval/docker-compose" end
gitignore_path()
click to toggle source
# File lib/matrixeval/gitignore.rb, line 34 def gitignore_path Matrixeval.working_dir.join(".gitignore") end
ignore(path)
click to toggle source
# File lib/matrixeval/gitignore.rb, line 21 def ignore(path) return if ignored?(path) File.open(gitignore_path, 'a+') do |file| file.puts path end end
ignore_paths()
click to toggle source
# File lib/matrixeval/gitignore.rb, line 13 def ignore_paths [docker_compose] + Config.target.gitignore_paths end
ignored?(path)
click to toggle source
# File lib/matrixeval/gitignore.rb, line 29 def ignored?(path) File.exist?(gitignore_path) && File.read(gitignore_path).include?(path) end