repo
stringlengths
5
92
file_url
stringlengths
80
287
file_path
stringlengths
5
197
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:37:27
2026-01-04 17:58:21
truncated
bool
2 classes
poise/poise-python
https://github.com/poise/poise-python/blob/eeb0fc0ee50e8baef15ab4f91601994e5b40a272/lib/poise_python/python_providers/portable_pypy3.rb
lib/poise_python/python_providers/portable_pypy3.rb
# # Copyright 2015-2017, Noah Kantrowitz # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
ruby
Apache-2.0
eeb0fc0ee50e8baef15ab4f91601994e5b40a272
2026-01-04T17:52:09.242542Z
false
poise/poise-python
https://github.com/poise/poise-python/blob/eeb0fc0ee50e8baef15ab4f91601994e5b40a272/lib/poise_python/python_providers/msi.rb
lib/poise_python/python_providers/msi.rb
# # Copyright 2016-2017, Noah Kantrowitz # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
ruby
Apache-2.0
eeb0fc0ee50e8baef15ab4f91601994e5b40a272
2026-01-04T17:52:09.242542Z
false
poise/poise-python
https://github.com/poise/poise-python/blob/eeb0fc0ee50e8baef15ab4f91601994e5b40a272/lib/poise_python/utils/python_encoder.rb
lib/poise_python/utils/python_encoder.rb
# # Copyright 2015-2017, Noah Kantrowitz # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
ruby
Apache-2.0
eeb0fc0ee50e8baef15ab4f91601994e5b40a272
2026-01-04T17:52:09.242542Z
false
poise/poise-python
https://github.com/poise/poise-python/blob/eeb0fc0ee50e8baef15ab4f91601994e5b40a272/lib/poise_python/resources/python_execute.rb
lib/poise_python/resources/python_execute.rb
# # Copyright 2015-2017, Noah Kantrowitz # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
ruby
Apache-2.0
eeb0fc0ee50e8baef15ab4f91601994e5b40a272
2026-01-04T17:52:09.242542Z
false
poise/poise-python
https://github.com/poise/poise-python/blob/eeb0fc0ee50e8baef15ab4f91601994e5b40a272/lib/poise_python/resources/python_runtime_pip.rb
lib/poise_python/resources/python_runtime_pip.rb
# # Copyright 2015-2017, Noah Kantrowitz # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
ruby
Apache-2.0
eeb0fc0ee50e8baef15ab4f91601994e5b40a272
2026-01-04T17:52:09.242542Z
false
poise/poise-python
https://github.com/poise/poise-python/blob/eeb0fc0ee50e8baef15ab4f91601994e5b40a272/lib/poise_python/resources/pip_requirements.rb
lib/poise_python/resources/pip_requirements.rb
# # Copyright 2015-2017, Noah Kantrowitz # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
ruby
Apache-2.0
eeb0fc0ee50e8baef15ab4f91601994e5b40a272
2026-01-04T17:52:09.242542Z
false
poise/poise-python
https://github.com/poise/poise-python/blob/eeb0fc0ee50e8baef15ab4f91601994e5b40a272/lib/poise_python/resources/python_runtime.rb
lib/poise_python/resources/python_runtime.rb
# # Copyright 2015-2017, Noah Kantrowitz # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
ruby
Apache-2.0
eeb0fc0ee50e8baef15ab4f91601994e5b40a272
2026-01-04T17:52:09.242542Z
false
poise/poise-python
https://github.com/poise/poise-python/blob/eeb0fc0ee50e8baef15ab4f91601994e5b40a272/lib/poise_python/resources/python_package.rb
lib/poise_python/resources/python_package.rb
# # Copyright 2015-2017, Noah Kantrowitz # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
ruby
Apache-2.0
eeb0fc0ee50e8baef15ab4f91601994e5b40a272
2026-01-04T17:52:09.242542Z
false
poise/poise-python
https://github.com/poise/poise-python/blob/eeb0fc0ee50e8baef15ab4f91601994e5b40a272/lib/poise_python/resources/python_virtualenv.rb
lib/poise_python/resources/python_virtualenv.rb
# # Copyright 2015-2017, Noah Kantrowitz # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
ruby
Apache-2.0
eeb0fc0ee50e8baef15ab4f91601994e5b40a272
2026-01-04T17:52:09.242542Z
false
poise/poise-python
https://github.com/poise/poise-python/blob/eeb0fc0ee50e8baef15ab4f91601994e5b40a272/lib/poise_python/resources/python_runtime_test.rb
lib/poise_python/resources/python_runtime_test.rb
# # Copyright 2015-2017, Noah Kantrowitz # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
ruby
Apache-2.0
eeb0fc0ee50e8baef15ab4f91601994e5b40a272
2026-01-04T17:52:09.242542Z
false
holiday-jp/holiday_jp
https://github.com/holiday-jp/holiday_jp/blob/f9d2e3c5c1347103ead5f12c588e4a69178b911c/spec/holidays_detailed_spec.rb
spec/holidays_detailed_spec.rb
# -*- coding: utf-8 -*- require 'spec_helper' require 'yaml' require 'json' require 'date' context 'Emperor\'s Birthday' do before do @holidays_detailed = YAML.load_file(File.expand_path('../../holidays_detailed.yml', __FILE__), permitted_classes: [Date]) end it 'holidays_detail.yml should have holiday in S...
ruby
MIT
f9d2e3c5c1347103ead5f12c588e4a69178b911c
2026-01-04T17:52:20.035353Z
false
holiday-jp/holiday_jp
https://github.com/holiday-jp/holiday_jp/blob/f9d2e3c5c1347103ead5f12c588e4a69178b911c/spec/syukujitsu_csv_spec.rb
spec/syukujitsu_csv_spec.rb
# -*- coding: utf-8 -*- require 'spec_helper' require 'yaml' require 'csv' require 'open-uri' require 'date' require 'uri' context 'Check holidays.yml by syukujitsu.csv' do before do @holidays = YAML.load_file(File.expand_path('../../holidays.yml', __FILE__), permitted_classes: [Date]) csv_url = 'https://www...
ruby
MIT
f9d2e3c5c1347103ead5f12c588e4a69178b911c
2026-01-04T17:52:20.035353Z
false
holiday-jp/holiday_jp
https://github.com/holiday-jp/holiday_jp/blob/f9d2e3c5c1347103ead5f12c588e4a69178b911c/spec/spec_helper.rb
spec/spec_helper.rb
ruby
MIT
f9d2e3c5c1347103ead5f12c588e4a69178b911c
2026-01-04T17:52:20.035353Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/app/jobs/sbmt/outbox/delete_stale_outbox_items_job.rb
app/jobs/sbmt/outbox/delete_stale_outbox_items_job.rb
# frozen_string_literal: true module Sbmt module Outbox class DeleteStaleOutboxItemsJob < BaseDeleteStaleItemsJob queue_as :outbox class << self def item_classes Outbox.outbox_item_classes end end end end end
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/app/jobs/sbmt/outbox/base_delete_stale_items_job.rb
app/jobs/sbmt/outbox/base_delete_stale_items_job.rb
# frozen_string_literal: true require "redlock" module Sbmt module Outbox class BaseDeleteStaleItemsJob < Outbox.active_job_base_class LOCK_TTL = 10_800_000 class << self def enqueue item_classes.each do |item_class| delay = rand(15).seconds set(wait: delay...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/app/jobs/sbmt/outbox/delete_stale_inbox_items_job.rb
app/jobs/sbmt/outbox/delete_stale_inbox_items_job.rb
# frozen_string_literal: true module Sbmt module Outbox class DeleteStaleInboxItemsJob < BaseDeleteStaleItemsJob queue_as :inbox class << self def item_classes Outbox.inbox_item_classes end end end end end
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/app/controllers/sbmt/outbox/root_controller.rb
app/controllers/sbmt/outbox/root_controller.rb
# frozen_string_literal: true module Sbmt module Outbox class RootController < Sbmt::Outbox.action_controller_base_class def index @local_endpoint = Outbox.config.ui.local_endpoint @cdn_url = Outbox.config.ui.cdn_url end end end end
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/app/controllers/sbmt/outbox/api/outbox_classes_controller.rb
app/controllers/sbmt/outbox/api/outbox_classes_controller.rb
# frozen_string_literal: true module Sbmt module Outbox module Api class OutboxClassesController < BaseController def index render_list(Sbmt::Outbox.outbox_item_classes.map do |item| Api::OutboxClass.find_or_initialize(item.box_id) end) end def show ...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/app/controllers/sbmt/outbox/api/inbox_classes_controller.rb
app/controllers/sbmt/outbox/api/inbox_classes_controller.rb
# frozen_string_literal: true module Sbmt module Outbox module Api class InboxClassesController < BaseController def index render_list(Sbmt::Outbox.inbox_item_classes.map do |item| Sbmt::Outbox::Api::InboxClass.find_or_initialize(item.box_id) end) end ...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/app/controllers/sbmt/outbox/api/base_controller.rb
app/controllers/sbmt/outbox/api/base_controller.rb
# frozen_string_literal: true module Sbmt module Outbox module Api class BaseController < Sbmt::Outbox.action_controller_api_base_class private def render_ok render json: "OK" end def render_one(record) render json: record end def rende...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/app/models/sbmt/outbox/base_item.rb
app/models/sbmt/outbox/base_item.rb
# frozen_string_literal: true # For compatibility with rails < 7 # Remove when drop support of Rails < 7 require_relative "../../../../lib/sbmt/outbox/enum_refinement" using Sbmt::Outbox::EnumRefinement module Sbmt module Outbox class BaseItem < Outbox.active_record_base_class self.abstract_class = true ...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/app/models/sbmt/outbox/outbox_item_config.rb
app/models/sbmt/outbox/outbox_item_config.rb
# frozen_string_literal: true module Sbmt module Outbox class OutboxItemConfig < BaseItemConfig def polling_enabled? polling_enabled_for?(Sbmt::Outbox::Api::OutboxClass) end private def lookup_config yaml_config.dig(:outbox_items, box_name) end end end end
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/app/models/sbmt/outbox/inbox_item.rb
app/models/sbmt/outbox/inbox_item.rb
# frozen_string_literal: true module Sbmt module Outbox class InboxItem < BaseItem self.abstract_class = true class << self alias_method :inbox_name, :box_name def box_type :inbox end def lookup_config Sbmt::Outbox::InboxItemConfig end ...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/app/models/sbmt/outbox/inbox_item_config.rb
app/models/sbmt/outbox/inbox_item_config.rb
# frozen_string_literal: true module Sbmt module Outbox class InboxItemConfig < BaseItemConfig def polling_enabled? polling_enabled_for?(Sbmt::Outbox::Api::InboxClass) end private def lookup_config yaml_config.dig(:inbox_items, box_name) end end end end
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/app/models/sbmt/outbox/base_item_config.rb
app/models/sbmt/outbox/base_item_config.rb
# frozen_string_literal: true module Sbmt module Outbox class BaseItemConfig DEFAULT_BUCKET_SIZE = 16 DEFAULT_PARTITION_STRATEGY = :number delegate :yaml_config, :memory_store, to: "Sbmt::Outbox" def initialize(box_id:, box_name:) self.box_id = box_id self.box_name = box...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/app/models/sbmt/outbox/outbox_item.rb
app/models/sbmt/outbox/outbox_item.rb
# frozen_string_literal: true module Sbmt module Outbox class OutboxItem < BaseItem self.abstract_class = true IDEMPOTENCY_HEADER_NAME = "Idempotency-Key" SEQUENCE_HEADER_NAME = "Sequence-ID" EVENT_TIME_HEADER_NAME = "Created-At" OUTBOX_HEADER_NAME = "Outbox-Name" DISPATCH_TI...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/app/models/sbmt/outbox/api/outbox_class.rb
app/models/sbmt/outbox/api/outbox_class.rb
# frozen_string_literal: true module Sbmt module Outbox module Api class OutboxClass < Api::BoxClass end end end end
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/app/models/sbmt/outbox/api/box_class.rb
app/models/sbmt/outbox/api/box_class.rb
# frozen_string_literal: true module Sbmt module Outbox module Api class BoxClass < Api::ApplicationRecord attribute :id, :string attribute :polling_enabled, :boolean, default: -> { !Outbox.yaml_config.fetch(:polling_auto_disabled, false) } end end end end
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/app/models/sbmt/outbox/api/application_record.rb
app/models/sbmt/outbox/api/application_record.rb
# frozen_string_literal: true module Sbmt module Outbox module Api class ApplicationRecord include ActiveModel::Model include ActiveModel::Attributes delegate :redis, to: "Sbmt::Outbox" class << self delegate :redis, to: "Sbmt::Outbox" def find(id) ...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/app/models/sbmt/outbox/api/inbox_class.rb
app/models/sbmt/outbox/api/inbox_class.rb
# frozen_string_literal: true module Sbmt module Outbox module Api class InboxClass < Api::BoxClass end end end end
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/app/interactors/sbmt/outbox/create_outbox_item.rb
app/interactors/sbmt/outbox/create_outbox_item.rb
# frozen_string_literal: true module Sbmt module Outbox # Classes are the same now, but they may differ, # hence we should have separate API entrypoints class CreateOutboxItem < Sbmt::Outbox::BaseCreateItem end end end
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/app/interactors/sbmt/outbox/dry_interactor.rb
app/interactors/sbmt/outbox/dry_interactor.rb
# frozen_string_literal: true module Sbmt module Outbox class DryInteractor extend Dry::Initializer include Dry::Monads[:result, :do, :maybe, :list, :try] class << self def call(*args, **kwargs) new(*args, **kwargs).call end end end end end
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/app/interactors/sbmt/outbox/create_outbox_batch.rb
app/interactors/sbmt/outbox/create_outbox_batch.rb
# frozen_string_literal: true require "sbmt/outbox/metrics/utils" # Provides ability to insert records in batches. # It allows to have different headers, event_key and partition_by between set of attributes, # but for predictability of metrics results better to have same headers across items module Sbmt module Out...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/app/interactors/sbmt/outbox/base_create_item.rb
app/interactors/sbmt/outbox/base_create_item.rb
# frozen_string_literal: true require "sbmt/outbox/metrics/utils" module Sbmt module Outbox class BaseCreateItem < Outbox::DryInteractor param :item_class, reader: :private option :attributes, reader: :private option :event_key, reader: :private, optional: true, default: -> { attributes[:event...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/app/interactors/sbmt/outbox/create_inbox_item.rb
app/interactors/sbmt/outbox/create_inbox_item.rb
# frozen_string_literal: true module Sbmt module Outbox # Classes are the same now, but they may differ, # hence we should have separate API entrypoints class CreateInboxItem < Sbmt::Outbox::BaseCreateItem end end end
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/app/interactors/sbmt/outbox/process_item.rb
app/interactors/sbmt/outbox/process_item.rb
# frozen_string_literal: true require "sbmt/outbox/metrics/utils" require "sbmt/outbox/v2/redis_item_meta" module Sbmt module Outbox class ProcessItem < Sbmt::Outbox::DryInteractor param :item_class, reader: :private param :item_id, reader: :private option :worker_version, reader: :private, op...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/app/interactors/sbmt/outbox/retry_strategies/latest_available.rb
app/interactors/sbmt/outbox/retry_strategies/latest_available.rb
# frozen_string_literal: true module Sbmt module Outbox module RetryStrategies class LatestAvailable < Base def call unless item.has_attribute?(:event_key) return Failure(:missing_event_key) end if item.event_key.nil? return Failure(:empty_even...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/app/interactors/sbmt/outbox/retry_strategies/compacted_log.rb
app/interactors/sbmt/outbox/retry_strategies/compacted_log.rb
# frozen_string_literal: true module Sbmt module Outbox module RetryStrategies class CompactedLog < LatestAvailable # exists only as alias for backward compatibility end end end end
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/app/interactors/sbmt/outbox/retry_strategies/no_delay.rb
app/interactors/sbmt/outbox/retry_strategies/no_delay.rb
# frozen_string_literal: true module Sbmt module Outbox module RetryStrategies class NoDelay < Base def call Success() end end end end end
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/app/interactors/sbmt/outbox/retry_strategies/base.rb
app/interactors/sbmt/outbox/retry_strategies/base.rb
# frozen_string_literal: true module Sbmt module Outbox module RetryStrategies class Base < Outbox::DryInteractor param :item def call raise NotImplementedError, "Implement #call for Sbmt::Outbox::RetryStrategies::Base" end end end end end
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/app/interactors/sbmt/outbox/retry_strategies/exponential_backoff.rb
app/interactors/sbmt/outbox/retry_strategies/exponential_backoff.rb
# frozen_string_literal: true module Sbmt module Outbox module RetryStrategies class ExponentialBackoff < Base def call delay = backoff(item.config).interval_at(item.errors_count - 1) still_early = item.processed_at + delay.seconds > Time.current if still_early ...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/app/interactors/sbmt/outbox/partition_strategies/number_partitioning.rb
app/interactors/sbmt/outbox/partition_strategies/number_partitioning.rb
# frozen_string_literal: true module Sbmt module Outbox module PartitionStrategies class NumberPartitioning < Outbox::DryInteractor param :key param :bucket_size def call parsed_key = case key when Integer key else ...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/app/interactors/sbmt/outbox/partition_strategies/hash_partitioning.rb
app/interactors/sbmt/outbox/partition_strategies/hash_partitioning.rb
# frozen_string_literal: true require "digest/sha1" module Sbmt module Outbox module PartitionStrategies class HashPartitioning < Outbox::DryInteractor param :key param :bucket_size def call Success( Digest::SHA1.hexdigest(key.to_s).to_i(16) % bucket_size ...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/rails_helper.rb
spec/rails_helper.rb
# frozen_string_literal: true # Engine root is used by rails_configuration to correctly # load fixtures and support files require "pathname" ENGINE_ROOT = Pathname.new(File.expand_path("..", __dir__)) ENV["RAILS_ENV"] = "test" require "combustion" begin Combustion.initialize! :active_record, :active_job, :action_...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/spec_helper.rb
spec/spec_helper.rb
# frozen_string_literal: true ENV["RAILS_ENV"] = "test" require "bundler/setup" require "rspec" require "rspec_junit_formatter" RSpec.configure do |config| config.expect_with :rspec do |expectations| expectations.include_chain_clauses_in_custom_matcher_descriptions = true end config.mock_with :rspec do |mo...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/jobs/sbmt/outbox/delete_stale_outbox_items_job_spec.rb
spec/jobs/sbmt/outbox/delete_stale_outbox_items_job_spec.rb
# frozen_string_literal: true describe Sbmt::Outbox::DeleteStaleOutboxItemsJob do it { expect(described_class.item_classes).to eq [OutboxItem, Combined::OutboxItem] } end
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/jobs/sbmt/outbox/delete_stale_inbox_items_job_spec.rb
spec/jobs/sbmt/outbox/delete_stale_inbox_items_job_spec.rb
# frozen_string_literal: true describe Sbmt::Outbox::DeleteStaleInboxItemsJob do it { expect(described_class.item_classes).to eq [InboxItem] } end
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/jobs/sbmt/outbox/base_delete_stale_items_job_spec.rb
spec/jobs/sbmt/outbox/base_delete_stale_items_job_spec.rb
# frozen_string_literal: true describe Sbmt::Outbox::BaseDeleteStaleItemsJob do let(:job_class) do Class.new(described_class) do class << self def item_classes [OutboxItem] end end end end let!(:item_delivered) { create(:outbox_item, created_at: created_at, status: ...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/services/sbmt/outbox/retry_strategies/exponential_backoff_spec.rb
spec/services/sbmt/outbox/retry_strategies/exponential_backoff_spec.rb
# frozen_string_literal: true describe Sbmt::Outbox::RetryStrategies::ExponentialBackoff do subject(:result) { described_class.call(outbox_item) } let(:outbox_item) { create(:outbox_item, processed_at: processed_at) } let(:processed_at) { Time.zone.now } context "when the next processing time is greater tha...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/factories/outbox_item_factory.rb
spec/factories/outbox_item_factory.rb
# frozen_string_literal: true FactoryBot.define do factory :outbox_item, class: "OutboxItem" do payload { "test" } sequence(:event_key) bucket { 0 } end end
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/factories/combined_outbox_item_factory.rb
spec/factories/combined_outbox_item_factory.rb
# frozen_string_literal: true FactoryBot.define do factory :combined_outbox_item, class: "Combined::OutboxItem" do payload { "test" } event_name { "order_created" } sequence(:event_key) bucket { 0 } end end
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/factories/inbox_item_factory.rb
spec/factories/inbox_item_factory.rb
# frozen_string_literal: true FactoryBot.define do factory :inbox_item, class: "InboxItem" do payload { "test" } sequence(:event_key) bucket { 0 } end end
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/controllers/sbmt/outbox/api/inbox_classes_controller_spec.rb
spec/controllers/sbmt/outbox/api/inbox_classes_controller_spec.rb
# frozen_string_literal: true describe Sbmt::Outbox::Api::InboxClassesController do routes { Sbmt::Outbox::Engine.routes } let(:box_id) { InboxItem.box_name } describe "#index" do it "returns raw inbox items" do get :index expect(response).to be_successful data = response.parsed_body ...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/controllers/sbmt/outbox/api/outbox_classes_controller_spec.rb
spec/controllers/sbmt/outbox/api/outbox_classes_controller_spec.rb
# frozen_string_literal: true describe Sbmt::Outbox::Api::OutboxClassesController do routes { Sbmt::Outbox::Engine.routes } let(:box_id) { OutboxItem.box_name } describe "#index" do it "returns raw outbox items" do get :index expect(response).to be_successful data = response.parsed_body ...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/models/sbmt/outbox/base_item_spec.rb
spec/models/sbmt/outbox/base_item_spec.rb
# frozen_string_literal: true describe Sbmt::Outbox::BaseItem do describe "#max_retries_exceeded?" do let(:outbox_item) { create(:outbox_item) } before do allow(outbox_item.config).to receive(:max_retries).and_return(1) end it "has available retries" do expect(outbox_item).not_to be_max...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/models/sbmt/outbox/inbox_item_config_spec.rb
spec/models/sbmt/outbox/inbox_item_config_spec.rb
# frozen_string_literal: true describe Sbmt::Outbox::InboxItemConfig do let(:config) { InboxItem.config } describe "polling auto enabled by default" do it { expect(config.polling_enabled?).to be true } end context "when polling is disabled" do before { Sbmt::Outbox::Api::InboxClass.new(id: InboxItem....
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/models/sbmt/outbox/outbox_item_config_spec.rb
spec/models/sbmt/outbox/outbox_item_config_spec.rb
# frozen_string_literal: true describe Sbmt::Outbox::OutboxItemConfig do let(:config) { OutboxItem.config } describe "polling auto enabled by default" do it { expect(config.polling_enabled?).to be true } end context "when polling is disabled" do before { Sbmt::Outbox::Api::OutboxClass.new(id: OutboxI...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/models/sbmt/outbox/api/application_record_spec.rb
spec/models/sbmt/outbox/api/application_record_spec.rb
# frozen_string_literal: true describe Sbmt::Outbox::Api::ApplicationRecord do let(:model) do Class.new(described_class) do attribute :id, :integer end end describe ".find" do context "when record exists" do let!(:record) { model.new(id: 14).tap(&:save) } it { expect(model.find(14...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/interactors/sbmt/outbox/process_item_spec.rb
spec/interactors/sbmt/outbox/process_item_spec.rb
# frozen_string_literal: true require "ostruct" describe Sbmt::Outbox::ProcessItem do describe "#call" do subject(:result) { described_class.call(OutboxItem, outbox_item.id, worker_version: worker_version, redis: redis) } let(:redis) { nil } let(:worker_version) { 1 } let(:max_retries) { 0 } le...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/interactors/sbmt/outbox/create_outbox_item_spec.rb
spec/interactors/sbmt/outbox/create_outbox_item_spec.rb
# frozen_string_literal: true describe Sbmt::Outbox::CreateOutboxItem do subject(:result) { described_class.call(Combined::OutboxItem, attributes: attributes) } let(:attributes) do { payload: "test", event_key: 10, event_name: "order_created" } end it "creates a record" do expec...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/interactors/sbmt/outbox/create_inbox_item_spec.rb
spec/interactors/sbmt/outbox/create_inbox_item_spec.rb
# frozen_string_literal: true describe Sbmt::Outbox::CreateInboxItem do subject(:result) { described_class.call(InboxItem, attributes: attributes) } let(:attributes) do { payload: "test", event_key: 10 } end it "creates a record" do expect { result }.to change(InboxItem, :count).by(1)...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/interactors/sbmt/outbox/create_outbox_batch_spec.rb
spec/interactors/sbmt/outbox/create_outbox_batch_spec.rb
# frozen_string_literal: true describe Sbmt::Outbox::CreateOutboxBatch do subject(:result) { described_class.call(Combined::OutboxItem, batch_attributes: batch_attributes) } let(:batch_attributes) do [ { payload: "test", event_key: 10, event_name: "order_created" }, {...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/interactors/sbmt/outbox/retry_strategies/compacted_log_spec.rb
spec/interactors/sbmt/outbox/retry_strategies/compacted_log_spec.rb
# frozen_string_literal: true describe Sbmt::Outbox::RetryStrategies::CompactedLog do subject(:result) { described_class.call(outbox_item_1) } let(:event_key) { 10 } let!(:outbox_item_1) { create(:combined_outbox_item, event_key: 10) } context "when there are no items ahead" do it { expect(result).to be_...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/internal/app/jobs/application_job.rb
spec/internal/app/jobs/application_job.rb
# frozen_string_literal: true class ApplicationJob < ActiveJob::Base end
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/internal/app/models/inbox_item.rb
spec/internal/app/models/inbox_item.rb
# frozen_string_literal: true class InboxItem < Sbmt::Outbox::InboxItem end
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/internal/app/models/application_record.rb
spec/internal/app/models/application_record.rb
# frozen_string_literal: true class ApplicationRecord < ActiveRecord::Base self.abstract_class = true end
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/internal/app/models/outbox_item.rb
spec/internal/app/models/outbox_item.rb
# frozen_string_literal: true class OutboxItem < Sbmt::Outbox::OutboxItem end
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/internal/app/models/combined/outbox_item.rb
spec/internal/app/models/combined/outbox_item.rb
# frozen_string_literal: true module Combined class OutboxItem < Sbmt::Outbox::OutboxItem self.table_name = :combined_outbox_items validates :event_name, presence: true end end
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/internal/app/producers/producer.rb
spec/internal/app/producers/producer.rb
# frozen_string_literal: true class Producer < Sbmt::Outbox::DryInteractor option :topic option :kafka, optional: true def call(item, payload) publish end def publish true end end
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/internal/app/interactors/payload_renderer.rb
spec/internal/app/interactors/payload_renderer.rb
# frozen_string_literal: true class PayloadRenderer < Sbmt::Outbox::DryInteractor param :outbox_item def call Success("custom-payload") end end
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/internal/app/interactors/http_order_sender.rb
spec/internal/app/interactors/http_order_sender.rb
# frozen_string_literal: true class HttpOrderSender < Sbmt::Outbox::DryInteractor param :outbox_item param :payload def call Success() end end
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/internal/app/interactors/import_order.rb
spec/internal/app/interactors/import_order.rb
# frozen_string_literal: true class ImportOrder < Sbmt::Outbox::DryInteractor option :source def call(outbox_item, payload) Success() end end
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/internal/app/interactors/kafka_producer/outbox_transport_factory.rb
spec/internal/app/interactors/kafka_producer/outbox_transport_factory.rb
# frozen_string_literal: true module KafkaProducer class OutboxTransportFactory def self.build(topic:, kafka: {}) ::Producer.new(topic: topic, kafka: kafka) end end end
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/internal/db/schema.rb
spec/internal/db/schema.rb
# frozen_string_literal: true ActiveRecord::Schema.define do create_table :outbox_items do |t| t.uuid :uuid, null: false t.bigint :event_key, null: false t.bigint :bucket, null: false t.json :options t.binary :payload, null: false t.integer :status, null: false, default: 0 t.integer :erro...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/internal/config/routes.rb
spec/internal/config/routes.rb
# frozen_string_literal: true Rails.application.routes.draw do mount Sbmt::Outbox::Engine => "/outbox-ui" end
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/internal/config/initializers/outbox.rb
spec/internal/config/initializers/outbox.rb
# frozen_string_literal: true Rails.application.config.outbox.tap do |config| config.poller.tap do |pc| pc.tactic = "noop" pc.queue_delay = 0 pc.min_queue_size = 1 end config.processor.tap do |pc| pc.brpop_delay = 0.1 end end
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/internal/config/initializers/open_telemetry.rb
spec/internal/config/initializers/open_telemetry.rb
# frozen_string_literal: true return if Rails.env.test? OpenTelemetry::SDK.configure do |c| c.add_span_processor( OpenTelemetry::SDK::Trace::Export::BatchSpanProcessor.new( OpenTelemetry::SDK::Trace::Export::ConsoleSpanExporter.new ) ) c.service_name = "rails-app" c.use_all end
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/internal/config/initializers/sentry.rb
spec/internal/config/initializers/sentry.rb
# frozen_string_literal: true SENTRY_DUMMY_DSN = "http://12345:67890@sentry.localdomain/sentry/42" Sentry.init do |config| config.dsn = SENTRY_DUMMY_DSN config.transport.transport_class = Sentry::DummyTransport config.enabled_environments = %w[Rails.env] config.traces_sample_rate = 0.5 config.breadcrumbs_log...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/lib/sbmt/outbox_spec.rb
spec/lib/sbmt/outbox_spec.rb
# frozen_string_literal: true describe Sbmt::Outbox do describe "batch_process_middlewares" do it "returns default middlewares" do expect(described_class.batch_process_middlewares).to eq([described_class::Middleware::Sentry::TracingBatchProcessMiddleware]) end end describe "item_process_middleware...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/lib/sbmt/outbox/tasks/delete_items_spec.rb
spec/lib/sbmt/outbox/tasks/delete_items_spec.rb
# frozen_string_literal: true describe "rake outbox:delete_items" do subject(:task) { Rake::Task["outbox:delete_items"] } let(:klass) { "OutboxItem" } let(:status) { 1 } let(:created_at_a) { 6.hours.ago } let(:created_at_b) { 8.hours.ago } let(:created_at_c) { 4.hours.ago } let!(:outbox_item_a) { crea...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/lib/sbmt/outbox/tasks/delete_failed_outbox_items_spec.rb
spec/lib/sbmt/outbox/tasks/delete_failed_outbox_items_spec.rb
# frozen_string_literal: true describe "rake outbox:delete_failed_items" do subject(:task) { Rake::Task["outbox:delete_failed_items"] } let!(:outbox_item_a) { create(:outbox_item, status: :failed, errors_count: 1) } let!(:outbox_item_b) { create(:outbox_item, status: :failed, errors_count: 1) } let!(:outbox_i...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/lib/sbmt/outbox/tasks/update_status_items_spec.rb
spec/lib/sbmt/outbox/tasks/update_status_items_spec.rb
# frozen_string_literal: true describe "rake outbox:update_status_items" do subject(:task) { Rake::Task["outbox:update_status_items"] } let(:klass) { "OutboxItem" } let(:status) { 1 } let(:new_status) { 3 } let(:created_at_a) { 6.hours.ago } let(:created_at_b) { 8.hours.ago } let(:created_at_c) { 4.hou...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/lib/sbmt/outbox/tasks/retry_failed_outbox_items_spec.rb
spec/lib/sbmt/outbox/tasks/retry_failed_outbox_items_spec.rb
# frozen_string_literal: true describe "rake outbox:retry_failed_items" do subject(:task) { Rake::Task["outbox:retry_failed_items"] } let!(:outbox_item_a) { create(:outbox_item, status: :failed, errors_count: 1) } let!(:outbox_item_b) { create(:outbox_item, status: :failed, errors_count: 1) } let!(:outbox_ite...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/lib/sbmt/outbox/middleware/runner_spec.rb
spec/lib/sbmt/outbox/middleware/runner_spec.rb
# frozen_string_literal: true describe Sbmt::Outbox::Middleware::Runner do it "works with an empty stack" do instance = described_class.new([]) expect { instance.call {} }.not_to raise_error end it "calls classes in the same order as given" do a = Class.new do def call(args) args[:resu...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/lib/sbmt/outbox/middleware/sentry/tracing_batch_process_middleware_spec.rb
spec/lib/sbmt/outbox/middleware/sentry/tracing_batch_process_middleware_spec.rb
# frozen_string_literal: true require "ostruct" describe Sbmt::Outbox::Middleware::Sentry::TracingBatchProcessMiddleware do let(:job) { OpenStruct.new(log_tags: {}) } let(:scope) { double("scope") } # rubocop:disable RSpec/VerifiedDoubles it "skips tracing if sentry is not initialized" do expect(::Sentry)....
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/lib/sbmt/outbox/middleware/sentry/tracing_item_process_middleware_spec.rb
spec/lib/sbmt/outbox/middleware/sentry/tracing_item_process_middleware_spec.rb
# frozen_string_literal: true describe Sbmt::Outbox::Middleware::Sentry::TracingItemProcessMiddleware do let(:outbox_item) { create(:outbox_item) } let(:scope) { double("scope") } # rubocop:disable RSpec/VerifiedDoubles let(:trace_id) { "trace-id" } it "skips tracing if sentry is not initialized" do allow...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/lib/sbmt/outbox/middleware/open_telemetry/tracing_create_batch_middleware_spec.rb
spec/lib/sbmt/outbox/middleware/open_telemetry/tracing_create_batch_middleware_spec.rb
# frozen_string_literal: true describe Sbmt::Outbox::Middleware::OpenTelemetry::TracingCreateBatchMiddleware do let(:tracer) { double("tracer") } # rubocop:disable RSpec/VerifiedDoubles let(:instrumentation_instance) { double("instrumentation instance") } # rubocop:disable RSpec/VerifiedDoubles let(:item_class) ...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/lib/sbmt/outbox/middleware/open_telemetry/tracing_item_process_middleware_spec.rb
spec/lib/sbmt/outbox/middleware/open_telemetry/tracing_item_process_middleware_spec.rb
# frozen_string_literal: true describe Sbmt::Outbox::Middleware::OpenTelemetry::TracingItemProcessMiddleware do let(:tracer) { double("tracer") } # rubocop:disable RSpec/VerifiedDoubles let(:instrumentation_instance) { double("instrumentation instance") } # rubocop:disable RSpec/VerifiedDoubles let(:headers) { {...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/lib/sbmt/outbox/middleware/open_telemetry/tracing_create_item_middleware_spec.rb
spec/lib/sbmt/outbox/middleware/open_telemetry/tracing_create_item_middleware_spec.rb
# frozen_string_literal: true describe Sbmt::Outbox::Middleware::OpenTelemetry::TracingCreateItemMiddleware do let(:tracer) { double("tracer") } # rubocop:disable RSpec/VerifiedDoubles let(:instrumentation_instance) { double("instrumentation instance") } # rubocop:disable RSpec/VerifiedDoubles let(:item_class) {...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/lib/sbmt/outbox/middleware/execution_context/context_item_process_middleware_spec.rb
spec/lib/sbmt/outbox/middleware/execution_context/context_item_process_middleware_spec.rb
# frozen_string_literal: true require "sbmt/outbox/middleware/execution_context/context_item_process_middleware" describe Sbmt::Outbox::Middleware::ExecutionContext::ContextItemProcessMiddleware do let(:outbox_item) { create(:outbox_item) } before do skip("not supported in the current Rails version") unless ...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/lib/sbmt/outbox/v2/poll_throttler_spec.rb
spec/lib/sbmt/outbox/v2/poll_throttler_spec.rb
# frozen_string_literal: true require "sbmt/outbox/v2/poll_throttler" describe Sbmt::Outbox::V2::PollThrottler do let(:redis) { instance_double(RedisClient) } let(:tactic) { nil } let(:poller_config) { {} } let(:build) { described_class.build(tactic, redis, poller_config) } describe "#build" do contex...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/lib/sbmt/outbox/v2/box_processor_spec.rb
spec/lib/sbmt/outbox/v2/box_processor_spec.rb
# frozen_string_literal: true require "sbmt/outbox/v2/box_processor" describe Sbmt::Outbox::V2::BoxProcessor do let(:boxes) { [OutboxItem, InboxItem] } let(:threads_count) { 1 } let(:processor_klass) do Class.new(described_class) do def process_task(worker_number, task) # noop end e...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/lib/sbmt/outbox/v2/processor_spec.rb
spec/lib/sbmt/outbox/v2/processor_spec.rb
# frozen_string_literal: true require "sbmt/outbox/v2/processor" # rubocop:disable RSpec/IndexedLet describe Sbmt::Outbox::V2::Processor do let(:boxes) { [OutboxItem, InboxItem] } let(:processor) do described_class.new( boxes, lock_timeout: lock_timeout, cutoff_timeout: cutoff_timeout, ...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/lib/sbmt/outbox/v2/worker_spec.rb
spec/lib/sbmt/outbox/v2/worker_spec.rb
# frozen_string_literal: true require "sbmt/outbox/v2/worker" describe Sbmt::Outbox::V2::Worker do let(:boxes) { [OutboxItem] } let(:poll_tactic) { "aggressive" } let(:processor_concurrency) { 1 } let(:poller_partitions_count) { 1 } let(:poller_threads_count) { 1 } let!(:worker) do described_class.ne...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/lib/sbmt/outbox/v2/poller_spec.rb
spec/lib/sbmt/outbox/v2/poller_spec.rb
# frozen_string_literal: true require "sbmt/outbox/v2/poller" # rubocop:disable RSpec/IndexedLet describe Sbmt::Outbox::V2::Poller do let(:boxes) { [OutboxItem, InboxItem] } let(:regular_batch_size) { 2 } let(:retry_batch_size) { 1 } let(:throttler_tactic) { "noop" } let(:dummy_middleware_class) { instance_...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/lib/sbmt/outbox/v2/tasks/poll_spec.rb
spec/lib/sbmt/outbox/v2/tasks/poll_spec.rb
# frozen_string_literal: true require "sbmt/outbox/v2/tasks/poll" describe Sbmt::Outbox::V2::Tasks::Poll do let(:worker_name) { "worker" } let(:partition) { 0 } let(:buckets) { [0, 1] } it "properly formats log tags" do expect(described_class.new(item_class: InboxItem, worker_name: worker_name, partition...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/lib/sbmt/outbox/v2/tasks/base_spec.rb
spec/lib/sbmt/outbox/v2/tasks/base_spec.rb
# frozen_string_literal: true require "sbmt/outbox/v2/tasks/base" describe Sbmt::Outbox::V2::Tasks::Base do let(:worker_name) { "worker" } it "properly formats log tags" do expect(described_class.new(item_class: InboxItem, worker_name: worker_name).log_tags).to eq(box_name: "inbox_item", box_type: :inbox, wo...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/lib/sbmt/outbox/v2/tasks/process_spec.rb
spec/lib/sbmt/outbox/v2/tasks/process_spec.rb
# frozen_string_literal: true require "sbmt/outbox/v2/tasks/process" describe Sbmt::Outbox::V2::Tasks::Process do let(:worker_name) { "worker" } let(:bucket) { 0 } let(:ids) { [0, 1] } it "properly formats log tags" do expect(described_class.new(item_class: InboxItem, worker_name: worker_name, bucket: bu...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/lib/sbmt/outbox/v2/poll_throttler/rate_limited_spec.rb
spec/lib/sbmt/outbox/v2/poll_throttler/rate_limited_spec.rb
# frozen_string_literal: true require "sbmt/outbox/v2/poller" require "sbmt/outbox/v2/poll_throttler/rate_limited" describe Sbmt::Outbox::V2::PollThrottler::RateLimited do let(:limit) { 60 } let(:interval) { 60 } let(:throttler) { described_class.new(limit: limit, interval: interval) } let(:task_inbox) do ...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false
Kuper-Tech/sbmt-outbox
https://github.com/Kuper-Tech/sbmt-outbox/blob/6da9ae3ea0333ae3ad58983c035bc95bd739aaf4/spec/lib/sbmt/outbox/v2/poll_throttler/fixed_delay_spec.rb
spec/lib/sbmt/outbox/v2/poll_throttler/fixed_delay_spec.rb
# frozen_string_literal: true require "sbmt/outbox/v2/poller" require "sbmt/outbox/v2/poll_throttler/fixed_delay" describe Sbmt::Outbox::V2::PollThrottler::FixedDelay do let(:delay) { 0.1 } let(:throttler) { described_class.new(delay: delay) } let(:task) do Sbmt::Outbox::V2::Tasks::Poll.new( item_clas...
ruby
MIT
6da9ae3ea0333ae3ad58983c035bc95bd739aaf4
2026-01-04T17:51:44.997823Z
false