提交 236011c1 编写于 作者: K kohsuke

Switched to ruby and updated to create two images, in red and blue.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@13035 71c3de6d-444a-0410-be80-ed276b4c234a
上级 92e87f7e
#!/usr/bin/ruby
# width of the band
$u=20
$uu=$u*2
def make(step,color)
system "convert -size #{$uu}x8 xc:white -fill '#{color}' -stroke '#{color}' -draw \"polyline 0,#{$u-1} #{$u-1},0 #{$uu-1},0 #{$u},#{$u-1}\" -roll +#{step}+0 screen.#{step}.gif" or fail
end
colors = { "red" => "#cc0000", "blue" => "#3465a4" }
colors.keys.each do |name|
list = []
color = colors[name];
(0...$uu).each do |i|
make(i,color)
list << "screen.#{i}.gif"
end
system "convert -delay 10 #{list.join(" ")} -loop 0 progress-unknown-#{name}.gif" or fail
end
#!/bin/zsh -ex
KSH_ARRAYS=off
# width of the band
u=20
color="#3465a4"
U=$(($u*2))
make() {
convert -size ${U}x8 xc:white -fill $color -stroke $color -draw "polyline 0,$(($u-1)) $(($u-1)),0 $(($U-1)),0 $u,$(($u-1))" -roll +$1+0 screen.$1.gif
}
set -A list
for (( i=0 ; i<$U; i+=1 ))
do
make $i
list[$((${#list}+1))]=screen.$i.gif
done
convert -delay 10 ${list[@]} -loop 0 progress-unknown.gif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册