Skip to content

Instantly share code, notes, and snippets.

@halorgium
Created July 19, 2010 05:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save halorgium/cbc7380fa76685cc0f9f to your computer and use it in GitHub Desktop.
Save halorgium/cbc7380fa76685cc0f9f to your computer and use it in GitHub Desktop.
diff --git a/integrity/lib/integrity/app.rb b/integrity/lib/integrity/app.rb
index 6a9a5dd..7bf22a6 100644
--- a/integrity/lib/integrity/app.rb
+++ b/integrity/lib/integrity/app.rb
@@ -119,6 +119,12 @@ module Integrity
redirect build_url(@build).to_s
end
+ post "/:project/builds/:build/notify" do
+ login_required unless current_project.public?
+ current_build.notify
+ redirect build_url(current_build).to_s
+ end
+
delete "/:project/builds/:build" do
login_required
diff --git a/integrity/lib/integrity/build.rb b/integrity/lib/integrity/build.rb
index 75c4dcb..cb6902c 100644
--- a/integrity/lib/integrity/build.rb
+++ b/integrity/lib/integrity/build.rb
@@ -38,6 +38,10 @@ module Integrity
!pending? && !building?
end
+ def notify
+ project.enabled_notifiers.each { |n| n.notify_of_build(self) }
+ end
+
def status
case
when building? then :building
diff --git a/integrity/lib/integrity/builder.rb b/integrity/lib/integrity/builder.rb
index cb24f0c..3a7eb55 100644
--- a/integrity/lib/integrity/builder.rb
+++ b/integrity/lib/integrity/builder.rb
@@ -45,7 +45,7 @@ module Integrity
:output => @output
)
- @build.project.enabled_notifiers.each { |n| n.notify_of_build(@build) }
+ @build.notify
end
def <<(chunk)
diff --git a/integrity/views/build.haml b/integrity/views/build.haml
index caf2df8..11976a0 100644
--- a/integrity/views/build.haml
+++ b/integrity/views/build.haml
@@ -5,3 +5,8 @@
%p
%button{ :title => "Delete this build" }
Delete this build
+
+%form{ :action => build_path(@build, :notify), :method => :post }
+ %p
+ %button{ :title => "Notify of this build" }
+ Notify of this build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment