Class: CC::Service::Lighthouse
- Inherits:
-
CC::Service
- Object
- CC::Service
- CC::Service::Lighthouse
- Defined in:
- lib/cc/services/lighthouse.rb
Defined Under Namespace
Classes: Config
Constant Summary
Constants inherited from CC::Service
ABSTRACT_SLUGS, ALL_EVENTS, ConfigurationError, Error
Constants included from Helper
Helper::GREEN_HEX, Helper::RED_HEX
Constants included from HTTP
Instance Attribute Summary
Attributes inherited from CC::Service
Instance Method Summary collapse
- #receive_issue ⇒ Object
- #receive_quality ⇒ Object
- #receive_test ⇒ Object
- #receive_vulnerability ⇒ Object
Methods inherited from CC::Service
by_slug, inherited, #initialize, load_services, #receive, services, slug
Methods included from Helper
#changed, #color, #compare_url, #details_url, #emoji, #hex_color, #improved?, #repo_name
Methods included from HTTP
#ca_file, #formatted_post_response, #http, #http_method, #raw_get, #raw_post, #service_get, #service_post, #service_post_with_redirects
Constructor Details
This class inherits a constructor from CC::Service
Instance Method Details
#receive_issue ⇒ Object
36 37 38 39 40 41 42 |
# File 'lib/cc/services/lighthouse.rb', line 36 def receive_issue title = %(Fix "#{issue["check_name"]}" issue in #{constant_name}) body = [issue["description"], details_url].join("\n\n") create_ticket(title, body) end |
#receive_quality ⇒ Object
32 33 34 |
# File 'lib/cc/services/lighthouse.rb', line 32 def receive_quality create_ticket(quality_title, details_url) end |
#receive_test ⇒ Object
25 26 27 28 29 30 |
# File 'lib/cc/services/lighthouse.rb', line 25 def receive_test result = create_ticket("Test ticket from Code Climate", "") result.merge( message: "Ticket <a href='#{result[:url]}'>#{result[:id]}</a> created.", ) end |
#receive_vulnerability ⇒ Object
44 45 46 47 48 49 50 51 |
# File 'lib/cc/services/lighthouse.rb', line 44 def receive_vulnerability formatter = CC::Formatters::TicketFormatter.new(self) create_ticket( formatter.format_vulnerability_title, formatter.format_vulnerability_body, ) end |