Skip to content
This repository

Improved build message and sound for campfire hook #82

Closed
wants to merge 1 commit into from

1 participant

Marcelo Silveira
Marcelo Silveira
mhfs commented

Hey there,

I made a minor change to the campfire build message to make it clearer and strict to the point (at least for me) and added a vuvuzela sound to draw more attention to broken builds.

Not sure if you'll appreciate it, but here it goes. :)

Cheers!

Marcelo Silveira mhfs closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Aug 26, 2011
Marcelo Silveira mhfs better build message and sound for campfire 4fa5b2b
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 8 additions and 6 deletions. Show diff stats Hide diff stats

  1. +8 6 lib/big_tuna/hooks/campfire.rb
14 lib/big_tuna/hooks/campfire.rb
@@ -7,17 +7,18 @@ def build_fixed(build, config)
7 7 end
8 8
9 9 def build_still_fails(build, config)
10   - enqueue(config, full_msg(build, 'still fails'))
  10 + enqueue(config, full_msg(build, 'still fails'), "vuvuzela")
11 11 end
12 12
13 13 def build_failed(build, config)
14   - enqueue(config, full_msg(build, 'failed'))
  14 + enqueue(config, full_msg(build, 'failed'), "vuvuzela")
15 15 end
16 16
17 17 class Job
18   - def initialize(config, message)
  18 + def initialize(config, message, sound)
19 19 @config = config
20 20 @message = message
  21 + @sound = sound
21 22 end
22 23
23 24 def perform
@@ -29,17 +30,18 @@ def perform
29 30 :ssl => use_ssl)
30 31 room = campfire.find_room_by_name(@config['room'])
31 32 room.speak(@message)
  33 + room.play(@sound) if @sound
32 34 end
33 35 end
34 36 end
35 37
36 38 private
37   - def enqueue(config, message)
38   - Delayed::Job.enqueue(Job.new(config, message))
  39 + def enqueue(config, message, sound = nil)
  40 + Delayed::Job.enqueue(Job.new(config, message, sound))
39 41 end
40 42
41 43 def full_msg(build, status)
42   - "Build '#{build.display_name}' in '#{build.project.name}' #{status} (#{build_url(build)})"
  44 + "#{build.project.name} build ##{build.build_no} #{status} @ #{build.commit[0..6]} by #{build.author} (#{build_url(build)})"
43 45 end
44 46 end
45 47 end

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.