Class: Pipeline::JiraReporter
- Inherits:
-
BaseReporter
- Object
- BaseReporter
- Pipeline::JiraReporter
- Defined in:
- lib/pipeline/reporters/jira_reporter.rb
Instance Attribute Summary collapse
-
#format ⇒ Object
Returns the value of attribute format.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize ⇒ JiraReporter
constructor
A new instance of JiraReporter.
- #report(finding) ⇒ Object
- #run_report(tracker) ⇒ Object
Methods inherited from BaseReporter
Constructor Details
#initialize ⇒ JiraReporter
Returns a new instance of JiraReporter.
12 13 14 15 |
# File 'lib/pipeline/reporters/jira_reporter.rb', line 12 def initialize() @name = "JiraReporter" @format = :to_jira end |
Instance Attribute Details
#format ⇒ Object
Returns the value of attribute format.
10 11 12 |
# File 'lib/pipeline/reporters/jira_reporter.rb', line 10 def format @format end |
#name ⇒ Object
Returns the value of attribute name.
10 11 12 |
# File 'lib/pipeline/reporters/jira_reporter.rb', line 10 def name @name end |
Instance Method Details
#report(finding) ⇒ Object
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/pipeline/reporters/jira_reporter.rb', line 29 def report(finding) json = get_jira_json(finding) http = Curl.post("#{@api}/issue/", json.to_s) do |http| http.headers['Content-Type'] = "application/json" http.headers['Cookie'] = @cookie end if http.response_code != 201 # Created ... Pipeline.error "Problem with HTTP #{http.response_code} - #{http.body_str}" end end |
#run_report(tracker) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/pipeline/reporters/jira_reporter.rb', line 17 def run_report(tracker) @project = tracker.[:jira_project.to_s] @api = tracker.[:jira_api_url.to_s] @cookie = tracker.[:jira_cookie.to_s] @component = tracker.[:jira_component.to_s] tracker.findings.each do |finding| report finding end "Results are in JIRA" end |