Sha256: 764661d956f446eb54711c8e1477ef77a5c97264f12607bfa6d7bbff8d4b7be0
Contents?: true
Size: 588 Bytes
Versions: 18
Compression:
Stored size: 588 Bytes
Contents
require 'git' module LearnTest class RepoParser def self.get_repo begin repo = Git.open(FileUtils.pwd) rescue puts "You don't appear to be in a Learn lesson's directory. Please cd to an appropriate directory and try again." die end if url = repo.remote.url url.match(/(?:https:\/\/|git@).*\/(.+?)(?:\.git)?$/)[1] else puts "You don't appear to be in a Learn lesson's directory. Please cd to an appropriate directory and try again." die end end def self.die exit end end end
Version data entries
18 entries across 18 versions & 1 rubygems