diff options
| author | Paul Buetow <paul@buetow.org> | 2025-05-17 23:27:42 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-05-17 23:27:42 +0300 |
| commit | 8e9596aecaeda444dcd34381de974e2c82fed843 (patch) | |
| tree | b12e0e351374c730d3fd7907df18d8dc7c563c8f | |
| parent | 87cdb1b068ec79325baf84f8d0f21989e9adc689 (diff) | |
Update
| -rw-r--r-- | dotfiles/scripts/taskwarriorfeeder.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/dotfiles/scripts/taskwarriorfeeder.rb b/dotfiles/scripts/taskwarriorfeeder.rb index 2c6e5f7..5ec3860 100644 --- a/dotfiles/scripts/taskwarriorfeeder.rb +++ b/dotfiles/scripts/taskwarriorfeeder.rb @@ -9,7 +9,7 @@ PERSONAL_TIMESPAN_D = 30 WORK_TIMESPAN_D = 14 WORKTIME_DIR = "#{ENV['HOME']}/git/worktime".freeze GOS_DIR = "#{ENV['HOME']}/Notes/GosDir".freeze -MAX_PENDING_RANDOM_TASKS = 10 +MAX_PENDING_RANDOM_TASKS = 11 def maybe? [true, false].sample @@ -65,7 +65,7 @@ end def skill_add!(skills_str, dry) skills_file = "#{WORKTIME_DIR}/skills.txt" - skills_str.split(',').map(&:strip).each { |skill| skills[skill.to_s.downcase] = skill } + skills_str.split(',').map(&:strip).each { skills[_1.to_s.downcase] = _1 } File.foreach(skills_file) do |line| line.chomp! @@ -109,8 +109,10 @@ def gos_queue!(tags, message, dry) end def task_add!(tags, quote, due, dry) - tags << 'track' if tags.include?('tr') - tags.delete('tr') + if tags.include?('tr') + tags << 'track' + tags.delete('tr') + end tags << 'work' if tags.include?('mentoring') || tags.include?('productivity') tags.uniq! @@ -130,7 +132,7 @@ end def unscheduled_tasks lines = `task -lowhigh -unsched -nosched -notes -note -meeting -track due: 2>/dev/null`.split("\n").drop(1) lines.pop - lines.map { |line| line.split.first }.each do |id| + lines.map { _1.split.first }.each do |id| yield id if id.to_i.positive? end end |
