Class: JenkinsApi::Client::PluginSettings::Hipchat
- Defined in:
- lib/improved_jenkins_client/plugin_settings/hipchat.rb
Instance Method Summary collapse
-
#configure(xml_doc) ⇒ Nokogiri::XML::Document
Create or Update a job with params given as a hash instead of the xml This gives some flexibility for creating/updating simple jobs so the user doesn’t have to learn about handling xml.
-
#initialize(params = {}) ⇒ Hipchat
constructor
A new instance of Hipchat.
Constructor Details
#initialize(params = {}) ⇒ Hipchat
Returns a new instance of Hipchat.
23 24 25 |
# File 'lib/improved_jenkins_client/plugin_settings/hipchat.rb', line 23 def initialize(params={}) @params = params end |
Instance Method Details
#configure(xml_doc) ⇒ Nokogiri::XML::Document
Create or Update a job with params given as a hash instead of the xml This gives some flexibility for creating/updating simple jobs so the user doesn’t have to learn about handling xml.
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/improved_jenkins_client/plugin_settings/hipchat.rb', line 34 def configure(xml_doc) xml_doc.tap do |doc| Nokogiri::XML::Builder.with(doc.at('properties')) do |properties| properties.send('jenkins.plugins.hipchat.HipChatNotifier_-HipChatJobProperty') do |x| x.room @params.fetch(:room) { '' } x.startNotification @params.fetch(:start_notification) { false } x.notifySuccess @params.fetch(:notify_success) { false } x.notifyAborted @params.fetch(:notify_aborted) { false } x.notifyNotBuilt @params.fetch(:notify_not_built) { false } x.notifyUnstable @params.fetch(:notify_unstable) { false } x.notifyFailure @params.fetch(:notify_failure) { false } x.notifyBackToNormal @params.fetch(:notify_back_to_normal) { false } end end end end |