Class: Config

Inherits:
Object
  • Object
show all
Defined in:
lib/config.rb

Constant Summary collapse

REMOTE_NOT_FOUND =
"Can't find owner and repository. Make sure the remote name is correctly set on the configuration file.\n"

Class Method Summary collapse

Class Method Details

.get_owner_and_repoObject



19
20
21
22
# File 'lib/config.rb', line 19

def get_owner_and_repo
  url = `git config --get remote.#{remote}.url`.strip
  url[/:(.*)\.git/, 1] || raise(REMOTE_NOT_FOUND)
end

.remoteObject



15
16
17
# File 'lib/config.rb', line 15

def remote
  config['remote']
end

.tokenObject



11
12
13
# File 'lib/config.rb', line 11

def token
  config['token']
end

.userObject



7
8
9
# File 'lib/config.rb', line 7

def user
  config['user']
end