Sha256: fa5e5427f8eb11c005389e11b1c4ea70658bc2feb53c7bffa723c6a88a0ca75f

Contents?: true

Size: 903 Bytes

Versions: 9

Compression:

Stored size: 903 Bytes

Contents

difficulty 3
description "This is the final level, the goal is to contribute to this repository by making a pull request on Github.  Please note that this level is designed to encourage you to add a valid contribution to Githug, not testing your ability to create a pull request.  Contributions that are likely to be accepted are levels, bug fixes and improved documentation."

solution do
  location = "/tmp/githug"
  FileUtils.rm_rf(location)
  puts "Cloning repository to #{location}"
  `git clone https://github.com/Gazler/githug #{location}`

  contributor = false

  repo = Grit::Repo.new(location)
  repo.commits('master', false).each do |commit|
    if commit.author.name == repo.config["user.name"]
      if commit.author.email == repo.config["user.email"]
        contributor = true
      end
    end
  end
  contributor
end

hint do
  puts "Forking the repository would be a good start!"
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
githug-0.4.5 levels/contribute.rb
githug-0.4.4 levels/contribute.rb
githug-0.4.3 levels/contribute.rb
githug-0.4.2 levels/contribute.rb
githug-0.4.1 levels/contribute.rb
githug-0.4.0 levels/contribute.rb
githug-0.3.5 levels/contribute.rb
githug-0.3.4 levels/contribute.rb
githug-0.3.3 levels/contribute.rb