lib/codestatus/repositories/bitbucket_repository.rb in codestatus-0.1.2 vs lib/codestatus/repositories/bitbucket_repository.rb in codestatus-0.1.3

- old
+ new

@@ -1,16 +1,11 @@ require 'rest-client' module Codestatus module Repositories - class BitbucketRepository + class BitbucketRepository < Base BITBUCKET_API_ENDPOINT = 'https://api.bitbucket.org/2.0/' #repositories/atlassian/aui - def initialize(slug) - # 'atlassian/aui' - @slug = slug - end - # This combined status is generated by the rule of GitHub's # https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref def status(ref = main_branch) statuses = statuses(ref) @@ -28,10 +23,13 @@ end BuildStatus.new(sha: sha, status: state) end - attr_reader :slug + # https://bitbucket.org/atlassian/aui + def html_url + repository.dig('links', 'html', 'href') + end private def main_branch repository.dig('mainbranch', 'name')