Sha256: 3324850d8039c2aa6ae1281f6a5807edab7bd4ecce93a1a4641bd296c41e6de2

Contents?: true

Size: 662 Bytes

Versions: 11

Compression:

Stored size: 662 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 `.swp` files."

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

11 entries across 11 versions & 1 rubygems

Version Path
githug-0.4.8 levels/ignore.rb
githug-0.4.7 levels/ignore.rb
githug-0.4.6 levels/ignore.rb
githug-0.4.5 levels/ignore.rb
githug-0.4.4 levels/ignore.rb
githug-0.4.3 levels/ignore.rb
githug-0.4.2 levels/ignore.rb
githug-0.4.1 levels/ignore.rb
githug-0.4.0 levels/ignore.rb
githug-0.3.5 levels/ignore.rb
githug-0.3.4 levels/ignore.rb