web/app/helpers/compare_helper.rb
author Marcel Hlopko <marcel.hlopko@gmail.com>
Tue, 25 Jun 2013 22:11:10 +0200
changeset 106 eac4098d544d
parent 95 5336c148406a
child 111 28dccacb2bc1
permissions -rw-r--r--
huge refactoring to better fit what we agreed on
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
91
d430a8ac253d comparison page kinda works
Marcel Hlopko <marcel.hlopko@gmail.com>
parents:
diff changeset
     1
module CompareHelper
d430a8ac253d comparison page kinda works
Marcel Hlopko <marcel.hlopko@gmail.com>
parents:
diff changeset
     2
106
eac4098d544d huge refactoring to better fit what we agreed on
Marcel Hlopko <marcel.hlopko@gmail.com>
parents: 95
diff changeset
     3
  def comparing_runtimes_headline(runtimes)
eac4098d544d huge refactoring to better fit what we agreed on
Marcel Hlopko <marcel.hlopko@gmail.com>
parents: 95
diff changeset
     4
    if runtimes.empty?
91
d430a8ac253d comparison page kinda works
Marcel Hlopko <marcel.hlopko@gmail.com>
parents:
diff changeset
     5
      "Nothing to compare"
106
eac4098d544d huge refactoring to better fit what we agreed on
Marcel Hlopko <marcel.hlopko@gmail.com>
parents: 95
diff changeset
     6
    elsif runtimes.size == 1
eac4098d544d huge refactoring to better fit what we agreed on
Marcel Hlopko <marcel.hlopko@gmail.com>
parents: 95
diff changeset
     7
      "Showing #{runtimes.first.name}"
91
d430a8ac253d comparison page kinda works
Marcel Hlopko <marcel.hlopko@gmail.com>
parents:
diff changeset
     8
    else
106
eac4098d544d huge refactoring to better fit what we agreed on
Marcel Hlopko <marcel.hlopko@gmail.com>
parents: 95
diff changeset
     9
      "Comparing #{runtimes.map(&:name)[0..-2].join(", ")} and #{runtimes[-1].name}"
91
d430a8ac253d comparison page kinda works
Marcel Hlopko <marcel.hlopko@gmail.com>
parents:
diff changeset
    10
    end
d430a8ac253d comparison page kinda works
Marcel Hlopko <marcel.hlopko@gmail.com>
parents:
diff changeset
    11
  end
d430a8ac253d comparison page kinda works
Marcel Hlopko <marcel.hlopko@gmail.com>
parents:
diff changeset
    12
d430a8ac253d comparison page kinda works
Marcel Hlopko <marcel.hlopko@gmail.com>
parents:
diff changeset
    13
end