fiber-annotation-0.2.0/0000755000004100000410000000000015144131120014770 5ustar www-datawww-datafiber-annotation-0.2.0/fiber-annotation.gemspec0000644000004100000410000000543715144131120021605 0ustar www-datawww-data######################################################### # This file has been automatically generated by gem2tgz # ######################################################### # -*- encoding: utf-8 -*- # stub: fiber-annotation 0.2.0 ruby lib Gem::Specification.new do |s| s.name = "fiber-annotation".freeze s.version = "0.2.0".freeze s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version= s.metadata = { "funding_uri" => "https://github.com/sponsors/ioquatix/" } if s.respond_to? :metadata= s.require_paths = ["lib".freeze] s.authors = ["Samuel Williams".freeze] s.cert_chain = ["-----BEGIN CERTIFICATE-----\nMIIE2DCCA0CgAwIBAgIBATANBgkqhkiG9w0BAQsFADBhMRgwFgYDVQQDDA9zYW11\nZWwud2lsbGlhbXMxHTAbBgoJkiaJk/IsZAEZFg1vcmlvbnRyYW5zZmVyMRIwEAYK\nCZImiZPyLGQBGRYCY28xEjAQBgoJkiaJk/IsZAEZFgJuejAeFw0yMjA4MDYwNDUz\nMjRaFw0zMjA4MDMwNDUzMjRaMGExGDAWBgNVBAMMD3NhbXVlbC53aWxsaWFtczEd\nMBsGCgmSJomT8ixkARkWDW9yaW9udHJhbnNmZXIxEjAQBgoJkiaJk/IsZAEZFgJj\nbzESMBAGCgmSJomT8ixkARkWAm56MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIB\nigKCAYEAomvSopQXQ24+9DBB6I6jxRI2auu3VVb4nOjmmHq7XWM4u3HL+pni63X2\n9qZdoq9xt7H+RPbwL28LDpDNflYQXoOhoVhQ37Pjn9YDjl8/4/9xa9+NUpl9XDIW\nsGkaOY0eqsQm1pEWkHJr3zn/fxoKPZPfaJOglovdxf7dgsHz67Xgd/ka+Wo1YqoE\ne5AUKRwUuvaUaumAKgPH+4E4oiLXI4T1Ff5Q7xxv6yXvHuYtlMHhYfgNn8iiW8WN\nXibYXPNP7NtieSQqwR/xM6I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["lib/fiber/annotation.rb".freeze, "lib/fiber/annotation/version.rb".freeze, "license.md".freeze, "readme.md".freeze] s.homepage = "https://github.com/ioquatix/fiber-annotation".freeze s.licenses = ["MIT".freeze] s.required_ruby_version = Gem::Requirement.new(">= 2.7".freeze) s.rubygems_version = "3.4.7".freeze s.summary = "A mechanism for annotating fibers.".freeze end fiber-annotation-0.2.0/lib/0000755000004100000410000000000015144131120015536 5ustar www-datawww-datafiber-annotation-0.2.0/lib/fiber/0000755000004100000410000000000015144131120016625 5ustar www-datawww-datafiber-annotation-0.2.0/lib/fiber/annotation/0000755000004100000410000000000015144131120020777 5ustar www-datawww-datafiber-annotation-0.2.0/lib/fiber/annotation/version.rb0000644000004100000410000000024515144131120023012 0ustar www-datawww-data# frozen_string_literal: true # Released under the MIT License. # Copyright, 2023, by Samuel Williams. class Fiber module Annotation VERSION = "0.2.0" end end fiber-annotation-0.2.0/lib/fiber/annotation.rb0000644000004100000410000000302315144131120021322 0ustar www-datawww-data# frozen_string_literal: true # Released under the MIT License. # Copyright, 2023, by Samuel Williams. require 'fiber' class Fiber # A mechanism for annotating fibers. module Annotation # Annotate the current fiber with the given annotation. # @parameter annotation [Object] The annotation to set. def initialize(annotation: nil, **options, &block) @annotation = annotation super(**options, &block) end # Get the current annotation. # @returns [Object] The current annotation. attr_accessor :annotation # Annotate the current fiber with the given annotation. # # If a block is given, the annotation is set for the duration of the block and then restored to the previous value. # # The block form of this method should only be invoked on the current fiber. # # @parameter annotation [Object] The annotation to set. # @yields {} The block to execute with the given annotation. # @returns [Object] The return value of the block. def annotate(annotation) if block_given? raise "Cannot annotation a different fiber!" unless Fiber.current == self begin current_annotation = @annotation @annotation = annotation return yield ensure @annotation = current_annotation end else @annotation = annotation end end end end unless Fiber.method_defined?(:annotation) Fiber.prepend(Fiber::Annotation) # @scope Fiber # @name self.annotate # Annotate the current fiber with the given annotation. def Fiber.annotate(...) Fiber.current.annotate(...) end end fiber-annotation-0.2.0/checksums.yaml.gz.sig0000444000004100000410000000060015144131120021033 0ustar www-datawww-dataP% AH20<. AE&ICe[Bs*&ȨHZ" +R ~{@S6a^qA,6+U!Oה4XL]AwRn?ݚv/Z/B6ZNEWX\Ѯw,]F&-4VF0Bq$@kϷ%K?oax]t9#?J^ޖ'P,EZ!uۇVUfG8_X*O4z4:v`LIhK=> M.IPwSd]7F_E&4];{cfP=Ist@ 6J!, ?5iQl6fiber-annotation-0.2.0/readme.md0000644000004100000410000000124215144131120016546 0ustar www-datawww-data# Fiber::Annotation A simple way to annotate what a fiber is currently doing, useful for debugging, logging and tracing. [![Development Status](https://github.com/ioquatix/fiber-annotation/workflows/Test/badge.svg)](https://github.com/ioquatix/fiber-annotation/actions?workflow=Test) ## Usage Please see the [project documentation](https://ioquatix.github.io/fiber-annotation). ## Contributing We welcome contributions to this project. 1. Fork it. 2. Create your feature branch (`git checkout -b my-new-feature`). 3. Commit your changes (`git commit -am 'Add some feature'`). 4. Push to the branch (`git push origin my-new-feature`). 5. Create new Pull Request. fiber-annotation-0.2.0/data.tar.gz.sig0000444000004100000410000000060015144131120017603 0ustar www-datawww-data)n2Ę.H&{JT l W񳯆ῳ~;O?xHfG{S24wPk{Խx. @ccW"/Qr,ѠHpHK76dYooSC1!gnHp#dOȋc(DqZ!DީְuH< \~W!Ҿ0w**.cxQd0ȉHzRKɃT@(a| n?}2;<\ C^=Q&nlB,Wkп7դqlzeOJ6V~KPfmbFx<9CYeH<͍Gt/fiber-annotation-0.2.0/license.md0000644000004100000410000000206615144131120016740 0ustar www-datawww-data# MIT License Copyright, 2023, by Samuel Williams. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. fiber-annotation-0.2.0/metadata.gz.sig0000444000004100000410000000060015144131120017665 0ustar www-datawww-datay\e(ADsSүme "=<k=CD/;mדǻV:i`.TMk^5IƶI VUм:T 3Tec27i|MW5LIiV;\Py VG{XÏ|VZ8hCY=yf|V@aw" hwWn`G(^׶ Ud\(}͸LZ48)(bX&\[o(!b3lK⦄6ky}auD+!@Xuŵ;'}|5JPqSy,7?0#4awLI71Wޠ,