Sha256: 1877e8f7418224114f221626909fbce5478849d4e51f09e62f6314e130206907

Contents?: true

Size: 693 Bytes

Versions: 1

Compression:

Stored size: 693 Bytes

Contents

difficulty 2
description "The text editor 'vim' creates files ending in `.swp` (swap files) for all files that are currently open.  We don't want them creeping into the repository.  Make this repository ignore those swap files which are ending in `.swp`."

setup do
  repo.init
  FileUtils.touch("README.swp")
  file = File.open(".git/config", "w") do |file|
    file.puts "[core]\nexcludesfile="
  end
end

solution do

  valid = false


  File.open(".gitignore", "r") do |file|
    while line = file.gets
      if line.chomp == "*.swp"
        valid = true
      end
    end
  end

  valid
end

hint do
  puts "You may have noticed there is a file named `.gitignore` in the repository."
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
githug-0.5.0 levels/ignore.rb