Class: Shiftzilla::Bug
- Inherits:
-
Object
- Object
- Shiftzilla::Bug
- Defined in:
- lib/shiftzilla/bug.rb
Instance Attribute Summary collapse
-
#component ⇒ Object
readonly
Returns the value of attribute component.
-
#cust_cases ⇒ Object
readonly
Returns the value of attribute cust_cases.
-
#first_seen ⇒ Object
readonly
Returns the value of attribute first_seen.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#last_seen ⇒ Object
readonly
Returns the value of attribute last_seen.
-
#ops_blocker ⇒ Object
readonly
Returns the value of attribute ops_blocker.
-
#owner ⇒ Object
readonly
Returns the value of attribute owner.
-
#pm_score ⇒ Object
readonly
Returns the value of attribute pm_score.
-
#test_blocker ⇒ Object
readonly
Returns the value of attribute test_blocker.
-
#tgt_release ⇒ Object
readonly
Returns the value of attribute tgt_release.
Instance Method Summary collapse
- #age ⇒ Object
-
#initialize(bzid, binfo) ⇒ Bug
constructor
A new instance of Bug.
- #semver ⇒ Object
- #summary ⇒ Object
- #update(binfo) ⇒ Object
Constructor Details
#initialize(bzid, binfo) ⇒ Bug
Returns a new instance of Bug.
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/shiftzilla/bug.rb', line 5 def initialize(bzid,binfo) @id = bzid @first_seen = binfo[:snapdate] @last_seen = binfo[:snapdate] @test_blocker = binfo[:test_blocker] @ops_blocker = binfo[:ops_blocker] @owner = binfo[:owner] @summary = binfo[:summary] @component = binfo[:component] @pm_score = binfo[:pm_score] @cust_cases = binfo[:cust_cases] @tgt_release = binfo[:tgt_release] end |
Instance Attribute Details
#component ⇒ Object (readonly)
Returns the value of attribute component.
3 4 5 |
# File 'lib/shiftzilla/bug.rb', line 3 def component @component end |
#cust_cases ⇒ Object (readonly)
Returns the value of attribute cust_cases.
3 4 5 |
# File 'lib/shiftzilla/bug.rb', line 3 def cust_cases @cust_cases end |
#first_seen ⇒ Object (readonly)
Returns the value of attribute first_seen.
3 4 5 |
# File 'lib/shiftzilla/bug.rb', line 3 def first_seen @first_seen end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/shiftzilla/bug.rb', line 3 def id @id end |
#last_seen ⇒ Object (readonly)
Returns the value of attribute last_seen.
3 4 5 |
# File 'lib/shiftzilla/bug.rb', line 3 def last_seen @last_seen end |
#ops_blocker ⇒ Object (readonly)
Returns the value of attribute ops_blocker.
3 4 5 |
# File 'lib/shiftzilla/bug.rb', line 3 def ops_blocker @ops_blocker end |
#owner ⇒ Object (readonly)
Returns the value of attribute owner.
3 4 5 |
# File 'lib/shiftzilla/bug.rb', line 3 def owner @owner end |
#pm_score ⇒ Object (readonly)
Returns the value of attribute pm_score.
3 4 5 |
# File 'lib/shiftzilla/bug.rb', line 3 def pm_score @pm_score end |
#test_blocker ⇒ Object (readonly)
Returns the value of attribute test_blocker.
3 4 5 |
# File 'lib/shiftzilla/bug.rb', line 3 def test_blocker @test_blocker end |
#tgt_release ⇒ Object (readonly)
Returns the value of attribute tgt_release.
3 4 5 |
# File 'lib/shiftzilla/bug.rb', line 3 def tgt_release @tgt_release end |
Instance Method Details
#age ⇒ Object
35 36 37 |
# File 'lib/shiftzilla/bug.rb', line 35 def age (@last_seen - @first_seen).to_i end |
#semver ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/shiftzilla/bug.rb', line 39 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 |
#summary ⇒ Object
31 32 33 |
# File 'lib/shiftzilla/bug.rb', line 31 def summary @summary[0..30].gsub(/\s\w+\s*$/, '...') end |
#update(binfo) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/shiftzilla/bug.rb', line 19 def update(binfo) @last_seen = binfo[:snapdate] @test_blocker = binfo[:test_blocker] @ops_blocker = binfo[:ops_blocker] @owner = binfo[:owner] @summary = binfo[:summary] @component = binfo[:component] @pm_score = binfo[:pm_score] @cust_cases = binfo[:cust_cases] @tgt_release = binfo[:tgt_release] end |