Sha256: 775c769e3dc6bd5143c528fc1265cf86762607bd3312ad551e53f9793266cdc6

Contents?: true

Size: 953 Bytes

Versions: 2

Compression:

Stored size: 953 Bytes

Contents

require 'sweetie/helper'
require 'sweetie/bitbucket_stati_helper'
require 'json'

module Sweetie
  # The class to get the repositorie updates from Bitbucket
  class Bitbucket
    include Sweetie::Helper

    # A basic initialize method.
    #
    # @param bitbucket_stati_helper [BitbucketStatiHelper]
    # @return [BitbucketStatiHelper]
    def initialize(bitbucket_stati_helper)
      @bitbucket_stati_helper = bitbucket_stati_helper
    end

    # Wrapper to start all the other methods which will use methods
    # to write the changes of the bitbucket in the config file,
    # which can be configured in the BitbucketStatiHelper
    #
    # @return [nil]
    def update_stati
      json_repositories = @bitbucket_stati_helper.get_repositories
      repositories_change_hashs = @bitbucket_stati_helper.get_repositories_changes(json_repositories)
      @bitbucket_stati_helper.write_repository_changes(repositories_change_hashs)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sweetie-2.0.1 lib/sweetie/bitbucket.rb
sweetie-2.0.0 lib/sweetie/bitbucket.rb