class Jigit::GitIgnoreUpdater

Public Class Methods

new(git_ignore_path = nil) click to toggle source
# File lib/jigit/git/git_ignore_updater.rb, line 3
def initialize(git_ignore_path = nil)
  @gitignore_path = git_ignore_path ? git_ignore_path : default_gitignore_path
  raise "Gitignore file at #{@gitignore_path} is not found" unless @gitignore_path
end

Public Instance Methods

ignore(line_to_ignore) click to toggle source
# File lib/jigit/git/git_ignore_updater.rb, line 8
def ignore(line_to_ignore)
  File.open(@gitignore_path, "a") do |f|
    f.puts(line_to_ignore)
  end
end

Private Instance Methods

default_gitignore_path() click to toggle source
# File lib/jigit/git/git_ignore_updater.rb, line 16
def default_gitignore_path
  ".gitignore"
end