Class: Chef::Taste::Changelog

Inherits:
Object
  • Object
show all
Defined in:
lib/chef/taste/changelog.rb

Overview

The Changelog class that computes the changelog if the current version being used and the latest version are different and the changelog is computable.

Defined Under Namespace

Classes: GithubChangelog

Class Method Summary collapse

Class Method Details

.compute(dep) ⇒ String

Compute the changelog for the dependent cookbook if available

Parameters:

Returns:

  • (String)

    the goo.gl shortened URL for the changelog



41
42
43
44
45
46
47
48
49
# File 'lib/chef/taste/changelog.rb', line 41

def compute(dep)
  changelog_url =
    if dep.source_url =~ /^(https?:\/\/)?github.com\/(.*)\/(.*)$/
      GithubChangelog.new("#{$2}/#{$3}", dep.version_used, dep.latest).compute
    else
      nil
    end
  Googl.shorten(changelog_url).short_url unless changelog_url.nil?
end