timet 1.6.0 → 1.6.1.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: 5fb7549f94a072231980f81d1d931c14f98c2b7aa90c9cb22fc81ba361e40af9
4
- data.tar.gz: a2c160d0dfc3132427b07aeac3a16310fc5f1c3d36e2a76f4166bd2a0cc153be
3
+ metadata.gz: 5827ed2755115ce5974bb35145f83b6d0de26d94e2e0fc60983117a55d4d8854
4
+ data.tar.gz: de50d2db6b024c348b65bc00fb6020b1d92dcf5eeb78138dc2e2dc59cb117296
5
5
  SHA512:
6
- metadata.gz: fd8aa958b7ecdfa53bd674a7ed66f619b5ccf0968ce36c62180026fb391ce9e31d5c1ce37d0c618f45ffd5a006d98735397c524e64ab9b3e1bb786c1e9aebec0
7
- data.tar.gz: 54a9bb03b6e435e9120e8e07aaf1b37c5091834f95c36e312185a1eabae1454e6e9526f7a266f67e0693fbd8500d904bb68549e43bd6b40ec0cc53d605e9c8f5
6
+ metadata.gz: 400c4b23c9260412c3afeb9ed62ebd51c545d5b689bf165e7c6c90abd01e8c665dbcbf6eb690ff030c2a42a9f83c8e2fe58258995c9130630fd9e3597a1082b3
7
+ data.tar.gz: 6be9dc88ef4eca0ef785d6d5272195a1d6ad3b5c6f5a65bc44bd12d2d36c5d0fef7f11b8cabe741e92b83fe782433ffb74f01d4635c061e6b9e95753c593a3d1
data/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [1.6.1] - 2025-10-10
2
+
3
+ **New Features:**
4
+
5
+ - **Search Option for Summary Command:** Introduced a new `--search` option for the `summary` command, allowing users to filter time tracking reports by tags or notes.
6
+ - **Discord Integration:** Added support for sending notifications to Discord channels upon Pomodoro timer completion.
7
+
8
+ **Improvements:**
9
+
10
+ - **Dependency Updates:** Updated `aws-partitions`, `aws-sdk-kms`, `aws-sdk-s3`, `bigdecimal`, `httparty`, `icalendar`, `json`, `multi_xml`, `prism`, and `rubocop` to their latest versions for better performance and security.
11
+ - **README Updates:** Added new examples for the `--search` option and updated the project homepage URL.
12
+ - **Time Report Filtering:** Enhanced `TimeReport` to incorporate the `--search` option for filtering items by tag or notes.
13
+
14
+
1
15
  ## [1.6.0] - 2025-09-24
2
16
 
3
17
  **New Features:**
data/README.md CHANGED
@@ -38,6 +38,7 @@
38
38
  - **Enhanced Summary Report:** Provides a detailed, color-coded explanation of tag distribution, including percentages, total duration, average duration, and standard deviation, via the `--report` option in the `summary` command.
39
39
  - **iCalendar Export:** Easily export your time tracking data to iCalendar format for integration with calendar applications.
40
40
  - **S3 Cloud Backup:** Seamlessly backup and sync your time tracking data with S3-compatible storage services, providing an additional layer of data protection and accessibility.
41
+ - **Discord Integration:** Receive notifications in your Discord channels upon Pomodoro timer completion, enhancing real-time productivity tracking.
41
42
 
42
43
  ## Examples:
43
44
 
@@ -106,9 +107,9 @@ gem install timet
106
107
  - **Focus:** Encourages disciplined work practices.
107
108
  - **Productivity:** Helps achieve higher productivity and better time management.
108
109
 
109
- ### Discord Integration
110
+ ### Discord Integration
110
111
 
111
- Timet now supports sending notifications to Discord channels upon Pomodoro timer completion. To enable this feature, you need to configure a webhook in your Discord channel and export the webhook URL as an environment variable.
112
+ Timet now supports sending notifications to Discord channels upon Pomodoro timer completion. To enable this feature, you need to configure a webhook in your Discord channel and export the webhook URL as an environment variable.
112
113
 
113
114
  #### Setup:
114
115
 
@@ -228,6 +229,7 @@ Once configured, Timet will automatically send a notification to your Discord ch
228
229
  | `timet su t --csv=[filename]` | Display a report of tracked time for today and export to CSV file | `timet su t --csv=file.csv` |
229
230
  | `timet su w --ics=[filename]` | Display a report of tracked time for week and export to iCalendar file | `timet su w --ics=file.csv` |
230
231
  | `timet su t --report` | Display a detailed report of tag distribution for today. | `timet su t --report` |
232
+ | `timet summary [time_scope] --search=[query]`| Display a report of tracked time filtered by tag or notes. | `timet su week --search="bug"` |
231
233
  | `timet delete [id]` | Delete a task by its ID. | `timet d [id]` |
232
234
  | `timet cancel` | Cancel active time tracking. | `timet c` |
233
235
  | `timet edit [id]` | Update a task's notes, tag, start, or end fields. | `timet e [id]` |
@@ -206,10 +206,12 @@ Examples:
206
206
  > tt su yesterday [today (t), yesterday (y), week (w), month (m)]
207
207
  > tt su 2024-10-03..2024-10-20
208
208
  > tt su month --csv=myfile
209
- > tt su week --csv=mycalendar'
209
+ > tt su week --csv=mycalendar
210
+ > tt su week --search "bug"'
210
211
  option :csv, type: :string, desc: 'Export to CSV'
211
212
  option :ics, type: :string, desc: 'Export to iCalendar'
212
213
  option :report, type: :string, desc: 'Display report'
214
+ option :search, type: :string, desc: 'Filter by tag or notes'
213
215
  # Generates a summary of tracking items based on the provided time_scope and tag, and optionally exports the summary
214
216
  # to a CSV file and/or an iCalendar file.
215
217
  #
@@ -217,7 +217,8 @@ module Timet
217
217
  tag: tag,
218
218
  csv: csv_filename,
219
219
  ics: ics_filename,
220
- report: options[:report]
220
+ report: options[:report],
221
+ search: options[:search]
221
222
  }
222
223
  end
223
224
 
@@ -60,7 +60,8 @@ module Timet
60
60
  @csv_filename = options[:csv]
61
61
  @ics_filename = options[:ics]
62
62
  @filter = formatted_filter(options[:filter])
63
- @items = options[:filter] ? filter_items(@filter, options[:tag]) : @db.all_items
63
+ @search_query = options[:search]
64
+ @items = options[:filter] ? filter_items(@filter, options[:tag], @search_query) : @db.all_items
64
65
  @table = Table.new(@filter, @items, @db)
65
66
  end
66
67
 
@@ -176,13 +177,13 @@ module Timet
176
177
  # filter_items('2021-10-01..2021-10-31', 'work')
177
178
  #
178
179
  # @note The method filters the items based on the specified date range and tag.
179
- def filter_items(filter, tag)
180
+ def filter_items(filter, tag, search_query)
180
181
  if Timet::Utils.date_ranges.key?(filter)
181
182
  start_date, end_date = Timet::Utils.date_ranges[filter]
182
- filter_by_date_range(start_date, end_date, tag)
183
+ filter_by_date_range(start_date, end_date, tag, search_query)
183
184
  elsif Timet::Utils.valid_date_format?(filter)
184
185
  start_date, end_date = filter.split('..').map { |x| Date.parse(x) }
185
- filter_by_date_range(start_date, end_date, tag)
186
+ filter_by_date_range(start_date, end_date, tag, search_query)
186
187
  else
187
188
  puts 'Invalid filter. Supported filters: today, yesterday, week, month'
188
189
  []
@@ -201,15 +202,17 @@ module Timet
201
202
  # filter_by_date_range(Date.new(2021, 10, 1), Date.new(2021, 10, 31), 'work')
202
203
  #
203
204
  # @note The method filters the items based on the specified date range and tag.
204
- def filter_by_date_range(start_date, end_date = nil, tag = nil)
205
+ def filter_by_date_range(start_date, end_date = nil, tag = nil, search_query = nil)
205
206
  start_time = TimeHelper.date_to_timestamp(start_date)
206
207
  end_time = TimeHelper.calculate_end_time(start_date, end_date)
207
- query = [
208
+ query_parts = [
208
209
  "start >= #{start_time}",
209
210
  "start < #{end_time}",
210
- "tag like '%#{tag}%'",
211
211
  '(deleted IS NULL OR deleted = 0)'
212
- ].join(' and ')
212
+ ]
213
+ query_parts << "tag like '%#{tag}%'" if tag
214
+ query_parts << "(tag LIKE '%#{search_query}%' OR notes LIKE '%#{search_query}%')" if search_query
215
+ query = query_parts.join(' and ')
213
216
  @db.execute_sql(
214
217
  "select * from items where #{query} ORDER BY id DESC"
215
218
  )
data/lib/timet/version.rb CHANGED
@@ -6,6 +6,6 @@ module Timet
6
6
  # @return [String] The version number in the format 'major.minor.patch'.
7
7
  #
8
8
  # @example Get the version of the Timet application
9
- # Timet::VERSION # => '1.6.0'
10
- VERSION = '1.6.0'
9
+ # Timet::VERSION # => '1.6.1.1'
10
+ VERSION = '1.6.1.1'
11
11
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: timet
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.6.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Frank Vielma
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-09-24 00:00:00.000000000 Z
11
+ date: 2025-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -159,11 +159,11 @@ files:
159
159
  - lib/timet/version.rb
160
160
  - lib/timet/week_info.rb
161
161
  - sig/timet.rbs
162
- homepage: https://frankv.top/posts/timet-a-powerful-command-line-tool-for-tracking-your-time/
162
+ homepage: https://timet.frankv.top
163
163
  licenses:
164
164
  - MIT
165
165
  metadata:
166
- homepage_uri: https://frankv.top/posts/timet-a-powerful-command-line-tool-for-tracking-your-time/
166
+ homepage_uri: https://timet.frankv.top
167
167
  source_code_uri: https://github.com/frankvielma/timet
168
168
  changelog_uri: https://github.com/frankvielma/timet/blob/main/CHANGELOG.md
169
169
  documentation_uri: https://rubydoc.info/gems/timet