konkit_worklogger 0.1.0 → 0.1.3
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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +58 -0
- data/lib/konkit_worklogger/configuration.rb +5 -4
- data/lib/konkit_worklogger/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3cf49d4918f2364b8a2836f73f6c36ab84ec0d04ab27c1ed501b85a29ae6260d
|
4
|
+
data.tar.gz: b81363e32f818f83267965c17572ad65df6273de073b88debb082ad5fa438ef1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf314df990e17989eaf777a82ea72e2f1215bd396dca2a3a58eaca0f481a65496bebf7d477f93b87534a523f1845ddf7bf5bb53eb4b9b873e911f63ef43d7d4e
|
7
|
+
data.tar.gz: b8b023f165c60a6d6e5714a01dd8ff901a08571285989f90337d129e2f4214441f2fe6df27a1d22531b0cb78d0fa6b1c9c4df6db696323346f01c7a5f4bcd8c4
|
data/Gemfile.lock
CHANGED
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
|
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
|
-
|
14
|
-
|
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']
|
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.
|
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.
|
107
|
+
rubygems_version: 3.1.2
|
108
108
|
signing_key:
|
109
109
|
specification_version: 4
|
110
110
|
summary: Worklogger
|