Sha256: 2f91a3b69680f65d6a90db6555e34917bcdc5e8ea0bd780910903e2f8b41537e

Contents?: true

Size: 420 Bytes

Versions: 7

Compression:

Stored size: 420 Bytes

Contents

module Timetrap
  module Formatters
    require File.join( File.dirname(__FILE__), 'text' )

    class Factor < Text
      def initialize entries
        entries.map! do |e|
          factor = 1
          if e.note =~ /\bf(actor)?:([\d\.]+)\b/
            factor = $2.to_f
          end
          e.duration = (e.end_or_now.to_i - e.start.to_i) * factor
          e
        end
        super
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
timetrap-1.7.10 lib/timetrap/formatters/factor.rb
timetrap-1.7.9 lib/timetrap/formatters/factor.rb
timetrap-1.7.8 lib/timetrap/formatters/factor.rb
timetrap-1.7.7 lib/timetrap/formatters/factor.rb
timetrap-1.7.6 lib/timetrap/formatters/factor.rb
timetrap-1.7.5 lib/timetrap/formatters/factor.rb
timetrap-1.7.4 lib/timetrap/formatters/factor.rb