Sha256: 579c459213fffc3b96ca8ab1b65b4472f35f68c25ddd2fc2ce2528047a27d5b5

Contents?: true

Size: 555 Bytes

Versions: 9

Compression:

Stored size: 555 Bytes

Contents

difficulty 2
description "Notice a few files with the '.a' extension.  We want git to ignore all but the 'lib.a' file."

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

solution do
  entries = File.readlines('.gitignore').map(&:chomp)
  entries.include? '*.a' and entries.include? '!lib.a'
end

hint do
  puts "Using `git gitignore --help`, read about the optional prefix to negate a pattern."
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
mygithug-0.5.1 levels/include.rb
githug-0.5.0 levels/include.rb
githug-0.4.8 levels/include.rb
githug-0.4.7 levels/include.rb
githug-0.4.6 levels/include.rb
githug-0.4.5 levels/include.rb
githug-0.4.4 levels/include.rb
githug-0.4.3 levels/include.rb
githug-0.4.2 levels/include.rb