Class: Git::Pr::GitProperties
- Inherits:
-
Object
- Object
- Git::Pr::GitProperties
- Defined in:
- lib/git/pr/git_properties.rb
Instance Method Summary collapse
- #api_endpoint ⇒ Object
- #api_token ⇒ Object
- #base_branch ⇒ Object
- #current_branch ⇒ Object
- #login ⇒ Object
- #repository ⇒ Object
- #repository_profile(profile) ⇒ Object
Instance Method Details
#api_endpoint ⇒ Object
4 5 6 |
# File 'lib/git/pr/git_properties.rb', line 4 def api_endpoint `git config --get github.apiEndpoint`.chomp end |
#api_token ⇒ Object
8 9 10 |
# File 'lib/git/pr/git_properties.rb', line 8 def api_token `git config --get github.token`.chomp end |
#base_branch ⇒ Object
12 13 14 |
# File 'lib/git/pr/git_properties.rb', line 12 def base_branch 'master' end |
#current_branch ⇒ Object
16 17 18 |
# File 'lib/git/pr/git_properties.rb', line 16 def current_branch `git symbolic-ref HEAD`.split('/').last.chomp end |
#login ⇒ Object
24 25 26 |
# File 'lib/git/pr/git_properties.rb', line 24 def login `git config --get github.user`.chomp end |
#repository ⇒ Object
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 |