fewald-worklog 0.1.24 → 0.2.1
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/.version +1 -1
- data/bin/wl +2 -2
- data/{worklog → lib}/cli.rb +13 -13
- data/{worklog → lib}/configuration.rb +2 -1
- data/{worklog → lib}/daily_log.rb +2 -1
- data/{worklog → lib}/log_entry.rb +2 -2
- data/{worklog → lib}/statistics.rb +1 -1
- data/{worklog → lib}/storage.rb +5 -4
- data/{worklog → lib}/summary.rb +8 -4
- data/lib/templates/favicon.svg.erb +7 -0
- data/{worklog → lib}/webserver.rb +2 -2
- data/{worklog → lib}/worklog.rb +10 -10
- metadata +22 -21
- /data/{worklog → lib}/date_parser.rb +0 -0
- /data/{worklog → lib}/editor.rb +0 -0
- /data/{worklog → lib}/hash.rb +0 -0
- /data/{worklog → lib}/person.rb +0 -0
- /data/{worklog → lib}/printer.rb +0 -0
- /data/{worklog → lib}/string_helper.rb +0 -0
- /data/{worklog → lib}/templates/index.html.erb +0 -0
- /data/{worklog → lib}/version.rb +0 -0
- /data/{worklog/logger.rb → lib/worklogger.rb} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6dfe82763d0872a3c92d8df46abb164b8a40cbebd9c9f69ee678861d56fd6933
|
4
|
+
data.tar.gz: d30d1d630b209c882f3f707b0af12f49a6cde2c9561f4c454958983baa0eb602
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7db2e0df84b61045b6bb2eb1ef28d34eadbae455071ba281cceea457616446aa7cbf9dcda02d4ce3472b4008d8c4dfd977be99e6eab328ed4d78cbbb11c34877
|
7
|
+
data.tar.gz: 1dc3e202e93f1a14257653fad55fad124834fd7b081773e01615a2678a45fa76bfd9c90e7af4b285c40c5a4b83da9f48feed6a62e31326d4998c3edac1db5864
|
data/.version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1
|
1
|
+
0.2.1
|
data/bin/wl
CHANGED
@@ -8,9 +8,9 @@ if ENV['WL_PATH']
|
|
8
8
|
# This is used during development to avoid having to rely on the order of the $PATH.
|
9
9
|
puts "Loading worklog from #{ENV['WL_PATH']}. This should only be used during development."
|
10
10
|
puts 'To use the installed worklog, unset the WL_PATH environment variable.'
|
11
|
-
require_relative File.join(ENV['WL_PATH'], '
|
11
|
+
require_relative File.join(ENV['WL_PATH'], 'lib', 'cli')
|
12
12
|
else
|
13
|
-
require_relative '../
|
13
|
+
require_relative '../lib/cli'
|
14
14
|
end
|
15
15
|
|
16
16
|
WorklogCLI.start
|
data/{worklog → lib}/cli.rb
RENAMED
@@ -1,24 +1,24 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Add the current directory to the load path
|
4
|
-
curr_dir = File.expand_path(__dir__)
|
5
|
-
$LOAD_PATH << curr_dir unless $LOAD_PATH.include?(curr_dir)
|
4
|
+
# curr_dir = File.expand_path(__dir__)
|
5
|
+
# $LOAD_PATH << curr_dir unless $LOAD_PATH.include?(curr_dir)
|
6
6
|
|
7
7
|
require 'thor'
|
8
8
|
require 'date'
|
9
|
-
require '
|
9
|
+
require 'worklogger'
|
10
10
|
|
11
|
-
|
11
|
+
require 'worklog'
|
12
12
|
require 'date_parser'
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
13
|
+
require 'configuration'
|
14
|
+
require 'editor'
|
15
|
+
require 'printer'
|
16
|
+
require 'statistics'
|
17
|
+
require 'storage'
|
18
|
+
require 'string_helper'
|
19
|
+
require 'summary'
|
20
|
+
require 'version'
|
21
|
+
require 'webserver'
|
22
22
|
|
23
23
|
# CLI for the work log application
|
24
24
|
class WorklogCLI < Thor
|
@@ -16,8 +16,9 @@ class Configuration
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
+
# Load configuration from a YAML file.
|
20
|
+
# The file should be located at ~/.worklog.yaml.
|
19
21
|
def load_configuration
|
20
|
-
# TODO: Implement loading configuration from a file
|
21
22
|
file_path = File.join(Dir.home, '.worklog.yaml')
|
22
23
|
if File.exist?(file_path)
|
23
24
|
file_cfg = YAML.load_file(file_path)
|
data/{worklog → lib}/storage.rb
RENAMED
@@ -1,11 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'rainbow'
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
require 'daily_log'
|
5
|
+
require 'log_entry'
|
6
|
+
require 'worklogger'
|
7
|
+
require 'person'
|
8
8
|
|
9
|
+
# Handles storage of daily logs and people
|
9
10
|
class Storage
|
10
11
|
# LogNotFoundError is raised when a log file is not found
|
11
12
|
class LogNotFoundError < StandardError; end
|
data/{worklog → lib}/summary.rb
RENAMED
@@ -4,10 +4,10 @@ require 'erb'
|
|
4
4
|
require 'httparty'
|
5
5
|
require 'json'
|
6
6
|
|
7
|
-
|
7
|
+
require 'worklogger'
|
8
8
|
|
9
9
|
# AI Summary generation.
|
10
|
-
|
10
|
+
class Summary
|
11
11
|
MODEL = 'llama3.2'
|
12
12
|
SUMMARY_INSTRUCTION = <<~INSTRUCTION
|
13
13
|
<% entries.each do |entry| -%>
|
@@ -41,15 +41,19 @@ module Summary
|
|
41
41
|
Example Output: "[Name] demonstrated outstanding performance during the review period. Key accomplishments include exceeding sales targets by 15% in Q3, implementing a new CRM system that improved customer response times by 30%, and mentoring two junior team members who achieved career advancements. These achievements highlight [Name]'s exceptional contributions to team success and organizational growth."
|
42
42
|
INSTRUCTION
|
43
43
|
|
44
|
+
def initialize(config)
|
45
|
+
@config = config
|
46
|
+
end
|
47
|
+
|
44
48
|
# Build the prompt from provided log entries.
|
45
|
-
def
|
49
|
+
def build_prompt(log_entries)
|
46
50
|
ERB.new(SUMMARY_INSTRUCTION, trim_mode: '-').result_with_hash(entries: log_entries)
|
47
51
|
end
|
48
52
|
|
49
53
|
# Generate a summary from provided log entries.
|
50
54
|
# @param log_entries [Array<LogEntry>] The log entries to summarize.
|
51
55
|
# @return [String] The generated summary.
|
52
|
-
def
|
56
|
+
def generate_summary(log_entries)
|
53
57
|
prompt = build_prompt(log_entries)
|
54
58
|
|
55
59
|
WorkLogger.debug("Using prompt: #{prompt}")
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
3
|
+
<svg width="128" height="128" viewBox="0 0 128 128" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
4
|
+
<rect fill="#fff" stroke="#000" x="0" y="0" width="128" height="128" stroke-width="4" />
|
5
|
+
<rect fill="#fff" stroke="#000" x="32" y="32" width="64" height="64" stroke-width="2" />
|
6
|
+
<text x="10" y="30" fill="green" font-size="32"><%= Date.today %></text>
|
7
|
+
</svg>
|
@@ -6,8 +6,8 @@ require 'rack'
|
|
6
6
|
require 'rack/constants'
|
7
7
|
require 'rackup'
|
8
8
|
require 'uri'
|
9
|
-
|
10
|
-
|
9
|
+
require 'storage'
|
10
|
+
require 'worklog'
|
11
11
|
|
12
12
|
class DefaultHeaderMiddleware
|
13
13
|
# Rack middleware to add default headers to the response.
|
data/{worklog → lib}/worklog.rb
RENAMED
@@ -5,15 +5,15 @@ require 'optparse'
|
|
5
5
|
require 'rainbow'
|
6
6
|
require 'yaml'
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
8
|
+
require 'hash'
|
9
|
+
require 'daily_log'
|
10
|
+
require 'date_parser'
|
11
|
+
require 'log_entry'
|
12
|
+
require 'storage'
|
13
|
+
require 'worklogger'
|
14
|
+
require 'string_helper'
|
15
|
+
require 'printer'
|
16
|
+
require 'statistics'
|
17
17
|
|
18
18
|
# Main class providing all worklog functionality.
|
19
19
|
# This class is the main entry point for the application.
|
@@ -172,7 +172,7 @@ class Worklog
|
|
172
172
|
Printer.new.no_entries(start_date, end_date)
|
173
173
|
return
|
174
174
|
end
|
175
|
-
puts Summary.generate_summary(entries)
|
175
|
+
puts Summary.new(@config).generate_summary(entries)
|
176
176
|
end
|
177
177
|
|
178
178
|
def remove(options = {})
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fewald-worklog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Friedrich Ewald
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: httparty
|
@@ -122,24 +122,25 @@ extra_rdoc_files: []
|
|
122
122
|
files:
|
123
123
|
- ".version"
|
124
124
|
- bin/wl
|
125
|
-
-
|
126
|
-
-
|
127
|
-
-
|
128
|
-
-
|
129
|
-
-
|
130
|
-
-
|
131
|
-
-
|
132
|
-
-
|
133
|
-
-
|
134
|
-
-
|
135
|
-
-
|
136
|
-
-
|
137
|
-
-
|
138
|
-
-
|
139
|
-
-
|
140
|
-
-
|
141
|
-
-
|
142
|
-
-
|
125
|
+
- lib/cli.rb
|
126
|
+
- lib/configuration.rb
|
127
|
+
- lib/daily_log.rb
|
128
|
+
- lib/date_parser.rb
|
129
|
+
- lib/editor.rb
|
130
|
+
- lib/hash.rb
|
131
|
+
- lib/log_entry.rb
|
132
|
+
- lib/person.rb
|
133
|
+
- lib/printer.rb
|
134
|
+
- lib/statistics.rb
|
135
|
+
- lib/storage.rb
|
136
|
+
- lib/string_helper.rb
|
137
|
+
- lib/summary.rb
|
138
|
+
- lib/templates/favicon.svg.erb
|
139
|
+
- lib/templates/index.html.erb
|
140
|
+
- lib/version.rb
|
141
|
+
- lib/webserver.rb
|
142
|
+
- lib/worklog.rb
|
143
|
+
- lib/worklogger.rb
|
143
144
|
homepage: https://github.com/f-ewald/worklog
|
144
145
|
licenses:
|
145
146
|
- MIT
|
@@ -164,7 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
164
165
|
- !ruby/object:Gem::Version
|
165
166
|
version: '0'
|
166
167
|
requirements: []
|
167
|
-
rubygems_version: 3.6.
|
168
|
+
rubygems_version: 3.6.7
|
168
169
|
specification_version: 4
|
169
170
|
summary: Command line tool for tracking achievments, tasks and interactions.
|
170
171
|
test_files: []
|
File without changes
|
/data/{worklog → lib}/editor.rb
RENAMED
File without changes
|
/data/{worklog → lib}/hash.rb
RENAMED
File without changes
|
/data/{worklog → lib}/person.rb
RENAMED
File without changes
|
/data/{worklog → lib}/printer.rb
RENAMED
File without changes
|
File without changes
|
File without changes
|
/data/{worklog → lib}/version.rb
RENAMED
File without changes
|
File without changes
|