Created
April 4, 2012 17:06
-
-
Save no6v/2303881 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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