lib/grit/actor.rb in grit-2.4.1 vs lib/grit/actor.rb in grit-2.5.0
- old
+ new
@@ -32,16 +32,16 @@
#
# time - The Time the commit was authored or committed.
#
# Returns a String.
def output(time)
- out = @name.to_s.dup
- if @email
- out << " <#{@email}>"
- end
- hours = (time.utc_offset.to_f / 3600).to_i # 60 * 60, seconds to hours
- rem = time.utc_offset.abs % 3600
- out << " #{time.to_i} #{hours >= 0 ? :+ : :-}#{hours.abs.to_s.rjust(2, '0')}#{rem.to_s.rjust(2, '0')}"
+ offset = time.utc_offset / 60
+ "%s <%s> %d %+.2d%.2d" % [
+ @name,
+ @email || "null",
+ time.to_i,
+ offset / 60,
+ offset.abs % 60]
end
# Pretty object inspection
def inspect
%Q{#<Grit::Actor "#{@name} <#{@email}>">}