Class: Git::Pr::GitProperties

Inherits:
Object
  • Object
show all
Defined in:
lib/git/pr/git_properties.rb

Instance Method Summary collapse

Instance Method Details

#api_endpointObject



4
5
6
# File 'lib/git/pr/git_properties.rb', line 4

def api_endpoint
  `git config --get github.apiEndpoint`.chomp
end

#api_tokenObject



8
9
10
# File 'lib/git/pr/git_properties.rb', line 8

def api_token
  `git config --get github.token`.chomp
end

#base_branchObject



12
13
14
# File 'lib/git/pr/git_properties.rb', line 12

def base_branch
  'master'
end

#current_branchObject



16
17
18
# File 'lib/git/pr/git_properties.rb', line 16

def current_branch
  `git symbolic-ref HEAD`.split('/').last.chomp
end

#loginObject



24
25
26
# File 'lib/git/pr/git_properties.rb', line 24

def 
  `git config --get github.user`.chomp
end

#repositoryObject



20
21
22
# File 'lib/git/pr/git_properties.rb', line 20

def repository
  `git config --get remote.origin.url`.split(':').last.sub(/\.git/, '').chomp
end

#repository_profile(profile) ⇒ Object



28
29
30
# File 'lib/git/pr/git_properties.rb', line 28

def repository_profile(profile)
  `git config --get-all pr.repository_profile.#{profile}`.split(/\n/)
end