Class: Rubyzilla::Bug
- Inherits:
-
Object
- Object
- Rubyzilla::Bug
- Defined in:
- lib/rubyzilla/bug.rb
Instance Attribute Summary collapse
-
#alias ⇒ Object
Optional create parameters.
-
#assigned_to ⇒ Object
Optional create parameters.
-
#cc ⇒ Object
Optional create parameters.
-
#component ⇒ Object
String value component for creation.
-
#component_id ⇒ Object
Required create parameters.
-
#description ⇒ Object
Returns the value of attribute description.
-
#id ⇒ Object
Returns the value of attribute id.
-
#op_sys ⇒ Object
Defaulted create parameters.
-
#platform ⇒ Object
Defaulted create parameters.
-
#priority ⇒ Object
Defaulted create parameters.
-
#product_id ⇒ Object
Required create parameters.
-
#qa_contact ⇒ Object
Optional create parameters.
-
#severity ⇒ Object
Defaulted create parameters.
-
#status ⇒ Object
Optional create parameters.
-
#summary ⇒ Object
Required create parameters.
-
#target_milestone ⇒ Object
Returns the value of attribute target_milestone.
-
#version ⇒ Object
Required create parameters.
Instance Method Summary collapse
- #add_comment(comment) ⇒ Object
- #create ⇒ Object
-
#initialize(id = nil) ⇒ Bug
constructor
A new instance of Bug.
- #product ⇒ Object
- #product=(_product) ⇒ Object
Constructor Details
#initialize(id = nil) ⇒ Bug
Returns a new instance of Bug.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/rubyzilla/bug.rb', line 18 def initialize id=nil unless id.nil? result = Bugzilla.server.call("Bug.get_bugs", {:ids => [id]}) @product_id = result["bugs"][0]["internals"]["product_id"] @product = product @id = result["bugs"][0]["id"] @component_id = result["bugs"][0]["internals"]["component_id"] @summary = result["bugs"][0]["summary"] @version = result["bugs"][0]["internals"]["version"] @op_sys = result["bugs"][0]["internals"]["op_sys"] @platform = result["bugs"][0]["internals"]["rep_platform"] @priority = result["bugs"][0]["internals"]["priority"] @description = result["bugs"][0]["internals"]["short_desc"] @alias = result["bugs"][0]["alias"] @qa_contact = result["bugs"][0]["internals"]["qa_contact"] @status = result["bugs"][0]["internals"]["status_whiteboard"] @target_milestone = result["bugs"][0]["internals"]["target_milestone"] @severity = result["bugs"][0]["internals"]["bug_severity"] end return self end |
Instance Attribute Details
#alias ⇒ Object
Optional create parameters
15 16 17 |
# File 'lib/rubyzilla/bug.rb', line 15 def alias @alias end |
#assigned_to ⇒ Object
Optional create parameters
15 16 17 |
# File 'lib/rubyzilla/bug.rb', line 15 def assigned_to @assigned_to end |
#cc ⇒ Object
Optional create parameters
15 16 17 |
# File 'lib/rubyzilla/bug.rb', line 15 def cc @cc end |
#component ⇒ Object
String value component for creation
7 8 9 |
# File 'lib/rubyzilla/bug.rb', line 7 def component @component end |
#component_id ⇒ Object
Required create parameters
6 7 8 |
# File 'lib/rubyzilla/bug.rb', line 6 def component_id @component_id end |
#description ⇒ Object
Returns the value of attribute description.
12 13 14 |
# File 'lib/rubyzilla/bug.rb', line 12 def description @description end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/rubyzilla/bug.rb', line 3 def id @id end |
#op_sys ⇒ Object
Defaulted create parameters
11 12 13 |
# File 'lib/rubyzilla/bug.rb', line 11 def op_sys @op_sys end |
#platform ⇒ Object
Defaulted create parameters
11 12 13 |
# File 'lib/rubyzilla/bug.rb', line 11 def platform @platform end |
#priority ⇒ Object
Defaulted create parameters
11 12 13 |
# File 'lib/rubyzilla/bug.rb', line 11 def priority @priority end |
#product_id ⇒ Object
Required create parameters
6 7 8 |
# File 'lib/rubyzilla/bug.rb', line 6 def product_id @product_id end |
#qa_contact ⇒ Object
Optional create parameters
15 16 17 |
# File 'lib/rubyzilla/bug.rb', line 15 def qa_contact @qa_contact end |
#severity ⇒ Object
Defaulted create parameters
11 12 13 |
# File 'lib/rubyzilla/bug.rb', line 11 def severity @severity end |
#status ⇒ Object
Optional create parameters
15 16 17 |
# File 'lib/rubyzilla/bug.rb', line 15 def status @status end |
#summary ⇒ Object
Required create parameters
6 7 8 |
# File 'lib/rubyzilla/bug.rb', line 6 def summary @summary end |
#target_milestone ⇒ Object
Returns the value of attribute target_milestone.
16 17 18 |
# File 'lib/rubyzilla/bug.rb', line 16 def target_milestone @target_milestone end |
#version ⇒ Object
Required create parameters
6 7 8 |
# File 'lib/rubyzilla/bug.rb', line 6 def version @version end |
Instance Method Details
#add_comment(comment) ⇒ Object
79 80 81 82 83 |
# File 'lib/rubyzilla/bug.rb', line 79 def add_comment(comment) if Bugzilla.logged_in? Bugzilla.server.call("Bug.add_comment", {:id => id, :comment => comment}) end end |
#create ⇒ Object
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/rubyzilla/bug.rb', line 50 def create if Bugzilla.logged_in? parameters = { :product => @product, :component => @component, :summary => @summary || "", :version => @version || "unspecified", :op_sys => @op_sys || "Windows", :platform => @platform || "PC", :priority => @priority || "P5", } parameters.merge!({:severity => @severity}) if @severity parameters.merge!({:description => @description}) if @description parameters.merge!({:alias => @alias}) if @alias && @alias != "" parameters.merge!({:assigned_to => @assigned_to}) if @assigned_to parameters.merge!({:cc => @cc}) if @cc parameters.merge!({:qa_contact => @qa_contact}) if @qa_contact parameters.merge!({:status => @status}) if @status parameters.merge!({:target_milestone => @target_milestone}) if @target_milestone result = Bugzilla.server.call("Bug.create", parameters) @id = result["id"].to_i end return self end |
#product ⇒ Object
41 42 43 |
# File 'lib/rubyzilla/bug.rb', line 41 def product Product.new(@product_id) end |
#product=(_product) ⇒ Object
45 46 47 48 |
# File 'lib/rubyzilla/bug.rb', line 45 def product= _product @product_id = _product.id @product = _product.name end |