Skip to content

Instantly share code, notes, and snippets.

@no6v
Created April 4, 2012 17:06
Show Gist options
  • Save no6v/2303881 to your computer and use it in GitHub Desktop.
Save no6v/2303881 to your computer and use it in GitHub Desktop.
diff --git a/lib/earthquake/output.rb b/lib/earthquake/output.rb
index a5a19dc..41956e5 100644
--- a/lib/earthquake/output.rb
+++ b/lib/earthquake/output.rb
@@ -30,12 +30,14 @@ module Earthquake
end
def puts_items(items)
- mark_color = config[:colors].sample + 10
+ colors = config[:colors]
+ size = colors.size
[items].flatten.reverse_each do |item|
next if output_filters.any? { |f| f.call(item) == false }
- if item["text"] && !item["_stream"]
+ if item["id"] && item["text"] && !item["_stream"]
+ mark_color = colors.at(item["id"] % size) + 10
item['_mark'] = ' '.c(mark_color) + item['_mark'].to_s
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment