Sha256: 55e46bcc358f6ad90c96385f0b103376a359f04eaba273032db185944f52a0b0

Contents?: true

Size: 770 Bytes

Versions: 2

Compression:

Stored size: 770 Bytes

Contents

#!/usr/bin/env ruby

require 'work_timer'
require "io/console" # 改行なしで'q'を取得するのに必要

def setWork(workObj, fileName="Nil", logFlag=false)
  puts "quit : 'q'"
  puts "total: " + workObj.total_time if logFlag
  # 作業時間をリアルタイム表示
  workObj.view
  workObj.start_work
  # 'q'が入力されたら作業時間カウント終了
  while STDIN.getch != 'q'; end
  puts
  workObj.end_work
  if logFlag
    puts "save : " + fileName
    workObj.record_time
    puts "total: " + workObj.total_time
  end
end

if ARGV[0]
  # 作業記録を保存するログファイル
  fileName = ARGV[0]
  myWork = WorkTimer::Work.new(fileName)
  setWork(myWork, fileName, true)
else
  myWork = WorkTimer::Work.new("Nil")
  setWork(myWork)
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
work_timer-0.2.2 exe/work_timer
work_timer-0.2.1 exe/work_timer