Sha256: 0bbcf7a90c2771b8d01ffefb458e728208495411f296da75d7c1233c03f897c8
Contents?: true
Size: 828 Bytes
Versions: 7
Compression:
Stored size: 828 Bytes
Contents
require 'taskwarrior-web/command_builders/base' module TaskwarriorWeb::CommandBuilder::V1 include TaskwarriorWeb::CommandBuilder::Base def build unless @command_string task_command substitute_parts if @command_string =~ /:id/ end parse_params @built = "#{self.command_string}#{params}" end # Overridden from TaskwarriorWeb::CommandBuilder::Base # # Substitute the task's ID for its UUID. def substitute_parts if @id assign_id_from_uuid @command_string.gsub!(':id', @id.to_s) return self else raise TaskwarriorWeb::CommandBuilder::MissingTaskIDError end end def assign_id_from_uuid @all_tasks ||= TaskwarriorWeb::Task.query('status.not' => [:deleted, :completed]) @id = @all_tasks.index { |task| task.uuid == @id } + 1 end end
Version data entries
7 entries across 7 versions & 1 rubygems