Sha256: b00d95fb3a5825eaec8f399db2770076febb36b836b0253016a96e1b7d8c14a2

Contents?: true

Size: 655 Bytes

Versions: 5

Compression:

Stored size: 655 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

5 entries across 5 versions & 1 rubygems

Version Path
githug-0.3.3 levels/ignore.rb
githug-0.3.2 levels/ignore.rb
githug-0.3.1 levels/ignore.rb
githug-0.3.0 levels/ignore.rb
githug-0.2.12 levels/ignore.rb