Sha256: 1eb980d98d7b4d1c5ffb994c8717ac834ce9fb589d54f4adc4f8d418b745ac88

Contents?: true

Size: 402 Bytes

Versions: 5

Compression:

Stored size: 402 Bytes

Contents

class Commit
  extend Forwardable
  def_delegators :@hash, :[]

  def initialize(hash)
    @hash = hash
  end

  def major?
    !!(self[:subject] =~ /breaking/i)
  end

  def patch?
    !!(self[:subject] =~ /\bfix\b/i) || !!(self[:subject] =~ /\bbugfix\b/i)
  end

  def minor?
    !(major? || patch?)
  end

  def color
    case true
    when major?
      :red
    else
      :grey
    end
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
cookbook-release-0.4.2 lib/cookbook-release/commit.rb
cookbook-release-0.4.1 lib/cookbook-release/commit.rb
cookbook-release-0.3.1 lib/cookbook-release/commit.rb
cookbook-release-0.3 lib/cookbook-release/commit.rb
cookbook-release-0.1 lib/cookbook-release/commit.rb