From 8731f72562481d8bab2a3995f439c58cc250ebbb Mon Sep 17 00:00:00 2001 From: Duncan Robertson Date: Fri, 24 Jan 2014 13:27:11 +0000 Subject: [PATCH] voet bug fix --- Rakefile | 2 +- app/_views/vote_metrics_view.rb | 10 +++++++--- release_notes.html | 4 ++-- releases.xml | 11 +++++------ 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/Rakefile b/Rakefile index f24b8de..b0b641d 100644 --- a/Rakefile +++ b/Rakefile @@ -25,7 +25,7 @@ Motion::Project::App.setup do |app| app.sparkle do release :base_url, 'https://raw.github.com/kyan/kyan_bar/master' - release :version, '1.2.1' + release :version, '1.2.2' # Optional settings release :feed_filename, 'releases.xml' diff --git a/app/_views/vote_metrics_view.rb b/app/_views/vote_metrics_view.rb index 0d9f3b8..2917021 100644 --- a/app/_views/vote_metrics_view.rb +++ b/app/_views/vote_metrics_view.rb @@ -77,7 +77,7 @@ def draw_vote_txt end def draw_uvotes - if rating.positive_ratings.empty? + if blank?(rating.positive_ratings) ''.attrd else "▲".attrd({ @@ -92,7 +92,7 @@ def draw_uvotes end def draw_dvotes - if rating.negative_ratings.empty? + if blank?(rating.negative_ratings) ''.attrd else "▼".attrd({ @@ -115,6 +115,10 @@ def no_vote_txt def no_votes? return true if rating.nil? - rating.positive_ratings.empty? && rating.negative_ratings.empty? + blank?(rating.positive_ratings) && blank?(rating.negative_ratings) + end + + def blank?(str) + str.respond_to?(:empty?) ? str.empty? : !str end end \ No newline at end of file diff --git a/release_notes.html b/release_notes.html index 00649a0..dd23693 100644 --- a/release_notes.html +++ b/release_notes.html @@ -1,6 +1,6 @@ -KyanBar - version 1.2.1 +KyanBar - version 1.2.2 ----------------------- Updates: -* Bug Fix +* Bug Fix for vote bug \ No newline at end of file diff --git a/releases.xml b/releases.xml index e2e3a1b..e3679c4 100644 --- a/releases.xml +++ b/releases.xml @@ -14,24 +14,23 @@ en - Fri, 24 Jan 2014 09:44:31 +0000 + Fri, 24 Jan 2014 13:23:30 +0000 - KyanBar 1.2.1 + KyanBar 1.2.2 - Fri, 24 Jan 2014 09:44:31 +0000 + Fri, 24 Jan 2014 13:23:30 +0000 - KyanBar-1.2.1 + KyanBar-1.2.2 https://raw.github.com/kyan/kyan_bar/master/release_notes.html - + -