Class: OmgPullRequest::Prowl
- Inherits:
-
Object
- Object
- OmgPullRequest::Prowl
- Extended by:
- Configuration::Helpers
- Defined in:
- lib/omg_pull_request/prowl.rb
Constant Summary collapse
- PROWL_URL =
'https://api.prowlapp.com'
- PROWL_PATH =
'/publicapi/add'
Instance Attribute Summary collapse
-
#configuration ⇒ Object
Returns the value of attribute configuration.
-
#github_wrapper ⇒ Object
Returns the value of attribute github_wrapper.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#runner ⇒ Object
Returns the value of attribute runner.
Instance Method Summary collapse
- #alert_all_relevant_people!(message, event) ⇒ Object
- #alert_author!(message, event) ⇒ Object
-
#initialize(attributes = Hash.new) ⇒ Prowl
constructor
A new instance of Prowl.
- #notify_users(msg, keys = [], options = {}) ⇒ Object
Methods included from Configuration::Helpers
Constructor Details
#initialize(attributes = Hash.new) ⇒ Prowl
Returns a new instance of Prowl.
8 9 10 11 12 |
# File 'lib/omg_pull_request/prowl.rb', line 8 def initialize(attributes=Hash.new) attributes.each do |attr, value| self.send("#{attr}=", value) end end |
Instance Attribute Details
#configuration ⇒ Object
Returns the value of attribute configuration.
6 7 8 |
# File 'lib/omg_pull_request/prowl.rb', line 6 def configuration @configuration end |
#github_wrapper ⇒ Object
Returns the value of attribute github_wrapper.
6 7 8 |
# File 'lib/omg_pull_request/prowl.rb', line 6 def github_wrapper @github_wrapper end |
#logger ⇒ Object
Returns the value of attribute logger.
6 7 8 |
# File 'lib/omg_pull_request/prowl.rb', line 6 def logger @logger end |
#runner ⇒ Object
Returns the value of attribute runner.
6 7 8 |
# File 'lib/omg_pull_request/prowl.rb', line 6 def runner @runner end |
Instance Method Details
#alert_all_relevant_people!(message, event) ⇒ Object
28 29 30 31 32 33 |
# File 'lib/omg_pull_request/prowl.rb', line 28 def alert_all_relevant_people!(, event) notify_users(, all_keys, { :url => runner.pull_request.html_url, :event => event } ) end |
#alert_author!(message, event) ⇒ Object
35 36 37 38 39 40 |
# File 'lib/omg_pull_request/prowl.rb', line 35 def (, event) notify_users(, , { :url => runner.pull_request.html_url, :event => event }) end |
#notify_users(msg, keys = [], options = {}) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/omg_pull_request/prowl.rb', line 14 def notify_users(msg, keys=[], ={}) return if keys.blank? opts = { :application => prowl_application, :event => "notification", :description => msg }.merge( ) keys.each do |key| open_connection.post PROWL_PATH, opts.merge(:apikey => key) end end |