work_timer 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 322cdab8e3543e69cdc7938747e032924b28000561942194412494d8de818a88
4
- data.tar.gz: 76a10e5ba470b4e2bb6ca9994f64cf8f66afff2d3a2bd0009c8598a8d992b553
3
+ metadata.gz: 3117d2c46952fc1e87d53cc1cc25dd62b1606c20222b6a21c06deddcbd937ed4
4
+ data.tar.gz: 655bd1fd3490871081f86d48201bdcb567a7da094d336b80afe0366f241bd448
5
5
  SHA512:
6
- metadata.gz: f5aeb7253f8e14b3303af3ae96f24645537a4c40b9fe8c834152b4b227a1bb9b90a8f8ef0c640a3864e484416353b0b18979a4ca2aebb717fbe5b7705f5ac284
7
- data.tar.gz: 0a86992fe1a8d4cb847a11735f1bd4d972c882aa98c0705bae1e037e82ece0b0a61fb2861e68f7d6332c787bd3f8a789e05a6d5fcca522946be947f3f011d00c
6
+ metadata.gz: 5151c48038584a58c7db30733c1af5965542264eae1e1d8fe4fb8307539b344c4508ee8353cc04c29ae1632a36c32dc971cdd9b3135e9be8802a7580ec09cc53
7
+ data.tar.gz: bbd5c565e35ae45a846243f3880aaa5009b08cc50b53db7571a098fe34e098747653c97a61ad8c6e876a9d12ca1e2b2f2f3df284076382ffa39e5b9f4816d994
data/README.md CHANGED
@@ -1,8 +1,11 @@
1
- # WorkTimer
1
+ # work_timer
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/work_timer`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ [![Maintainability](https://api.codeclimate.com/v1/badges/c1aa0d29cfb926decd44/maintainability)](https://codeclimate.com/github/9sako6/work_timer/maintainability)
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
5
+
6
+ This gem measures the time.
7
+
8
+ ![demo](demo.gif)
6
9
 
7
10
  ## Installation
8
11
 
@@ -21,8 +24,21 @@ Or install it yourself as:
21
24
  $ gem install work_timer
22
25
 
23
26
  ## Usage
27
+ **Run:**
28
+
29
+ ```
30
+ $ work_timer
31
+ ```
32
+ If you don't specify a logfile, your working log is saved in ```work_timer_default.log```.
33
+
34
+ You can specify the file to save your log:
35
+ ```
36
+ $ work_timer <LOG_FILE_PATH>
37
+ ```
38
+
24
39
 
25
- TODO: Write usage instructions here
40
+ **Quit:**
41
+ input ```q```
26
42
 
27
43
  ## Development
28
44
 
@@ -32,7 +48,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
32
48
 
33
49
  ## Contributing
34
50
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/work_timer. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
51
+ Bug reports and pull requests are welcome on GitHub at https://github.com/9sako6/work_timer. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
36
52
 
37
53
  ## License
38
54
 
@@ -40,4 +56,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
40
56
 
41
57
  ## Code of Conduct
42
58
 
43
- Everyone interacting in the WorkTimer project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/work_timer/blob/master/CODE_OF_CONDUCT.md).
59
+ Everyone interacting in the WorkTimer project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/9sako6/work_timer/blob/master/CODE_OF_CONDUCT.md).
data/demo.gif ADDED
Binary file
data/exe/work_timer CHANGED
@@ -1,11 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require 'work_timer'
4
-
5
-
6
-
7
4
  require "io/console" # 改行なしで'q'を取得するのに必要
8
- # require_relative "./myWorkTimer"
9
5
 
10
6
  # 作業記録を保存するログファイル
11
7
  fileName = ARGV[0] ? ARGV[0] : "work_timer_default.log"
@@ -1,3 +1,3 @@
1
1
  module WorkTimer
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
data/lib/work_timer.rb CHANGED
@@ -1,11 +1,6 @@
1
1
  require "work_timer/version"
2
2
 
3
3
  module WorkTimer
4
- # Your code goes here...
5
- def self.greet
6
- 'Hello'
7
- end
8
-
9
4
  class Work
10
5
  def initialize(fileName)
11
6
  @fileName = fileName
@@ -41,8 +36,8 @@ module WorkTimer
41
36
 
42
37
  def record_time
43
38
  File.open(@fileName, "a+") do |f|
44
- # 標準で09:00:00となるのを00:00:00にするために60*60*15足してる
45
- workTime = (@endTime-@startTime.to_i+60*60*15).strftime("%T")
39
+ timezone = Time.now.strftime("%z").to_i/100
40
+ workTime = (@endTime-@startTime.to_i+60*60*(24-timezone)).strftime("%T")
46
41
  f.puts @startTime, @endTime, workTime
47
42
  end
48
43
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: work_timer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - 9sako6
@@ -72,6 +72,7 @@ files:
72
72
  - bin/console
73
73
  - bin/setup
74
74
  - bin/work_timer
75
+ - demo.gif
75
76
  - exe/work_timer
76
77
  - lib/work_timer.rb
77
78
  - lib/work_timer/version.rb