fewald-worklog 0.2.2 → 0.2.4

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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/.version +1 -1
  3. data/bin/wl +2 -1
  4. data/lib/daily_log.rb +12 -0
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9d377967044d59fc0f73e35b6cb03f1f189ef2de96d67c8d9c59014a61be229e
4
- data.tar.gz: 8fe061d22a7310a840bde061978fcd15265d47cb432617413ba53805753acf2a
3
+ metadata.gz: 0bf5afbd99a91e77e5a3d16101653fecdeafdd808c5ca7c4ea23aa60be01ad54
4
+ data.tar.gz: 24c33cda5e47f1878c814bcb22ab06d9295e9e4d2e3f59b39ccdcf8801d3e8d9
5
5
  SHA512:
6
- metadata.gz: 3235e197222b66955e08e1fadc589e482882b3a17e4b00c9e21623a6d60a6eb729ad1fe2a7e358895afe15b6e6d3826c650a864568aa98b8a8679700106f311a
7
- data.tar.gz: 3dc85896e91bf294e18f98bcaf79d5615469033d1f73e49a6e36fee706efbe3dbe7117c0d2a1c8dc8716337dd0612cadd33203f68f418ed83b1bf32be941ac3a
6
+ metadata.gz: '09d41c3cc186e650aebbca3d91840cfbec6c6207a67929c3b1b379b470008d00acacf8ff38ae20d9d648589354e2e2538220852ee86ad564a69b76e7b86607fa'
7
+ data.tar.gz: d8da05a9c100cc1b59243a303910faa2a675f0c15ade7ac253fb846b5e3435895245d454c0cf0957a096a94c6dcddeca0f2a8114f7f0c12d759189413dcef690
data/.version CHANGED
@@ -1 +1 @@
1
- 0.2.2
1
+ 0.2.4
data/bin/wl CHANGED
@@ -8,7 +8,8 @@ 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'], 'lib', 'cli')
11
+ $LOAD_PATH.unshift File.join(ENV['WL_PATH'], 'lib')
12
+ require 'cli'
12
13
  else
13
14
  require_relative '../lib/cli'
14
15
  end
data/lib/daily_log.rb CHANGED
@@ -29,6 +29,18 @@ class DailyLog
29
29
  entries.map(&:people).flatten.tally
30
30
  end
31
31
 
32
+ # Returns a sorted list of tags used in the entries for the current day.
33
+ #
34
+ # @return [Array<String>]
35
+ #
36
+ # @example
37
+ # log = DailyLog.new(date: Date.today,
38
+ # entries: [LogEntry.new(message: "Work on something", tags: ['work', 'project'])])
39
+ # log.tags # => ["project", "work"]
40
+ def tags
41
+ entries.flat_map(&:tags).uniq.sort
42
+ end
43
+
32
44
  def ==(other)
33
45
  date == other.date && entries == other.entries
34
46
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fewald-worklog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Friedrich Ewald