Sha256: f54070391aa077502cd75022251616e40cc61a99acaf327c34bf5e92324267aa

Contents?: true

Size: 714 Bytes

Versions: 1

Compression:

Stored size: 714 Bytes

Contents

#!/usr/bin/env ruby

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

def setWork(myWorkObj)
  # 作業時間をリアルタイム表示
  myWorkObj.view
  myWorkObj.start_work
  # 'q'が入力されたら作業時間カウント終了
  while STDIN.getch != 'q'; end
  puts
  myWorkObj.end_work
end

if ARGV[0]
  # 作業記録を保存するログファイル
  fileName = ARGV[0]
  myWork = WorkTimer::Work.new(fileName)
  puts "quit : 'q'"
  puts "total: " + myWork.total_time
  setWork(myWork)
  puts "save : " + fileName
  myWork.record_time
  puts "total: " + myWork.total_time
else
  myWork = WorkTimer::Work.new("EMPTY")
  puts "quit : 'q'"
  setWork(myWork)
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
work_timer-0.2.0 exe/work_timer