class Shiftzilla::Bug

Attributes

blocker_plus[R]
blocker_unknown[R]
component[R]
cust_cases[R]
first_seen[R]
id[R]
last_seen[R]
ops_blocker[R]
owner[R]
pm_score[R]
status[R]
summary[R]
test_blocker[R]
tgt_release[R]

Public Class Methods

new(bzid,binfo) click to toggle source
# File lib/shiftzilla/bug.rb, line 5
def initialize(bzid,binfo)
  @id              = bzid
  @first_seen      = binfo[:snapdate]
  @last_seen       = binfo[:snapdate]
  @blocker_plus    = binfo[:blocker_plus]
  @blocker_unknown = binfo[:blocker_unknown]
  @test_blocker    = binfo[:test_blocker]
  @ops_blocker     = binfo[:ops_blocker]
  @owner           = binfo[:owner]
  @summary         = binfo[:summary]
  @status          = binfo[:status]
  @component       = binfo[:component]
  @pm_score        = binfo[:pm_score]
  @cust_cases      = binfo[:cust_cases]
  @tgt_release     = binfo[:tgt_release]
end

Public Instance Methods

age() click to toggle source
# File lib/shiftzilla/bug.rb, line 37
def age
  (@last_seen - @first_seen).to_i
end
semver() click to toggle source
# File lib/shiftzilla/bug.rb, line 41
def semver
  parts = @tgt_release.split('.')
  if parts.length == 1
    return @tgt_release
  end
  semver = ''
  first_part = true
  parts.each do |part|
    unless is_number?(part)
      semver += part
    else
      semver += ("%09d" % part).to_s
    end
    # A version like '3.z' gets a middle 0 for sort purposes.
    if first_part and parts.length == 2
      semver += ("%09d" % 0).to_s
    end
    first_part = false
  end
  return semver
end
update(binfo) click to toggle source
# File lib/shiftzilla/bug.rb, line 22
def update(binfo)
  @last_seen       = binfo[:snapdate]
  @blocker_plus    = binfo[:blocker_plus]
  @blocker_unknown = binfo[:blocker_unknown]
  @test_blocker    = binfo[:test_blocker]
  @ops_blocker     = binfo[:ops_blocker]
  @owner           = binfo[:owner]
  @summary         = binfo[:summary]
  @status          = binfo[:status]
  @component       = binfo[:component]
  @pm_score        = binfo[:pm_score]
  @cust_cases      = binfo[:cust_cases]
  @tgt_release     = binfo[:tgt_release]
end

Private Instance Methods

is_number?(val) click to toggle source
# File lib/shiftzilla/bug.rb, line 65
def is_number?(val)
  val.to_f.to_s == val.to_s || val.to_i.to_s == val.to_s
end