Skip to content

Instantly share code, notes, and snippets.

View kleb's full-sized avatar

Bil Kleb kleb

View GitHub Profile
@kleb
kleb / ccrb_image_render.patch
Created July 24, 2009 11:02
Cruisecontrol.rb hack to render images in Custom Build Artifacts section
diff --git a/app/views/builds/show.rhtml b/app/views/builds/show.rhtml
index 5eb9e48..adf274c 100644
--- a/app/views/builds/show.rhtml
+++ b/app/views/builds/show.rhtml
@@ -98,7 +98,7 @@
<% unless @build.additional_artifacts.empty? %>
<div class="section_open">
<div class="section_header" onclick="toggle_section(this.parentNode)">Custom Build Artifacts</div>
- <div class="section_content"><% @build.additional_artifacts.each do |artifact| %><div class="artifact"><%= link_to artifact, build_artifact_path(:project => @project.name, :build => @build.label, :path => artifact) %></div><% end %></div>
+ <div class="section_content"><% @build.additional_artifacts.each do |artifact| %><div class="artifact"><% artifact_path = build_artifact_path(:project => @project.name, :build => @build.label, :path => artifact) %><%= artifact.match(/.*\.(jpg|gif|png)$/) ? image_tag( artifact_path ) : link_to( artifact, artifact_path ) %></div><% end %></div>