working_times 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d7f861b6d069c98c721f784c070580e7efb63b8baab5b06a733fc0980c5f3941
4
- data.tar.gz: a3d57ff57872617ae48d91996ddaa467ed59360dd2b2d84e2c71712d4ac3abe3
3
+ metadata.gz: ea7930ce97b0d9bf4dfe1701ebd4e3d5ded07667df481b958aed921f2e36308f
4
+ data.tar.gz: 203cf6b53153ef66075511d5c4dae8ad0c8e4c65021ac11340c3ba95d7c570d4
5
5
  SHA512:
6
- metadata.gz: 2ac7a9a05d3287aaa5239fbb7f1dd3825248131005a6bdeeb1d6430ad69e0d6395abe34c83b6ebee3ed446154b5a122d1d52410461afcf4c228fc10772dfc90b
7
- data.tar.gz: 7283bbe673a2d3e7c0d00f3a10a3f1399a9a4ba419c95a39ff962fc1a734c0e3a9d9f0f8e40cde65c913aa34545347c395fa6c8c1c2f65627d9832a8e85b2548
6
+ metadata.gz: fb884f67fb32060175ab4f4822dca3b7978c0d64ada4621caf02e255abc954f3cc9d147365357fa0d1a3da6714c16f6118f86b9ca0b315ec04c535642586b526
7
+ data.tar.gz: a1dd2d5c5f2ce754b75e2b2d6aeabf98b48fc90ef4d56244098d820011bd296543ea45ab9d159a08df65ebda04171f3b52bd0211e1f4263923dec5b412cd4238
@@ -12,7 +12,7 @@ module WorkingTimes
12
12
  Record.new(timestamp: Time.now, comment: comment, work_on: work_on).start
13
13
  end
14
14
 
15
- desc 'st [COMMENT]', 'Short hand for *start*'
15
+ desc 'st [COMMENT] <option>', 'Short hand for *start*'
16
16
  alias st start
17
17
 
18
18
  desc 'finish [COMMENT]', 'Finish working on current group.'
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WorkingTimes
4
+ VERSION = '0.2.0'
5
+
6
+ START_MSG = [
7
+ 'Have a nice work!',
8
+ 'Have a nice day!'
9
+ ].freeze
10
+
11
+ FINISH_MSG = [
12
+ 'Great job!',
13
+ 'Time to beer!'
14
+ ].freeze
15
+ end
@@ -14,7 +14,7 @@ module WorkingTimes
14
14
 
15
15
  def start
16
16
  if State.working?
17
- puts "You are already on working at #{current_work}."
17
+ puts "You are already on working at #{State.current_work}."
18
18
  puts "To finish this, execute 'wt finish'."
19
19
  return
20
20
  end
@@ -26,13 +26,17 @@ module WorkingTimes
26
26
  end
27
27
 
28
28
  # create ~/.wt/.working include what you working on
29
+ # and show 'started' message
29
30
  def start_work(work_on)
30
31
  File.open("#{Config.data_dir}/.working", 'w+') { |f| f.puts work_on }
32
+ puts START_MSG.sample
31
33
  end
32
34
 
33
35
  # delete 'working' flag
36
+ # and show 'finished' message
34
37
  def finish_work
35
38
  File.delete("#{Config.data_dir}/.working")
39
+ puts FINISH_MSG.sample
36
40
  end
37
41
  end
38
42
  end
data/lib/working_times.rb CHANGED
@@ -1,4 +1,4 @@
1
- require 'working_times/version'
1
+ require 'working_times/constants'
2
2
  require 'working_times/config'
3
3
  require 'working_times/state'
4
4
  require 'working_times/record'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: working_times
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aoshi Fujioka
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-08-19 00:00:00.000000000 Z
11
+ date: 2019-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -92,9 +92,9 @@ files:
92
92
  - lib/working_times.rb
93
93
  - lib/working_times/cli.rb
94
94
  - lib/working_times/config.rb
95
+ - lib/working_times/constants.rb
95
96
  - lib/working_times/record.rb
96
97
  - lib/working_times/state.rb
97
- - lib/working_times/version.rb
98
98
  homepage: https://github.com/arsley/working_times
99
99
  licenses:
100
100
  - MIT
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module WorkingTimes
4
- VERSION = '0.1.1'
5
- end