fewald-worklog 0.1.23 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bf63e1e05ae169d16fe416e3918ca61c2e09bad866e94dc3cc9f8806dea70de3
4
- data.tar.gz: baec892afa905f6cd9e58652ebd0d0da64b3e6b970968eece6e51cdfaaa36c68
3
+ metadata.gz: 6dfe82763d0872a3c92d8df46abb164b8a40cbebd9c9f69ee678861d56fd6933
4
+ data.tar.gz: d30d1d630b209c882f3f707b0af12f49a6cde2c9561f4c454958983baa0eb602
5
5
  SHA512:
6
- metadata.gz: 55386516bc204b362537ffcecb606bb8d4501e3b4769be3e78cdc3609f6cb53ca05906f4e3761b4c2c90b75939e5c8bc5da02835e1a99a98a58c29fb4dd9fccd
7
- data.tar.gz: 73e8064262653003784babbe8b4c4a4f309be0e6ef5181010a81f2c97b578bc696cc47da700c5e7d2615e4e1f9263b8997dd9012132b265b5c9fa373167707dd
6
+ metadata.gz: 7db2e0df84b61045b6bb2eb1ef28d34eadbae455071ba281cceea457616446aa7cbf9dcda02d4ce3472b4008d8c4dfd977be99e6eab328ed4d78cbbb11c34877
7
+ data.tar.gz: 1dc3e202e93f1a14257653fad55fad124834fd7b081773e01615a2678a45fa76bfd9c90e7af4b285c40c5a4b83da9f48feed6a62e31326d4998c3edac1db5864
data/.version CHANGED
@@ -1 +1 @@
1
- 0.1.23
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'], 'worklog', 'cli')
11
+ require_relative File.join(ENV['WL_PATH'], 'lib', 'cli')
12
12
  else
13
- require_relative '../worklog/cli'
13
+ require_relative '../lib/cli'
14
14
  end
15
15
 
16
16
  WorklogCLI.start
@@ -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 'logger'
9
+ require 'worklogger'
10
10
 
11
- require_relative 'worklog'
11
+ require 'worklog'
12
12
  require 'date_parser'
13
- require_relative 'configuration'
14
- require_relative 'editor'
15
- require_relative 'printer'
16
- require_relative 'statistics'
17
- require_relative 'storage'
18
- require_relative 'string_helper'
19
- require_relative 'summary'
20
- require_relative 'version'
21
- require_relative 'webserver'
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)
@@ -1,7 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'hash'
3
+ require 'hash'
4
4
 
5
+ # DailyLog is a container for a day's work log.
5
6
  class DailyLog
6
7
  # Container for a day's work log.
7
8
  include Hashify
@@ -2,8 +2,8 @@
2
2
 
3
3
  require 'yaml'
4
4
  require 'rainbow'
5
- require_relative 'daily_log'
6
- require_relative 'hash'
5
+ require 'daily_log'
6
+ require 'hash'
7
7
 
8
8
  # A single log entry.
9
9
  class LogEntry
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'date'
4
- require_relative 'storage'
4
+ require 'storage'
5
5
 
6
6
  STATS = Data.define(:total_days, :total_entries, :total_epics, :avg_entries, :first_entry, :last_entry)
7
7
 
@@ -1,11 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'rainbow'
4
- require_relative 'daily_log'
5
- require_relative 'log_entry'
6
- require_relative 'logger'
7
- require_relative 'person'
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
@@ -4,10 +4,10 @@ require 'erb'
4
4
  require 'httparty'
5
5
  require 'json'
6
6
 
7
- require_relative 'logger'
7
+ require 'worklogger'
8
8
 
9
9
  # AI Summary generation.
10
- module Summary
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 self.build_prompt(log_entries)
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 self.generate_summary(log_entries)
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
- require_relative 'storage'
10
- require_relative 'worklog'
9
+ require 'storage'
10
+ require 'worklog'
11
11
 
12
12
  class DefaultHeaderMiddleware
13
13
  # Rack middleware to add default headers to the response.
@@ -5,15 +5,15 @@ require 'optparse'
5
5
  require 'rainbow'
6
6
  require 'yaml'
7
7
 
8
- require_relative 'hash'
9
- require_relative 'daily_log'
10
- require_relative 'date_parser'
11
- require_relative 'log_entry'
12
- require_relative 'storage'
13
- require_relative 'logger'
14
- require_relative 'string_helper'
15
- require_relative 'printer'
16
- require_relative 'statistics'
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.23
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: 2025-05-07 00:00:00.000000000 Z
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
- - worklog/cli.rb
126
- - worklog/configuration.rb
127
- - worklog/daily_log.rb
128
- - worklog/date_parser.rb
129
- - worklog/editor.rb
130
- - worklog/hash.rb
131
- - worklog/log_entry.rb
132
- - worklog/logger.rb
133
- - worklog/person.rb
134
- - worklog/printer.rb
135
- - worklog/statistics.rb
136
- - worklog/storage.rb
137
- - worklog/string_helper.rb
138
- - worklog/summary.rb
139
- - worklog/templates/index.html.erb
140
- - worklog/version.rb
141
- - worklog/webserver.rb
142
- - worklog/worklog.rb
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.2
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
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes