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
wireframe/backgrounded
https://github.com/wireframe/backgrounded/blob/a0bb67902aecd76e51d613910cf9df54286fd506/spec/spec_helper.rb
spec/spec_helper.rb
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) require 'active_record' require 'yaml' require_relative 'support/setup_database' require 'backgrounded' # This file was generated by the `rspec --init` command. Conventionally, all # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. # ...
ruby
MIT
a0bb67902aecd76e51d613910cf9df54286fd506
2026-01-04T17:50:17.165552Z
false
wireframe/backgrounded
https://github.com/wireframe/backgrounded/blob/a0bb67902aecd76e51d613910cf9df54286fd506/spec/support/setup_database.rb
spec/support/setup_database.rb
config = YAML::load(IO.read(File.join(File.dirname(__FILE__), 'database.yml'))) ActiveRecord::Base.logger = Logger.new(File.join(File.dirname(__FILE__), "debug.log")) ActiveRecord::Base.establish_connection(config[ENV['DB'] || 'sqlite']) ActiveRecord::Schema.define(:version => 1) do create_table :blogs, :force => tr...
ruby
MIT
a0bb67902aecd76e51d613910cf9df54286fd506
2026-01-04T17:50:17.165552Z
false
wireframe/backgrounded
https://github.com/wireframe/backgrounded/blob/a0bb67902aecd76e51d613910cf9df54286fd506/spec/backgrounded/object_extensions_spec.rb
spec/backgrounded/object_extensions_spec.rb
RSpec.describe Backgrounded::ObjectExtensions do class Dog def do_stuff end def self.do_something_else end end describe '.backgrounded' do it 'is defined' do expect(Dog).to respond_to(:backgrounded) end it 'returns instance of Backgrounded::Proxy' do @result = Dog.backgro...
ruby
MIT
a0bb67902aecd76e51d613910cf9df54286fd506
2026-01-04T17:50:17.165552Z
false
wireframe/backgrounded
https://github.com/wireframe/backgrounded/blob/a0bb67902aecd76e51d613910cf9df54286fd506/spec/backgrounded/proxy_spec.rb
spec/backgrounded/proxy_spec.rb
RSpec.describe Backgrounded::Proxy do class Person def self.do_something_else end def do_stuff(name, place, location) end def do_stuff_without_arguments end end context 'invoking delegate method' do context 'with arguments and options' do before do @delegate = Person.n...
ruby
MIT
a0bb67902aecd76e51d613910cf9df54286fd506
2026-01-04T17:50:17.165552Z
false
wireframe/backgrounded
https://github.com/wireframe/backgrounded/blob/a0bb67902aecd76e51d613910cf9df54286fd506/spec/backgrounded/active_record_extension_spec.rb
spec/backgrounded/active_record_extension_spec.rb
RSpec.describe Backgrounded::ActiveRecordExtension do class Blog < ActiveRecord::Base include Backgrounded::ActiveRecordExtension after_commit_backgrounded :do_something_else def do_something_else end end class User < ActiveRecord::Base include Backgrounded::ActiveRecordExtension after_com...
ruby
MIT
a0bb67902aecd76e51d613910cf9df54286fd506
2026-01-04T17:50:17.165552Z
false
wireframe/backgrounded
https://github.com/wireframe/backgrounded/blob/a0bb67902aecd76e51d613910cf9df54286fd506/lib/backgrounded.rb
lib/backgrounded.rb
require 'logger' require_relative 'backgrounded/handler/inprocess_handler' require_relative 'backgrounded/object_extensions' require_relative 'backgrounded/active_record_extension' require_relative 'backgrounded/railtie' if defined?(Rails) module Backgrounded class << self attr_accessor :logger, :handler de...
ruby
MIT
a0bb67902aecd76e51d613910cf9df54286fd506
2026-01-04T17:50:17.165552Z
false
wireframe/backgrounded
https://github.com/wireframe/backgrounded/blob/a0bb67902aecd76e51d613910cf9df54286fd506/lib/backgrounded/version.rb
lib/backgrounded/version.rb
module Backgrounded VERSION = '2.1.2' end
ruby
MIT
a0bb67902aecd76e51d613910cf9df54286fd506
2026-01-04T17:50:17.165552Z
false
wireframe/backgrounded
https://github.com/wireframe/backgrounded/blob/a0bb67902aecd76e51d613910cf9df54286fd506/lib/backgrounded/proxy.rb
lib/backgrounded/proxy.rb
module Backgrounded class Proxy attr_reader :delegate, :options def initialize(delegate, options={}) @delegate = delegate @options = options || {} end def method_missing(method_name, *args) Backgrounded.logger.debug("Requesting #{Backgrounded.handler} backgrounded method: #{method_n...
ruby
MIT
a0bb67902aecd76e51d613910cf9df54286fd506
2026-01-04T17:50:17.165552Z
false
wireframe/backgrounded
https://github.com/wireframe/backgrounded/blob/a0bb67902aecd76e51d613910cf9df54286fd506/lib/backgrounded/active_record_extension.rb
lib/backgrounded/active_record_extension.rb
require 'active_support/concern' module Backgrounded module ActiveRecordExtension extend ActiveSupport::Concern class_methods do # execute a method in the background after the object is committed to the database # @option options [Hash] :backgrounded (optional) options to pass into the backgroun...
ruby
MIT
a0bb67902aecd76e51d613910cf9df54286fd506
2026-01-04T17:50:17.165552Z
false
wireframe/backgrounded
https://github.com/wireframe/backgrounded/blob/a0bb67902aecd76e51d613910cf9df54286fd506/lib/backgrounded/railtie.rb
lib/backgrounded/railtie.rb
require_relative 'active_record_extension' module Backgrounded class Railtie < Rails::Railtie initializer 'backgrounded.configure' do ActiveSupport.on_load(:active_record) do include Backgrounded::ActiveRecordExtension end end end end
ruby
MIT
a0bb67902aecd76e51d613910cf9df54286fd506
2026-01-04T17:50:17.165552Z
false
wireframe/backgrounded
https://github.com/wireframe/backgrounded/blob/a0bb67902aecd76e51d613910cf9df54286fd506/lib/backgrounded/object_extensions.rb
lib/backgrounded/object_extensions.rb
require 'active_support/concern' require_relative 'proxy' module Backgrounded # mixin to add backgrounded proxy builder to all ruby objects module ObjectExtensions extend ActiveSupport::Concern # @param options (optional) options to pass into the backgrounded handler def backgrounded(options={}) ...
ruby
MIT
a0bb67902aecd76e51d613910cf9df54286fd506
2026-01-04T17:50:17.165552Z
false
wireframe/backgrounded
https://github.com/wireframe/backgrounded/blob/a0bb67902aecd76e51d613910cf9df54286fd506/lib/backgrounded/handler/inprocess_handler.rb
lib/backgrounded/handler/inprocess_handler.rb
module Backgrounded module Handler #simple handler to process synchronously and not actually in the background #useful for testing class InprocessHandler def request(object, method, args, options={}) object.send method, *args end end end end
ruby
MIT
a0bb67902aecd76e51d613910cf9df54286fd506
2026-01-04T17:50:17.165552Z
false
wireframe/backgrounded
https://github.com/wireframe/backgrounded/blob/a0bb67902aecd76e51d613910cf9df54286fd506/lib/backgrounded/handler/no_op_handler.rb
lib/backgrounded/handler/no_op_handler.rb
module Backgrounded module Handler # throw requests out the window # useful for test environment to avoid any background work class NoOpHandler def request(object, method, args, options={}) # do nothing end end end end
ruby
MIT
a0bb67902aecd76e51d613910cf9df54286fd506
2026-01-04T17:50:17.165552Z
false
mtgrosser/nodo
https://github.com/mtgrosser/nodo/blob/2b99a77bf12a8e3f343579d3b8e758c41f7b0c36/test/test_helper.rb
test/test_helper.rb
ENV['NODE_ENV'] = ENV['RAILS_ENV'] = 'test' require 'rubygems' require 'bundler/setup' Bundler.require(:default) require 'debug' require 'minitest/reporters' Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new require 'minitest/autorun' require 'nodo' # Enable to print debug messages # Nodo.debug = tru...
ruby
MIT
2b99a77bf12a8e3f343579d3b8e758c41f7b0c36
2026-01-04T17:50:17.196434Z
false
mtgrosser/nodo
https://github.com/mtgrosser/nodo/blob/2b99a77bf12a8e3f343579d3b8e758c41f7b0c36/test/nodo_test.rb
test/nodo_test.rb
require_relative 'test_helper' class NodoTest < Minitest::Test def test_function nodo = Class.new(Nodo::Core) do function :say_hi, "(name) => `Hello ${name}!`" end assert_equal 'Hello Nodo!', nodo.new.say_hi('Nodo') end def test_require nodo = Class.new(Nodo::Core) do require :fs ...
ruby
MIT
2b99a77bf12a8e3f343579d3b8e758c41f7b0c36
2026-01-04T17:50:17.196434Z
false
mtgrosser/nodo
https://github.com/mtgrosser/nodo/blob/2b99a77bf12a8e3f343579d3b8e758c41f7b0c36/lib/nodo.rb
lib/nodo.rb
require 'pathname' require 'json' require 'fileutils' require 'tmpdir' require 'tempfile' require 'logger' require 'socket' require 'forwardable' module Nodo class << self attr_accessor :modules_root, :env, :binary, :args, :logger, :debug, :timeout end self.modules_root = './node_modules' self.env = {} s...
ruby
MIT
2b99a77bf12a8e3f343579d3b8e758c41f7b0c36
2026-01-04T17:50:17.196434Z
false
mtgrosser/nodo
https://github.com/mtgrosser/nodo/blob/2b99a77bf12a8e3f343579d3b8e758c41f7b0c36/lib/nodo/core.rb
lib/nodo/core.rb
module Nodo class Core SOCKET_NAME = 'nodo.sock' DEFINE_METHOD = '__nodo_define_class__'.freeze EVALUATE_METHOD = '__nodo_evaluate__'.freeze GC_METHOD = '__nodo_gc__'.freeze INTERNAL_METHODS = [DEFINE_METHOD, EVALUATE_METHOD, GC_METHOD].freeze LAUNCH_TIMEOUT = 5 ARRAY_CLASS_ATTRIBUTES = %i...
ruby
MIT
2b99a77bf12a8e3f343579d3b8e758c41f7b0c36
2026-01-04T17:50:17.196434Z
false
mtgrosser/nodo
https://github.com/mtgrosser/nodo/blob/2b99a77bf12a8e3f343579d3b8e758c41f7b0c36/lib/nodo/script.rb
lib/nodo/script.rb
module Nodo class Script attr_reader :code def initialize(code = nil, &block) raise ArgumentError, 'cannot give code when block is given' if code && block @code = code || block end def to_js js = code.respond_to?(:call) ? code.call : code "#{js}\n" end end end
ruby
MIT
2b99a77bf12a8e3f343579d3b8e758c41f7b0c36
2026-01-04T17:50:17.196434Z
false
mtgrosser/nodo
https://github.com/mtgrosser/nodo/blob/2b99a77bf12a8e3f343579d3b8e758c41f7b0c36/lib/nodo/version.rb
lib/nodo/version.rb
module Nodo VERSION = '1.8.2' end
ruby
MIT
2b99a77bf12a8e3f343579d3b8e758c41f7b0c36
2026-01-04T17:50:17.196434Z
false
mtgrosser/nodo
https://github.com/mtgrosser/nodo/blob/2b99a77bf12a8e3f343579d3b8e758c41f7b0c36/lib/nodo/errors.rb
lib/nodo/errors.rb
module Nodo class Error < StandardError; end class TimeoutError < Error; end class CallError < Error; end class ClassError < Error def initialize(method = nil) super("Cannot call method `#{method}' on Nodo::Core, use subclass instead") end end class JavaScriptError < Error attr_reader :...
ruby
MIT
2b99a77bf12a8e3f343579d3b8e758c41f7b0c36
2026-01-04T17:50:17.196434Z
false
mtgrosser/nodo
https://github.com/mtgrosser/nodo/blob/2b99a77bf12a8e3f343579d3b8e758c41f7b0c36/lib/nodo/railtie.rb
lib/nodo/railtie.rb
require 'rails/railtie' require 'active_support' class Nodo::Railtie < Rails::Railtie initializer 'nodo' do |app| Nodo.env['NODE_ENV'] = Rails.env.to_s Nodo.logger = Rails.logger end end
ruby
MIT
2b99a77bf12a8e3f343579d3b8e758c41f7b0c36
2026-01-04T17:50:17.196434Z
false
mtgrosser/nodo
https://github.com/mtgrosser/nodo/blob/2b99a77bf12a8e3f343579d3b8e758c41f7b0c36/lib/nodo/constant.rb
lib/nodo/constant.rb
module Nodo class Constant attr_reader :name, :value def initialize(name, value) @name, @value = name, value end def to_js "const #{name} = __nodo_klass__.#{name} = #{value.to_json};\n" end end end
ruby
MIT
2b99a77bf12a8e3f343579d3b8e758c41f7b0c36
2026-01-04T17:50:17.196434Z
false
mtgrosser/nodo
https://github.com/mtgrosser/nodo/blob/2b99a77bf12a8e3f343579d3b8e758c41f7b0c36/lib/nodo/function.rb
lib/nodo/function.rb
module Nodo class Function attr_reader :name, :code, :source_location, :timeout def initialize(name, code, source_location, timeout, &block) raise ArgumentError, 'cannot give code when block is given' if code && block code = code.strip if code raise ArgumentError, 'function code is requir...
ruby
MIT
2b99a77bf12a8e3f343579d3b8e758c41f7b0c36
2026-01-04T17:50:17.196434Z
false
mtgrosser/nodo
https://github.com/mtgrosser/nodo/blob/2b99a77bf12a8e3f343579d3b8e758c41f7b0c36/lib/nodo/client.rb
lib/nodo/client.rb
require 'net/http' module Nodo class Client < Net::HTTP UNIX_REGEXP = /\Aunix:\/\//i def initialize(address, port = nil) super(address, port) case address when UNIX_REGEXP @socket_type = 'unix' @socket_path = address.sub(UNIX_REGEXP, '') # Host header is required fo...
ruby
MIT
2b99a77bf12a8e3f343579d3b8e758c41f7b0c36
2026-01-04T17:50:17.196434Z
false
mtgrosser/nodo
https://github.com/mtgrosser/nodo/blob/2b99a77bf12a8e3f343579d3b8e758c41f7b0c36/lib/nodo/dependency.rb
lib/nodo/dependency.rb
module Nodo class Dependency attr_reader :name, :package, :type def initialize(name, package, type:) @name, @package, @type = name, package, type end def to_js case type when :cjs then to_cjs when :esm then to_esm else raise "Unknown dependency type: #{type}" end ...
ruby
MIT
2b99a77bf12a8e3f343579d3b8e758c41f7b0c36
2026-01-04T17:50:17.196434Z
false
discourse/discourse-oauth2-basic
https://github.com/discourse/discourse-oauth2-basic/blob/f0261c88bc5a26aa142ec4b0af9ce3a21cfb3dc8/plugin.rb
plugin.rb
# frozen_string_literal: true # name: discourse-oauth2-basic # about: Allows users to login to your forum using a basic OAuth2 provider. # meta_topic_id: 33879 # version: 0.3 # authors: Robin Ward # url: https://github.com/discourse/discourse-oauth2-basic enabled_site_setting :oauth2_enabled require_relative "lib/om...
ruby
MIT
f0261c88bc5a26aa142ec4b0af9ce3a21cfb3dc8
2026-01-04T17:50:22.408324Z
false
discourse/discourse-oauth2-basic
https://github.com/discourse/discourse-oauth2-basic/blob/f0261c88bc5a26aa142ec4b0af9ce3a21cfb3dc8/db/migrate/20190724055909_move_to_managed_authenticator.rb
db/migrate/20190724055909_move_to_managed_authenticator.rb
# frozen_string_literal: true class MoveToManagedAuthenticator < ActiveRecord::Migration[5.2] def up execute <<~SQL INSERT INTO user_associated_accounts ( provider_name, provider_uid, user_id, created_at, updated_at ) SELECT 'oauth2_basic', replace(key, 'oauth2_b...
ruby
MIT
f0261c88bc5a26aa142ec4b0af9ce3a21cfb3dc8
2026-01-04T17:50:22.408324Z
false
discourse/discourse-oauth2-basic
https://github.com/discourse/discourse-oauth2-basic/blob/f0261c88bc5a26aa142ec4b0af9ce3a21cfb3dc8/spec/plugin_spec.rb
spec/plugin_spec.rb
# frozen_string_literal: true require "rails_helper" describe OAuth2BasicAuthenticator do describe "after_authenticate" do before { SiteSetting.oauth2_user_json_url = "https://provider.com/user" } let(:user) { Fabricate(:user) } let(:authenticator) { OAuth2BasicAuthenticator.new } let(:auth) do ...
ruby
MIT
f0261c88bc5a26aa142ec4b0af9ce3a21cfb3dc8
2026-01-04T17:50:22.408324Z
false
discourse/discourse-oauth2-basic
https://github.com/discourse/discourse-oauth2-basic/blob/f0261c88bc5a26aa142ec4b0af9ce3a21cfb3dc8/spec/system/core_features_spec.rb
spec/system/core_features_spec.rb
# frozen_string_literal: true RSpec.describe "Core features", type: :system do before { enable_current_plugin } it_behaves_like "having working core features" end
ruby
MIT
f0261c88bc5a26aa142ec4b0af9ce3a21cfb3dc8
2026-01-04T17:50:22.408324Z
false
discourse/discourse-oauth2-basic
https://github.com/discourse/discourse-oauth2-basic/blob/f0261c88bc5a26aa142ec4b0af9ce3a21cfb3dc8/spec/integration/overrides_email_spec.rb
spec/integration/overrides_email_spec.rb
# frozen_string_literal: true require "rails_helper" describe "OAuth2 Overrides Email", type: :request do fab!(:initial_email) { "initial@example.com" } fab!(:new_email) { "new@example.com" } fab!(:user) { Fabricate(:user, email: initial_email) } fab!(:uac) do UserAssociatedAccount.create!(user: user, pro...
ruby
MIT
f0261c88bc5a26aa142ec4b0af9ce3a21cfb3dc8
2026-01-04T17:50:22.408324Z
false
discourse/discourse-oauth2-basic
https://github.com/discourse/discourse-oauth2-basic/blob/f0261c88bc5a26aa142ec4b0af9ce3a21cfb3dc8/lib/oauth2_faraday_formatter.rb
lib/oauth2_faraday_formatter.rb
# frozen_string_literal: true require "faraday/logging/formatter" class OAuth2FaradayFormatter < Faraday::Logging::Formatter def request(env) warn <<~LOG OAuth2 Debugging: request #{env.method.upcase} #{env.url} Headers: #{env.request_headers.to_yaml} Body: #{env[:body].to_yaml} ...
ruby
MIT
f0261c88bc5a26aa142ec4b0af9ce3a21cfb3dc8
2026-01-04T17:50:22.408324Z
false
discourse/discourse-oauth2-basic
https://github.com/discourse/discourse-oauth2-basic/blob/f0261c88bc5a26aa142ec4b0af9ce3a21cfb3dc8/lib/oauth2_basic_authenticator.rb
lib/oauth2_basic_authenticator.rb
# frozen_string_literal: true class OAuth2BasicAuthenticator < Auth::ManagedAuthenticator def name "oauth2_basic" end def can_revoke? SiteSetting.oauth2_allow_association_change end def can_connect_existing_user? SiteSetting.oauth2_allow_association_change end def register_middleware(omnia...
ruby
MIT
f0261c88bc5a26aa142ec4b0af9ce3a21cfb3dc8
2026-01-04T17:50:22.408324Z
false
discourse/discourse-oauth2-basic
https://github.com/discourse/discourse-oauth2-basic/blob/f0261c88bc5a26aa142ec4b0af9ce3a21cfb3dc8/lib/validators/oauth2_basic/oauth2_fetch_user_details_validator.rb
lib/validators/oauth2_basic/oauth2_fetch_user_details_validator.rb
# frozen_string_literal: true class Oauth2FetchUserDetailsValidator def initialize(opts = {}) @opts = opts end def valid_value?(val) return true if val == "t" SiteSetting.oauth2_callback_user_id_path.length > 0 end def error_message I18n.t("site_settings.errors.oauth2_fetch_user_details") ...
ruby
MIT
f0261c88bc5a26aa142ec4b0af9ce3a21cfb3dc8
2026-01-04T17:50:22.408324Z
false
discourse/discourse-oauth2-basic
https://github.com/discourse/discourse-oauth2-basic/blob/f0261c88bc5a26aa142ec4b0af9ce3a21cfb3dc8/lib/omniauth/strategies/oauth2_basic.rb
lib/omniauth/strategies/oauth2_basic.rb
# frozen_string_literal: true class OmniAuth::Strategies::Oauth2Basic < ::OmniAuth::Strategies::OAuth2 option :name, "oauth2_basic" uid do if path = SiteSetting.oauth2_callback_user_id_path.split(".") recurse(access_token, [*path]) if path.present? end end info do if paths = SiteSetting.oau...
ruby
MIT
f0261c88bc5a26aa142ec4b0af9ce3a21cfb3dc8
2026-01-04T17:50:22.408324Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/test/round_robin_test.rb
test/round_robin_test.rb
# -*- coding: utf-8 -*- # frozen_string_literal: true require_relative 'test_helper' module Dynflow module RoundRobinTest describe RoundRobin do let(:rr) { Dynflow::RoundRobin.new } specify do assert_nil rr.next assert_nil rr.next _(rr).must_be_empty rr.add 1 ...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/test/daemon_test.rb
test/daemon_test.rb
# frozen_string_literal: true require 'test_helper' require 'active_support' require 'mocha/minitest' require 'logging' require 'dynflow/testing' require 'ostruct' require_relative '../lib/dynflow/rails' class StdIOWrapper def initialize(logger, error = false) @logger = logger @error = error end def pu...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/test/v2_sub_plans_test.rb
test/v2_sub_plans_test.rb
# frozen_string_literal: true require_relative 'test_helper' require 'mocha/minitest' module Dynflow module V2SubPlansTest describe 'V2 sub-plans' do include PlanAssertions include Dynflow::Testing::Assertions include Dynflow::Testing::Factories include TestHelpers let(:world) { W...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/test/concurrency_control_test.rb
test/concurrency_control_test.rb
# frozen_string_literal: true require_relative 'test_helper' module Dynflow module ConcurrencyControlTest describe 'Concurrency Control' do include PlanAssertions include Dynflow::Testing::Assertions include Dynflow::Testing::Factories include TestHelpers class FailureSimulator ...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/test/middleware_test.rb
test/middleware_test.rb
# frozen_string_literal: true require_relative 'test_helper' module Dynflow module MiddlewareTest describe 'Middleware' do let(:world) { WorldFactory.create_world } let(:log) { Support::MiddlewareExample::LogMiddleware.log } before do Support::MiddlewareExample::LogMiddleware.reset_lo...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/test/redis_locking_test.rb
test/redis_locking_test.rb
# frozen_string_literal: true require_relative 'test_helper' require 'mocha/minitest' require 'minitest/stub_const' require 'ostruct' require 'sidekiq' require 'dynflow/executors/sidekiq/core' module Dynflow module RedisLockingTest describe Executors::Sidekiq::RedisLocking do class Orchestrator in...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/test/rescue_test.rb
test/rescue_test.rb
# frozen_string_literal: true require_relative 'test_helper' module Dynflow module RescueTest describe 'on error' do Example = Support::RescueExample let(:world) { WorldFactory.create_world } def execute(*args) plan = world.plan(*args) raise plan.errors.first if plan.error? ...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/test/activejob_adapter_test.rb
test/activejob_adapter_test.rb
# frozen_string_literal: true require_relative 'test_helper' require 'active_job' require 'dynflow/active_job/queue_adapter' module Dynflow class SampleJob < ::ActiveJob::Base queue_as :slow def perform(msg) puts "This job says #{msg}" puts "provider_job_id is #{provider_job_id}" end end ...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/test/memory_cosumption_watcher_test.rb
test/memory_cosumption_watcher_test.rb
# frozen_string_literal: true require_relative 'test_helper' require 'fileutils' require 'dynflow/watchers/memory_consumption_watcher' module Dynflow module MemoryConsumptionWatcherTest describe ::Dynflow::Watchers::MemoryConsumptionWatcher do let(:world) { Minitest::Mock.new('world') } describe 'in...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/test/dead_letter_silencer_test.rb
test/dead_letter_silencer_test.rb
# frozen_string_literal: true require_relative 'test_helper' require 'ostruct' module Dynflow module DeadLetterSilencerTest describe ::Dynflow::DeadLetterSilencer do include Dynflow::Testing::Factories include TestHelpers let(:world) { WorldFactory.create_world } it 'is started for eac...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/test/execution_plan_cleaner_test.rb
test/execution_plan_cleaner_test.rb
# frozen_string_literal: true require_relative 'test_helper' require 'mocha/minitest' module Dynflow module ExecutionPlanCleanerTest describe ::Dynflow::Actors::ExecutionPlanCleaner do include Dynflow::Testing::Assertions include Dynflow::Testing::Factories include TestHelpers class Sim...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/test/web_console_test.rb
test/web_console_test.rb
# frozen_string_literal: true require_relative 'test_helper' ENV['RACK_ENV'] = 'test' require 'dynflow/web' require 'rack/test' module Dynflow describe 'web console' do include Rack::Test::Methods let(:world) { WorldFactory.create_world } let :execution_plan_id do world.trigger(Support::CodeWor...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/test/coordinator_test.rb
test/coordinator_test.rb
# frozen_string_literal: true require_relative 'test_helper' require 'fileutils' module Dynflow module CoordinatorTest describe Coordinator do let(:world) { WorldFactory.create_world } let(:another_world) { WorldFactory.create_world } describe 'locks' do it 'unlocks the lock, ...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/test/clock_test.rb
test/clock_test.rb
# frozen_string_literal: true require_relative 'test_helper' require 'logger' clock_class = Dynflow::Clock describe clock_class do let(:clock) { clock_class.spawn 'clock' } it 'refuses who without #<< method' do _(-> { clock.ping Object.new, 0.1, :pong }).must_raise TypeError clock.ping [], 0.1, :pong ...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/test/utils_test.rb
test/utils_test.rb
# frozen_string_literal: true require_relative 'test_helper' module Dynflow module UtilsTest describe ::Dynflow::Utils::PriorityQueue do let(:queue) { Utils::PriorityQueue.new } it 'can insert elements' do queue.push 1 _(queue.top).must_equal 1 queue.push 2 _(queue.t...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/test/extensions_test.rb
test/extensions_test.rb
# frozen_string_literal: true require_relative 'test_helper' require 'active_support/all' module Dynflow module ExtensionsTest describe 'msgpack extensions' do before do Time.zone = ActiveSupport::TimeZone['Europe/Prague'] end after { Time.zone = nil } it 'allows {de,}serializin...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/test/test_helper.rb
test/test_helper.rb
# frozen_string_literal: true require 'bundler/setup' require 'minitest/reporters' require 'minitest/autorun' require 'minitest/spec' ENV['MT_NO_PLUGINS'] = 'true' MiniTest::Reporters.use! if ENV['RM_INFO'] load_path = File.expand_path(File.dirname(__FILE__)) $LOAD_PATH << load_path unless $LOAD_PATH.include? load_p...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/test/world_test.rb
test/world_test.rb
# frozen_string_literal: true require_relative 'test_helper' require 'fileutils' module Dynflow module WorldTest describe World do let(:world) { WorldFactory.create_world } let(:world_with_custom_meta) { WorldFactory.create_world { |c| c.meta = { 'fast' => true } } } describe '#meta' do ...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/test/dispatcher_test.rb
test/dispatcher_test.rb
# frozen_string_literal: true require_relative 'test_helper' module Dynflow module DispatcherTest describe "dispatcher" do include TestHelpers let(:persistence_adapter) { WorldFactory.persistence_adapter } def self.dispatcher_works_with_this_connector describe 'connector basics' do ...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/test/execution_plan_hooks_test.rb
test/execution_plan_hooks_test.rb
# frozen_string_literal: true require_relative 'test_helper' module Dynflow class ExecutionPlan describe Hooks do include PlanAssertions let(:world) { WorldFactory.create_world } class Flag class << self attr_accessor :raised_count def raise! self.rai...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/test/persistence_test.rb
test/persistence_test.rb
# frozen_string_literal: true require_relative 'test_helper' require 'tmpdir' require 'ostruct' module Dynflow module PersistenceTest describe 'persistence adapters' do let :execution_plans_data do [{ id: 'plan1', :label => 'test1', root_plan_step_id: 1, class: 'Dynflow::ExecutionPlan', state: 'pa...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/test/testing_test.rb
test/testing_test.rb
# frozen_string_literal: true require_relative 'test_helper' module Dynflow CWE = Support::CodeWorkflowExample describe Testing do include Testing describe 'testing' do specify '#plan_action' do input = { 'input' => 'input' } action = create_and_plan_action Support::DummyExample::...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/test/abnormal_states_recovery_test.rb
test/abnormal_states_recovery_test.rb
# -*- coding: utf-8 -*- # frozen_string_literal: true require_relative 'test_helper' require 'ostruct' module Dynflow module ConsistencyCheckTest describe "consistency check" do include TestHelpers def with_invalidation_while_executing(finish) triggered = while_executing_plan do |executor| ...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/test/semaphores_test.rb
test/semaphores_test.rb
# frozen_string_literal: true require_relative 'test_helper' module Dynflow module SemaphoresTest describe ::Dynflow::Semaphores::Stateful do let(:semaphore_class) { ::Dynflow::Semaphores::Stateful } let(:tickets_count) { 5 } it 'can be used as counter' do expected_state = { :tickets ...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/test/batch_sub_tasks_test.rb
test/batch_sub_tasks_test.rb
# frozen_string_literal: true require_relative 'test_helper' module Dynflow module BatchSubTaskTest describe 'Batch sub-tasks' do include PlanAssertions include Dynflow::Testing::Assertions include Dynflow::Testing::Factories include TestHelpers class FailureSimulator def ...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/test/executor_test.rb
test/executor_test.rb
# -*- coding: utf-8 -*- # frozen_string_literal: true require_relative 'test_helper' require 'mocha/minitest' require 'sidekiq' require 'sidekiq/api' require 'sidekiq/testing' ::Sidekiq::Testing::inline! require 'dynflow/executors/sidekiq/core' module RedisMocks def release_orchestrator_lock; end def wait_for_o...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/test/execution_plan_test.rb
test/execution_plan_test.rb
# frozen_string_literal: true require_relative 'test_helper' module Dynflow module ExecutionPlanTest describe ExecutionPlan do include PlanAssertions let(:world) { WorldFactory.create_world } let :issues_data do [{ 'author' => 'Peter Smith', 'text' => 'Failing test' }, { 'au...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/test/action_test.rb
test/action_test.rb
# frozen_string_literal: true require_relative 'test_helper' require 'mocha/minitest' module Dynflow describe 'action' do let(:world) { WorldFactory.create_world } describe Action::Missing do let :action_data do { class: 'RenamedAction', id: 1, i...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/test/flows_test.rb
test/flows_test.rb
# frozen_string_literal: true require_relative 'test_helper' require 'mocha/minitest' module Dynflow describe 'flow' do class TestRegistry < Flows::Registry class << self def reset! @serialization_map = {} end end end after do TestRegistry.reset! end ...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/test/future_execution_test.rb
test/future_execution_test.rb
# frozen_string_literal: true require_relative 'test_helper' require 'multi_json' module Dynflow module FutureExecutionTest describe 'Future Execution' do include PlanAssertions include Dynflow::Testing::Assertions include Dynflow::Testing::Factories describe 'action scheduling' do ...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/test/support/test_execution_log.rb
test/support/test_execution_log.rb
# frozen_string_literal: true class TestExecutionLog include Enumerable def initialize @log = [] end def <<(action) @log << [action.class, action.input] end def log @log end def each(&block) @log.each(&block) end def size @log.size end def self.setup @run, @finaliz...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/test/support/rescue_example.rb
test/support/rescue_example.rb
# frozen_string_literal: true require 'logger' module Support module RescueExample class ComplexActionWithSkip < Dynflow::Action def plan(error_state) sequence do concurrence do plan_action(ActionWithSkip, 3, :success) plan_action(ActionWithSkip, 4, error_state) ...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/test/support/middleware_example.rb
test/support/middleware_example.rb
# frozen_string_literal: true module Support module MiddlewareExample class LogMiddleware < Dynflow::Middleware def self.log @log end def self.reset_log @log = [] end def log(message) LogMiddleware.log << "#{self.class.name[/\w+$/]}::#{message}" end ...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/test/support/dummy_example.rb
test/support/dummy_example.rb
# frozen_string_literal: true require 'logger' module Support module DummyExample class Dummy < Dynflow::Action def run; end end class SkippableDummy < Dummy def rescue_strategy_for_self Dynflow::Action::Rescue::Skip end end class MySerializer < Dynflow::Serializers::...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/test/support/code_workflow_example.rb
test/support/code_workflow_example.rb
# frozen_string_literal: true require 'logger' module Support module CodeWorkflowExample class IncomingIssues < Dynflow::Action def plan(issues) issues.each do |issue| plan_action(IncomingIssue, issue) end plan_self('issues' => issues) end input_format do ...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/test/support/rails/config/environment.rb
test/support/rails/config/environment.rb
# frozen_string_literal: true # This is a mock
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/examples/memory_limit_watcher.rb
examples/memory_limit_watcher.rb
#!/usr/bin/env ruby # frozen_string_literal: true require_relative 'example_helper' example_description = <<~DESC Memory limit watcher Example =========================== In this example we are setting a watcher that will terminate our world object when process memory consumption exceeds a limit that w...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/examples/sub_plans_v2.rb
examples/sub_plans_v2.rb
#!/usr/bin/env ruby # frozen_string_literal: true example_description = <<DESC Sub Plans Example =================== This example shows, how to trigger the execution plans from within a run method of some action and waing for them to finish. This is useful, when doing bulk actions, where having one big e...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/examples/halt.rb
examples/halt.rb
#!/usr/bin/env ruby # frozen_string_literal: true require_relative 'example_helper' example_description = <<DESC Halting example =================== This example shows, how halting works in Dynflow. It spawns a single action, which in turn spawns a few evented actions and a single action which occupies th...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/examples/future_execution.rb
examples/future_execution.rb
#!/usr/bin/env ruby # frozen_string_literal: true require_relative 'example_helper' class CustomPassedObject attr_reader :id, :name def initialize(id, name) @id = id @name = name end end class CustomPassedObjectSerializer < ::Dynflow::Serializers::Abstract def serialize(arg) # Serialized output ...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/examples/clock_benchmark.rb
examples/clock_benchmark.rb
# frozen_string_literal: true require 'dynflow' require 'benchmark' class Receiver def initialize(limit, future) @limit = limit @future = future @counter = 0 end def null @counter += 1 @future.fulfill(true) if @counter >= @limit end end def test_case(count) future = Concurrent::Promi...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/examples/orchestrate_evented.rb
examples/orchestrate_evented.rb
#!/usr/bin/env ruby # frozen_string_literal: true require_relative 'example_helper' example_description = <<DESC Orchestrate Evented Example =========================== This example, how the `examples/orchestrate.rb` can be updated to not block the threads while waiting for external tasks. In this cases, we ...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/examples/execution_plan_chaining.rb
examples/execution_plan_chaining.rb
#!/usr/bin/env ruby # frozen_string_literal: true require_relative 'example_helper' class DelayedAction < Dynflow::Action def plan(should_fail = false) plan_self :should_fail => should_fail end def run sleep 5 raise "Controlled failure" if input[:should_fail] end def rescue_strategy Dynflo...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/examples/orchestrate.rb
examples/orchestrate.rb
#!/usr/bin/env ruby # frozen_string_literal: true example_description = <<DESC Orchestrate Example =================== This example simulates a workflow of setting up an infrastructure, using more high-level steps in CreateInfrastructure, that expand to smaller steps of PrepareDisk, CraeteVM etc. It show...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/examples/remote_executor.rb
examples/remote_executor.rb
#!/usr/bin/env ruby # -*- coding: utf-8 -*- # frozen_string_literal: true # To run the observer: # # bundle exec ruby ./examples/remote_executor.rb observer # # To run the server: # # bundle exec ruby ./examples/remote_executor.rb server # # To run the client: # # bundle exec ruby ./examples/remote_exec...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/examples/chunked_output_benchmark.rb
examples/chunked_output_benchmark.rb
#!/usr/bin/env ruby # frozen_string_literal: true require_relative 'example_helper' require 'benchmark' WORDS = File.readlines('/usr/share/dict/words').map(&:chomp).freeze COUNT = WORDS.count module Common def main_loop if output[:current] < input[:limit] consumed = yield output[:current] += consum...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/examples/sub_plans.rb
examples/sub_plans.rb
#!/usr/bin/env ruby # frozen_string_literal: true example_description = <<DESC Sub Plans Example =================== This example shows, how to trigger the execution plans from within a run method of some action and waing for them to finish. This is useful, when doing bulk actions, where having one big e...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/examples/sub_plan_concurrency_control.rb
examples/sub_plan_concurrency_control.rb
#!/usr/bin/env ruby # frozen_string_literal: true example_description = <<DESC Sub-plan Concurrency Control Example ==================================== This example shows, how an action with sub-plans can be used to control concurrency level and tasks distribution over time. This is useful, when doing res...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/examples/termination.rb
examples/termination.rb
#!/usr/bin/env ruby # frozen_string_literal: true require_relative 'example_helper' class Sleeper < Dynflow::Action def run(event = nil) sleep end end def report(msg) puts "===== #{Time.now}: #{msg}" end if $0 == __FILE__ ExampleHelper.world.action_logger.level = 1 ExampleHelper.world.logger.level = 0...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/examples/singletons.rb
examples/singletons.rb
#!/usr/bin/env ruby # frozen_string_literal: true example_description = <<DESC Sub Plans Example =================== This example shows, how singleton actions can be used for making sure there is only one instance of the action running at a time. Singleton actions try to obtain a lock at the beggining of ...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/examples/example_helper.rb
examples/example_helper.rb
# frozen_string_literal: true $:.unshift(File.expand_path('../../lib', __FILE__)) require 'dynflow' class ExampleHelper CONSOLE_URL = 'http://localhost:4567' DYNFLOW_URL = "#{CONSOLE_URL}/dynflow" SIDEKIQ_URL = "#{CONSOLE_URL}/sidekiq" class << self def world @world ||= create_world end d...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/lib/dynflow.rb
lib/dynflow.rb
# frozen_string_literal: true require 'algebrick' require 'set' require 'base64' require 'concurrent' require 'concurrent-edge' logger = Logger.new($stderr) logger.level = Logger::INFO Concurrent.global_logger = lambda do |level, progname, message = nil, &block| logger.ad...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/lib/dynflow/clock.rb
lib/dynflow/clock.rb
# frozen_string_literal: true module Dynflow class Clock < Actor include Algebrick::Types Timer = Algebrick.type do fields! who: Object, # to ping back when: Time, # to deliver what: Maybe[Object], # to send where: Symbol # it should be delivered, which me...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/lib/dynflow/persistence.rb
lib/dynflow/persistence.rb
# frozen_string_literal: true require 'dynflow/persistence_adapters' module Dynflow class Persistence include Algebrick::TypeCheck attr_reader :adapter def initialize(world, persistence_adapter, options = {}) @world = world @adapter = persistence_adapter @adapter.register_world(wor...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/lib/dynflow/coordinator_adapters.rb
lib/dynflow/coordinator_adapters.rb
# frozen_string_literal: true module Dynflow module CoordinatorAdapters require 'dynflow/coordinator_adapters/abstract' require 'dynflow/coordinator_adapters/sequel' end end
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/lib/dynflow/serializable.rb
lib/dynflow/serializable.rb
# frozen_string_literal: true require 'date' module Dynflow class Serializable TIME_FORMAT = '%Y-%m-%d %H:%M:%S.%L' LEGACY_TIME_FORMAT = '%Y-%m-%d %H:%M:%S' def self.from_hash(hash, *args) check_class_key_present hash constantize(hash[:class]).new_from_hash(hash, *args) end def to_h...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/lib/dynflow/director.rb
lib/dynflow/director.rb
# frozen_string_literal: true module Dynflow # Director is responsible for telling what to do next when: # * new execution starts # * an event accurs # * some work is finished # # It's public methods (except terminate) return work items that the # executor should understand class Director inc...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/lib/dynflow/version.rb
lib/dynflow/version.rb
# frozen_string_literal: true module Dynflow VERSION = '2.0.0' end
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/lib/dynflow/rails.rb
lib/dynflow/rails.rb
# -*- coding: utf-8 -*- # frozen_string_literal: true module Dynflow # Class for configuring and preparing the Dynflow runtime environment. class Rails require File.expand_path('../rails/configuration', __FILE__) require File.expand_path('../rails/daemon', __FILE__) attr_reader :config def initia...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/lib/dynflow/extensions.rb
lib/dynflow/extensions.rb
# frozen_string_literal: true module Dynflow module Extensions require 'dynflow/extensions/msgpack' end end
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/lib/dynflow/throttle_limiter.rb
lib/dynflow/throttle_limiter.rb
# frozen_string_literal: true module Dynflow class ThrottleLimiter attr_reader :core def initialize(world) @world = world spawn end def initialize_plan(plan_id, semaphores_hash) core.tell([:initialize_plan, plan_id, semaphores_hash]) end def finish(plan_id) core.tel...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/lib/dynflow/errors.rb
lib/dynflow/errors.rb
# frozen_string_literal: true module Dynflow module Errors class RescueError < StandardError; end # placeholder in case the deserialized error is no longer available class UnknownError < StandardError def self.for_exception_class(class_name) Class.new(self) do define_singleton_me...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/lib/dynflow/middleware.rb
lib/dynflow/middleware.rb
# frozen_string_literal: true module Dynflow class Middleware require 'dynflow/middleware/register' require 'dynflow/middleware/world' require 'dynflow/middleware/resolver' require 'dynflow/middleware/stack' require 'dynflow/middleware/common/transaction' require 'dynflow/middleware/common/si...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/lib/dynflow/coordinator.rb
lib/dynflow/coordinator.rb
# frozen_string_literal: true require 'dynflow/coordinator_adapters' module Dynflow class Coordinator include Algebrick::TypeCheck class DuplicateRecordError < Dynflow::Error attr_reader :record def initialize(record) @record = record super("record #{record} already exists") ...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/lib/dynflow/delayed_plan.rb
lib/dynflow/delayed_plan.rb
# frozen_string_literal: true module Dynflow class DelayedPlan < Serializable include Algebrick::TypeCheck attr_reader :execution_plan_uuid, :start_before attr_accessor :frozen, :start_at def initialize(world, execution_plan_uuid, start_at, start_before, args_serializer, frozen) @world ...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false
Dynflow/dynflow
https://github.com/Dynflow/dynflow/blob/e14dcdfe57cec99cc78b2f6ab521f00809b1408a/lib/dynflow/flows.rb
lib/dynflow/flows.rb
# frozen_string_literal: true require 'forwardable' module Dynflow module Flows require 'dynflow/flows/registry' require 'dynflow/flows/abstract' require 'dynflow/flows/atom' require 'dynflow/flows/abstract_composed' require 'dynflow/flows/concurrence' require 'dynflow/flows/sequence' end ...
ruby
MIT
e14dcdfe57cec99cc78b2f6ab521f00809b1408a
2026-01-04T17:50:16.326730Z
false