class Getv::Package::GitHub::Commit

Getv::Package::GitHub::Commit class

Public Class Methods

new(name, opts = {}) click to toggle source
Calls superclass method Getv::Package::GitHub::new
# File lib/getv/package/github/commit.rb, line 8
def initialize(name, opts = {})
  opts = {
    branch: 'master',
    select_search: '^((\d{8})(\d{6}),(([a-z\d]{7})(.*)))$',
    semantic_only: false
  }.merge(opts)
  opts = defaults.merge(opts)
  opts = github_defaults(name).merge(opts)
  super name, opts
end

Private Instance Methods

retrieve_versions() click to toggle source
# File lib/getv/package/github/commit.rb, line 21
def retrieve_versions # rubocop:disable Metrics/AbcSize
  retries ||= 0
  github.commits("#{opts[:owner]}/#{opts[:repo]}", opts[:branch]).map do |c|
    "#{DateTime.parse(c[:commit][:author][:date].to_s).strftime('%Y%m%d%H%M%S')},#{c[:sha]}"
  end
rescue StandardError
  retry if (retries += 1) < 4
end