konkit_worklogger 0.1.0 → 0.1.3

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: e32fb8f5819a91cc824775e141bf9024ba48693b7996ca2db32c4498d95d8e76
4
- data.tar.gz: c86267887802a77e7e066d4ed0893128fd54af7c9b0b7c011fc2a53c1b050b1a
3
+ metadata.gz: 3cf49d4918f2364b8a2836f73f6c36ab84ec0d04ab27c1ed501b85a29ae6260d
4
+ data.tar.gz: b81363e32f818f83267965c17572ad65df6273de073b88debb082ad5fa438ef1
5
5
  SHA512:
6
- metadata.gz: 5af58d33ff266cd36ea0c5cb6b7cc6616d7dd21e644a014b0eac70376ec0b1e8c8d025ae4b235bebfcc32ebeca74d6c7ece49657db28b2cd9fcf1e631b504628
7
- data.tar.gz: a6fa0033fb081ffd0bcff35ab2688d00899b677e734a96e65b593315bb8628a9f3400ad5eeb8ab4d9e4d28f0c02c6fd2b0596f66825022526e9c32d81976a343
6
+ metadata.gz: cf314df990e17989eaf777a82ea72e2f1215bd396dca2a3a58eaca0f481a65496bebf7d477f93b87534a523f1845ddf7bf5bb53eb4b9b873e911f63ef43d7d4e
7
+ data.tar.gz: b8b023f165c60a6d6e5714a01dd8ff901a08571285989f90337d129e2f4214441f2fe6df27a1d22531b0cb78d0fa6b1c9c4df6db696323346f01c7a5f4bcd8c4
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- konkit_worklogger (0.1.0)
4
+ konkit_worklogger (0.1.3)
5
5
  thor (~> 1.0)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -9,3 +9,61 @@ Therefore all you need to care about is to turn your computer off when you finis
9
9
  Under the hood, it writes a new line to a file each minute (scheduled by cron).
10
10
  Then, it gathers all those "minutes" to calculate your work time.
11
11
  Because of that, it works even if you have to pause the work for some time - you just need to turn the computer off.
12
+
13
+
14
+ # Installation
15
+
16
+ ### Step 0 - if you use RVM - setup the correct ruby version
17
+
18
+ ```
19
+ rvm use ...
20
+ ```
21
+
22
+ ### Step 1 - install the gem
23
+
24
+ ```
25
+ gem install konkit-worklogger
26
+ ```
27
+
28
+
29
+ ### Step 2 - create the config file with a folder with your entries
30
+ ```
31
+ echo "path: \"$HOME/.konkit_worklogger/timeentries\"" > $HOME/.konkit_worklogger/config.yml
32
+ ```
33
+
34
+ ### Step 3 - setup the Cron job
35
+ First, we have to run the `rvm cron setup` command to fill our cron file with needed variables.
36
+
37
+ ```
38
+ rvm cron setup
39
+ ```
40
+
41
+ Then, we have to edit the cron file and add the worklogger command
42
+
43
+ ```
44
+ crontab -e
45
+ ```
46
+
47
+ Add the following line there:
48
+
49
+
50
+ ```
51
+ * * * * * $MY_RUBY_HOME/bin/ruby $GEM_HOME/bin/worklogger increment
52
+ ```
53
+
54
+
55
+ # Usage
56
+ To display the help screen, run:
57
+ ```
58
+ worklogger
59
+ ```
60
+
61
+ To display today's entries, run:
62
+ ```
63
+ worklogger today
64
+ ```
65
+
66
+ To display the entries for the whole month with carry from previous months, run:
67
+ ```
68
+ worklogger month
69
+ ```
@@ -4,14 +4,15 @@ require 'fileutils'
4
4
  class WorkLoggerConfiguration
5
5
  attr_reader :worklogger_path
6
6
 
7
- def initialize(worklogger_path, config_path = nil)
7
+ def initialize(worklogger_path)
8
8
  @worklogger_path = worklogger_path
9
- @config_path = config_path || '%s/.konkit_worklogger/config.yml' % Dir.home
10
9
  end
11
10
 
12
11
  def self.load
13
- conf = if File.file?(@config_path)
14
- config_file_content = IO.read(@config_path)
12
+ config_path = '%s/.konkit_worklogger/config.yml' % Dir.home
13
+
14
+ conf = if File.file?(config_path)
15
+ config_file_content = IO.read(config_path)
15
16
  config = YAML.safe_load(config_file_content)
16
17
 
17
18
  worklogger_path = config['path']
@@ -1,3 +1,3 @@
1
1
  module KonkitWorklogger
2
- VERSION = '0.1.0'.freeze
2
+ VERSION = '0.1.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: konkit_worklogger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Łukasz Tenerowicz
@@ -104,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
104
104
  - !ruby/object:Gem::Version
105
105
  version: '0'
106
106
  requirements: []
107
- rubygems_version: 3.0.3
107
+ rubygems_version: 3.1.2
108
108
  signing_key:
109
109
  specification_version: 4
110
110
  summary: Worklogger