Class: GhBbAudit::Bitbucket::BitbucketUser

Inherits:
Object
  • Object
show all
Includes:
SemanticLogger::Loggable
Defined in:
lib/gh_bb_audit/bitbucket/bitbucket_user.rb

Instance Method Summary collapse

Constructor Details

#initialize(user_name) ⇒ BitbucketUser



8
9
10
# File 'lib/gh_bb_audit/bitbucket/bitbucket_user.rb', line 8

def initialize(user_name)
 @user_name = user_name
end

Instance Method Details

#public_reposObject



12
13
14
15
16
17
18
19
20
# File 'lib/gh_bb_audit/bitbucket/bitbucket_user.rb', line 12

def public_repos
  @public_repos ||= begin 
      response = ::BitBucket.new {|config| config.endpoint   = 'https://bitbucket.org/api/2.0'}.repos.public @user_name 
      response["values"].collect(&:name)
rescue StandardError => e
  logger.error "BITBUCKET:: Error in fetching repos for Bitbucket User:: #{@user_name} ", error: e.inspect
  []
end
end