timet 1.5.8 → 1.5.9
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/.deepsource.toml +13 -0
- data/CHANGELOG.md +15 -0
- data/README.md +1 -3
- data/lib/timet/application.rb +1 -2
- data/lib/timet/application_helper.rb +8 -2
- data/lib/timet/time_validation_helper.rb +3 -2
- data/lib/timet/version.rb +2 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e5079b49daa5deed838350e66235ce5301518e928a478f405423f268e431390
|
4
|
+
data.tar.gz: e7ef91dd990022437605bdfe406387e1499b9d08de5f6c233211332d9cb5ea0d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6f4a1db83a82e0a0e53787a1b8847b7ceaa2694e0e4fbe318271bfc00a33c078d525d832f3be0b136d11c9b4a580ff3648ef9a1064e8921be6d7e79cb59c910
|
7
|
+
data.tar.gz: 7cd3c8513a161e3864501cec96317b833bdda14d937779b97d0feb680a894284f34d7427ba1197ad8ca0a721ede075b13b549489e5beaaa1cbfb751fa71f927f
|
data/.deepsource.toml
ADDED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
+
## [1.5.9] - 2025-07-30
|
2
|
+
|
3
|
+
**Improvements:**
|
4
|
+
|
5
|
+
- Replaced Code Climate with DeepSource for static analysis and test coverage reporting.
|
6
|
+
- Updated the CI workflow by removing Code Climate steps and adding a .deepsource.toml configuration file.
|
7
|
+
- Updated gem dependencies, including rubocop, thor, and various aws-sdk gems.
|
8
|
+
- Refactored application.rb to use abort for more idiomatic error handling on invalid arguments.
|
9
|
+
- Updated the README to replace the old Code Climate badges with a new DeepSource badge.
|
10
|
+
|
11
|
+
**Bug fixes:**
|
12
|
+
|
13
|
+
- Fixed a shell injection vulnerability in application_helper.rb by properly escaping notification messages using Shellwords.shellescape.
|
14
|
+
- Corrected a timezone-related issue in time_validation_helper.rb by using Time.now.getlocal for future date validation.
|
15
|
+
|
1
16
|
## [1.5.8] - 2025-06-28
|
2
17
|
|
3
18
|
**Improvements:**
|
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
[](https://badge.fury.io/rb/timet)
|
2
2
|

|
3
|
-
[](https://codeclimate.com/github/frankvielma/timet/test_coverage)
|
5
|
-
|
3
|
+
[](https://app.deepsource.com/gh/frankvielma/timet/)
|
6
4
|
# Timet
|
7
5
|
|
8
6
|

|
data/lib/timet/application.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'shellwords'
|
4
|
+
|
3
5
|
module Timet
|
4
6
|
# Provides helper methods for the Timet application.
|
5
7
|
module ApplicationHelper
|
@@ -109,7 +111,8 @@ module Timet
|
|
109
111
|
# @param tag [String] A tag or label for the session, used in the notification message.
|
110
112
|
# @return [void]
|
111
113
|
def run_linux_session(time, tag)
|
112
|
-
|
114
|
+
escaped_message = Shellwords.shellescape(show_message(tag))
|
115
|
+
notification_command = "notify-send --icon=clock #{escaped_message}"
|
113
116
|
command = "sleep #{time} && tput bel && tt stop 0 && #{notification_command} &"
|
114
117
|
pid = Kernel.spawn(command)
|
115
118
|
Process.detach(pid)
|
@@ -121,7 +124,10 @@ module Timet
|
|
121
124
|
# @param _tag [String] A tag or label for the session, not used in the notification message on macOS.
|
122
125
|
# @return [void]
|
123
126
|
def run_mac_session(time, tag)
|
124
|
-
|
127
|
+
# Escape double quotes and backslashes for AppleScript, then shell-escape the entire AppleScript command
|
128
|
+
escaped_message_for_applescript = show_message(tag).gsub('\\', '\\\\').gsub('"', '\"')
|
129
|
+
escaped_applescript_command = Shellwords.shellescape("display notification \"#{escaped_message_for_applescript}\"")
|
130
|
+
notification_command = "osascript -e #{escaped_applescript_command}"
|
125
131
|
command = "sleep #{time} && afplay /System/Library/Sounds/Basso.aiff && tt stop 0 && #{notification_command} &"
|
126
132
|
pid = Kernel.spawn(command)
|
127
133
|
Process.detach(pid)
|
@@ -103,9 +103,10 @@ module Timet
|
|
103
103
|
#
|
104
104
|
# @raise [ArgumentError] If the new datetime is in the future.
|
105
105
|
def validate_future_date(new_datetime)
|
106
|
-
|
106
|
+
# Ensure the new datetime is not in the future relative to the current time.
|
107
|
+
return unless new_datetime > Time.now.getlocal
|
107
108
|
|
108
|
-
raise ArgumentError, "Cannot set time to a future date: #{new_datetime.strftime('%Y-%m-%d %H:%M:%S')}"
|
109
|
+
raise ArgumentError, "Cannot set time to a future date or time: #{new_datetime.strftime('%Y-%m-%d %H:%M:%S')}"
|
109
110
|
end
|
110
111
|
|
111
112
|
# Validates that the difference between two timestamps is less than 24 hours.
|
data/lib/timet/version.rb
CHANGED
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.5.
|
4
|
+
version: 1.5.9
|
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-
|
11
|
+
date: 2025-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -123,6 +123,7 @@ executables:
|
|
123
123
|
extensions: []
|
124
124
|
extra_rdoc_files: []
|
125
125
|
files:
|
126
|
+
- ".deepsource.toml"
|
126
127
|
- ".reek.yml"
|
127
128
|
- ".rspec"
|
128
129
|
- ".rubocop.yml"
|