summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormguetlein <martin.guetlein@gmail.com>2012-07-27 08:57:41 +0200
committermguetlein <martin.guetlein@gmail.com>2012-07-27 08:57:41 +0200
commit98fba00a45cf1d419afdb18c516c1b5c846899d4 (patch)
tree147891cf6559d47196c53fd80f204b485635c6b1
parent01026b43d8c1d86acb415e405a16fb874c437aff (diff)
latest task stuff
-rw-r--r--application.rb12
1 files changed, 3 insertions, 9 deletions
diff --git a/application.rb b/application.rb
index f119508..3f0fd84 100644
--- a/application.rb
+++ b/application.rb
@@ -78,15 +78,9 @@ get '/latest' do
running << t
end
end
- s = ""
- running.each do |t|
- s << "'#{t.uri}' --- '#{t.created_at}' --- '#{t.hasStatus}' --- '#{t.title}'\n"
- end
- if running.size==nil or running[-1]!=ts[-1]
- t = ts[-1]
- s << "'#{t.uri}' --- '#{t.created_at}' --- '#{t.hasStatus}' --- '#{t.title}'\n"
- end
- s
+ running.reverse!
+ running << ts[-1] if running.size==nil or running[-1]!=ts[-1]
+ running.collect{|t| "'#{t.uri}' --- '#{t.created_at}' --- '#{t.hasStatus}' --- '#{t.title}'"}.join("\n")+"\n"
end
# Get task representation