Class: XCPretty::RepoParser

Inherits:
Object
  • Object
show all
Defined in:
lib/xcpretty/reporters/learn.rb

Class Method Summary collapse

Class Method Details

.dieObject



150
151
152
# File 'lib/xcpretty/reporters/learn.rb', line 150

def self.die
  exit
end

.get_repoObject



137
138
139
140
141
142
143
144
145
146
147
148
# File 'lib/xcpretty/reporters/learn.rb', line 137

def self.get_repo
  begin
    repo = Git.open(File.expand_path(".", Dir.pwd))
  rescue
    puts "Not a valid Git repository"
    die
  end

  url = repo.remote.url

  repo_name = url.match(/(?:https:\/\/|git@).*\/(.+)(?:\.git)/)[1]
end