source
stringclasses
1 value
repo
stringlengths
5
63
repo_url
stringlengths
24
82
path
stringlengths
5
167
language
stringclasses
1 value
license
stringclasses
5 values
stars
int64
10
51.4k
ref
stringclasses
23 values
size_bytes
int64
200
258k
text
stringlengths
137
258k
github
sublayerapp/sublayer
https://github.com/sublayerapp/sublayer
lib/sublayer/cli/commands/generators/sublayer_command_generator.rb
Ruby
mit
204
main
1,837
class SublayerCommandGenerator < Sublayer::Generators::Base llm_output_adapter type: :named_strings, name: "sublayer_command", description: "The new command code based on the generator", attributes: [ { name: "class_name", description: "The class name of the command" }, { name: "de...
github
sublayerapp/sublayer
https://github.com/sublayerapp/sublayer
lib/sublayer/cli/commands/generators/example_action_file_manipulation.rb
Ruby
mit
204
main
266
class WriteFileAction < Sublayer::Actions::Base def initialize(file_contents:, file_path:) @file_contents = file_contents @file_path = file_path end def call File.open(@file_path, 'wb') do |file| file.write(@file_contents) end end end
github
sublayerapp/sublayer
https://github.com/sublayerapp/sublayer
lib/sublayer/logging/debug_logger.rb
Ruby
mit
204
main
231
module Sublayer module Logging class DebugLogger < Base def log(level, message, data = {}) puts "[#{Time.now.iso8601}] #{level.upcase}: #{message}" pp data unless data.empty? end end end end
github
sublayerapp/sublayer
https://github.com/sublayerapp/sublayer
lib/sublayer/logging/json_logger.rb
Ruby
mit
204
main
443
module Sublayer module Logging class JsonLogger < Base def initialize(log_file = "./tmp/sublayer.log") @log_file = log_file end def log(level, message, data = {}) File.open(@log_file, "a") do |f| f.puts JSON.generate({ timestamp: Time.now.iso8601, ...
github
sublayerapp/sublayer
https://github.com/sublayerapp/sublayer
lib/sublayer/generators/base.rb
Ruby
mit
204
main
768
module Sublayer module Generators class Base attr_reader :results def self.llm_output_adapter(options) output_adapter = Sublayer::Components::OutputAdapters.create(options).extend(Sublayer::Components::OutputAdapters::Formattable) const_set(:OUTPUT_ADAPTER, output_adapter) end ...
github
palkan/active_event_store
https://github.com/palkan/active_event_store
Rakefile
Ruby
mit
204
master
534
# frozen_string_literal: true require "rake/testtask" require "rspec/core/rake_task" RSpec::Core::RakeTask.new(:spec) begin require "rubocop/rake_task" RuboCop::RakeTask.new RuboCop::RakeTask.new("rubocop:md") do |task| task.options << %w[-c .rubocop-md.yml] end rescue LoadError task(:rubocop) {} ta...
github
palkan/active_event_store
https://github.com/palkan/active_event_store
Gemfile
Ruby
mit
204
master
353
# frozen_string_literal: true source 'https://rubygems.org' gem "debug", platform: :mri gemspec eval_gemfile "gemfiles/rubocop.gemfile" local_gemfile = "#{File.dirname(__FILE__)}/Gemfile.local" gem 'sqlite3', '~> 1.4' if File.exist?(local_gemfile) eval(File.read(local_gemfile)) # rubocop:disable Security/Eval ...
github
palkan/active_event_store
https://github.com/palkan/active_event_store
active_event_store.gemspec
Ruby
mit
204
master
1,392
# frozen_string_literal: true require_relative "lib/active_event_store/version" Gem::Specification.new do |s| s.name = "active_event_store" s.version = ActiveEventStore::VERSION s.authors = ["Vladimir Dementyev"] s.email = ["dementiev.vm@gmail.com"] s.homepage = "http://github.com/palkan/active_event_store"...
github
palkan/active_event_store
https://github.com/palkan/active_event_store
spec/rails_helper.rb
Ruby
mit
204
master
688
# frozen_string_literal: true begin require "debug" unless ENV["CI"] rescue LoadError end ENV["RAILS_ENV"] = "test" # https://github.com/rails/rails/issues/54263 require "logger" require_relative "support/application" require "rspec/rails" require "active_event_store" Dir["#{File.dirname(__FILE__)}/support/**/*...
github
palkan/active_event_store
https://github.com/palkan/active_event_store
spec/common_events_spec.rb
Ruby
mit
204
master
278
# frozen_string_literal: true require "rails_helper" describe ActiveEventStore do specify ".event_store" do expect(described_class.event_store).not_to be_nil end specify ".mapping" do expect(described_class.mapping).to be_a(ActiveEventStore::Mapping) end end
github
palkan/active_event_store
https://github.com/palkan/active_event_store
spec/event_spec.rb
Ruby
mit
204
master
2,682
# frozen_string_literal: true require "rails_helper" describe ActiveEventStore::Event do let(:event_class) { ActiveEventStore::TestEvent } let(:event) { event_class.new(user_id: 1, action_type: "test") } specify do expect(event.user_id).to eq 1 expect(event.action_type).to eq "test" expect(event.m...
github
palkan/active_event_store
https://github.com/palkan/active_event_store
spec/mapper_spec.rb
Ruby
mit
204
master
1,730
# frozen_string_literal: true require "rails_helper" describe ActiveEventStore::Mapper do let(:event_class) { ActiveEventStore::TestEvent } let(:event) { event_class.new(user_id: 1, action_type: "test", metadata: {timestamp: 321}) } let(:mapping) { ActiveEventStore::Mapping.new } subject { described_class.n...
github
palkan/active_event_store
https://github.com/palkan/active_event_store
spec/cases/async_subscriptions_spec.rb
Ruby
mit
204
master
3,201
# frozen_string_literal: true require "rails_helper" describe "async #subscribe" do let(:event_class) { ActiveEventStore::TestEvent } let(:callable) do ActiveEventStore::TestSubscriber = Module.new do class << self def events @events ||= [] end def cal...
github
palkan/active_event_store
https://github.com/palkan/active_event_store
spec/cases/rspec_matchers_spec.rb
Ruby
mit
204
master
4,119
# frozen_string_literal: true require "rails_helper" describe "RSpec matchers" do let(:event_class) { ActiveEventStore::TestEvent } let(:event) { event_class.new(user_id: 25, action_type: "birth") } let(:event2) { event_class.new(user_id: 1, action_type: "death") } describe "#have_published_event" do con...
github
palkan/active_event_store
https://github.com/palkan/active_event_store
spec/cases/code_reloading_spec.rb
Ruby
mit
204
master
1,097
# frozen_string_literal: true require "rails_helper" describe "Rails #to_prepare" do let!(:event_class) { ActiveEventStore::TestEvent } let!(:callable) do ActiveEventStore::TestSubscriber = Module.new do class << self def events @events ||= [] end def ...
github
palkan/active_event_store
https://github.com/palkan/active_event_store
spec/cases/sync_subscriptions_spec.rb
Ruby
mit
204
master
1,503
# frozen_string_literal: true require "rails_helper" describe "sync #subscribe" do let(:event_class) { ActiveEventStore::TestEvent } it "subscribe with block" do events_seen = [] ActiveEventStore.subscribe(to: event_class, sync: true) do |event| events_seen << event end event = event_clas...
github
palkan/active_event_store
https://github.com/palkan/active_event_store
spec/support/test_events.rb
Ruby
mit
204
master
254
# frozen_string_literal: true module ActiveEventStore class TestEvent < ActiveEventStore::Event self.identifier = "test_event" attributes :user_id, :action_type sync_attributes :user end class AnotherTestEvent < TestEvent end end
github
palkan/active_event_store
https://github.com/palkan/active_event_store
spec/support/active_job_context.rb
Ruby
mit
204
master
412
# frozen_string_literal: true shared_context "active_job:perform" do around do |ex| was_perform = ActiveJob::Base.queue_adapter.perform_enqueued_jobs ActiveJob::Base.queue_adapter.perform_enqueued_jobs = true ex.run ActiveJob::Base.queue_adapter.perform_enqueued_jobs = was_perform end end RSpec.co...
github
palkan/active_event_store
https://github.com/palkan/active_event_store
spec/support/application.rb
Ruby
mit
204
master
974
# frozen_string_literal: true require "combustion" require "rails_event_store" require "rails/generators" APP_ROOT = File.expand_path(File.join(__dir__, "..", "internal")) FileUtils.rm_rf File.join(APP_ROOT, "db", "migrate") begin Combustion.initialize! :active_record, :active_job do config.load_defaults Rai...
github
palkan/active_event_store
https://github.com/palkan/active_event_store
spec/support/event_store_reset.rb
Ruby
mit
204
master
381
# frozen_string_literal: true # Monkey-patch event store to add `#reset!` method # to remove all subscriptions module RubyEventStore class Client def reset! broker = @broker broker = broker.send(:broker) if broker.is_a?(RubyEventStore::InstrumentedBroker) broker.instance_variable_set(:@subscri...
github
palkan/active_event_store
https://github.com/palkan/active_event_store
lib/active_event_store.rb
Ruby
mit
204
master
1,815
# frozen_string_literal: true require "rails_event_store" require "active_event_store/version" require "active_event_store/config" require "active_event_store/domain_event" require "active_event_store/event" require "active_event_store/mapping" require "active_event_store/mapper" require "active_event_store/rspec" ...
github
palkan/active_event_store
https://github.com/palkan/active_event_store
lib/active_event_store/mapper.rb
Ruby
mit
204
master
372
# frozen_string_literal: true module ActiveEventStore class Mapper < RubyEventStore::Mappers::PipelineMapper def initialize(mapping:) super(RubyEventStore::Mappers::Pipeline.new( RubyEventStore::Mappers::Transformation::SymbolizeMetadataKeys.new, to_domain_event: ActiveEventStore::DomainEve...
github
palkan/active_event_store
https://github.com/palkan/active_event_store
lib/active_event_store/test_helper.rb
Ruby
mit
204
master
2,145
# frozen_string_literal: true require "active_event_store/test_helper/event_published_matcher" module ActiveEventStore module TestHelper extend ActiveSupport::Concern included do include ActiveJob::TestHelper end # Asserts that the given event was published `exactly`, `at_least` or `at_most`...
github
palkan/active_event_store
https://github.com/palkan/active_event_store
lib/active_event_store/domain_event.rb
Ruby
mit
204
master
1,399
# frozen_string_literal: true module ActiveEventStore class DomainEvent < RubyEventStore::Mappers::Transformation::DomainEvent attr_reader :mapping def initialize(mapping:) @mapping = mapping end def dump(event) # lazily add type to mapping # NOTE: use class name instead of a class...
github
palkan/active_event_store
https://github.com/palkan/active_event_store
lib/active_event_store/event.rb
Ruby
mit
204
master
2,909
# frozen_string_literal: true module ActiveEventStore # RES event wrapper class Event < RubyEventStore::Event RESERVED_ATTRIBUTES = %i[event_id type metadata].freeze class << self attr_writer :identifier def identifier return @identifier if instance_variable_defined?(:@identifier) ...
github
palkan/active_event_store
https://github.com/palkan/active_event_store
lib/active_event_store/subscriber_job.rb
Ruby
mit
204
master
1,743
# frozen_string_literal: true module ActiveEventStore # Base job for async subscribers class SubscriberJob < ActiveJob::Base class << self attr_accessor :subscriber def from(callable) if callable.is_a?(Proc) || callable.name.nil? raise ArgumentError, "Anonymous subscribers (block...
github
palkan/active_event_store
https://github.com/palkan/active_event_store
lib/active_event_store/config.rb
Ruby
mit
204
master
485
# frozen_string_literal: true require "json" module ActiveEventStore class Config attr_writer :repository, :serializer, :job_queue_name, :store_options def repository @repository ||= RailsEventStoreActiveRecord::EventRepository.new(serializer: serializer) end def serializer @serializer...
github
palkan/active_event_store
https://github.com/palkan/active_event_store
lib/active_event_store/mapping.rb
Ruby
mit
204
master
420
# frozen_string_literal: true module ActiveEventStore class Mapping delegate :fetch, to: :data def initialize @data = {} end def register(type, class_name) data[type] = class_name end def register_event(event_class) register event_class.identifier, event_class.name en...
github
palkan/active_event_store
https://github.com/palkan/active_event_store
lib/active_event_store/engine.rb
Ruby
mit
204
master
1,528
# frozen_string_literal: true require "rails/engine" module ActiveEventStore class Engine < ::Rails::Engine config.active_event_store = ActiveEventStore.config # Use before configuration hook to check for ActiveJob presence ActiveSupport.on_load(:before_configuration) do next warn "Active Job is ...
github
palkan/active_event_store
https://github.com/palkan/active_event_store
lib/active_event_store/rspec/have_enqueued_async_subscriber_for.rb
Ruby
mit
204
master
1,959
# frozen_string_literal: true # Do not fail if rspec-rails is not available begin require "rspec/rails" require "rspec/rails/matchers/active_job" rescue LoadError warn "You must add `rspec-rails` to your project to use `have_enqueued_async_subscriber_for` matcher" return end module ActiveEventStore class Ha...
github
palkan/active_event_store
https://github.com/palkan/active_event_store
lib/active_event_store/rspec/have_published_event.rb
Ruby
mit
204
master
3,369
# frozen_string_literal: true module ActiveEventStore class HavePublishedEvent < RSpec::Matchers::BuiltIn::BaseMatcher attr_reader :event_class, :event_store, :attributes def initialize(event_class) @event_class = event_class @event_store = ActiveEventStore.event_store set_expected_number(...
github
palkan/active_event_store
https://github.com/palkan/active_event_store
lib/active_event_store/test_helper/event_published_matcher.rb
Ruby
mit
204
master
4,292
# frozen_string_literal: true module ActiveEventStore module TestHelper class EventPublishedMatcher attr_reader :attributes, :matching_events def initialize(expected_event_class, store: nil, with: nil, exactly: nil, at_least: nil, at_most: nil, refute: false) @event_class = expected_...
github
palkan/active_event_store
https://github.com/palkan/active_event_store
test/test_helper.rb
Ruby
mit
204
master
559
# frozen_string_literal: true $LOAD_PATH.unshift File.expand_path("../lib", __dir__) ENV["RAILS_ENV"] = "test" begin require "debug" unless ENV["CI"] rescue LoadError end # https://github.com/rails/rails/issues/54263 require "logger" require_relative "../spec/support/application" require "active_event_store" ...
github
palkan/active_event_store
https://github.com/palkan/active_event_store
test/active_event_store/test_helper_test.rb
Ruby
mit
204
master
4,031
# frozen_string_literal: true require "test_helper" require "active_event_store/test_helper" require_relative "../../spec/support/test_events" class ActiveEventStore::TestHelperTest < Minitest::Test include ActiveEventStore::TestHelper attr_reader :event_class, :event, :event2 module TestSubscriber ...
github
arturictus/sidekiq_alive
https://github.com/arturictus/sidekiq_alive
Gemfile
Ruby
mit
204
master
719
# frozen_string_literal: true source "https://rubygems.org" git_source(:github) { |repo_name| "https://github.com/#{repo_name}" } # Specify your gem's dependencies in sidekiq_alive.gemspec gemspec gem "sidekiq", ENV["SIDEKIQ_VERSION_RANGE"] || "< 9" gem "ruby-lsp", "~> 0.23.11", group: :development group :test do...
github
arturictus/sidekiq_alive
https://github.com/arturictus/sidekiq_alive
Rakefile
Ruby
mit
204
master
201
# frozen_string_literal: true require "bundler/gem_tasks" require "rspec/core/rake_task" RSpec::Core::RakeTask.new(:spec) task default: :spec load "tasks/version.rake" SidekiqAlive::VersionTask.new
github
arturictus/sidekiq_alive
https://github.com/arturictus/sidekiq_alive
sidekiq_alive.gemspec
Ruby
mit
204
master
2,216
# frozen_string_literal: true lib = File.expand_path("lib", __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require "sidekiq_alive/version" Gem::Specification.new do |spec| spec.name = "sidekiq_alive" spec.authors = ["Andrejs Cunskis", "Artur Pañach"] spec.email = ["and...
github
arturictus/sidekiq_alive
https://github.com/arturictus/sidekiq_alive
tasks/version.rake
Ruby
mit
204
master
1,668
# frozen_string_literal: true require "semver" module SidekiqAlive # Update app version # class VersionTask include Rake::DSL VERSION_FILE = "lib/sidekiq_alive/version.rb" def initialize add_version_task end # Add version bump task # def add_version_task desc("Bump app...
github
arturictus/sidekiq_alive
https://github.com/arturictus/sidekiq_alive
lib/sidekiq_alive.rb
Ruby
mit
204
master
4,776
# frozen_string_literal: true require "sidekiq" require "sidekiq/api" require "singleton" require "sidekiq_alive/version" require "sidekiq_alive/config" require "sidekiq_alive/helpers" require "sidekiq_alive/redis" module SidekiqAlive HOSTNAME_REGISTRY = "sidekiq-alive-hostnames" CAPSULE_NAME = "sidekiq-alive" ...
github
arturictus/sidekiq_alive
https://github.com/arturictus/sidekiq_alive
lib/sidekiq_alive/helpers.rb
Ruby
mit
204
master
1,376
# frozen_string_literal: true module SidekiqAlive module Helpers class << self def sidekiq_7? current_sidekiq_version >= Gem::Version.new("7") end def sidekiq_6? current_sidekiq_version >= Gem::Version.new("6") && current_sidekiq_version < Gem::Version.new("7") ...
github
arturictus/sidekiq_alive
https://github.com/arturictus/sidekiq_alive
lib/sidekiq_alive/server.rb
Ruby
mit
204
master
484
# frozen_string_literal: true module SidekiqAlive module Server class << self def run! server.run! end private def server use_rack? ? Rack : Default end def use_rack? return false unless SidekiqAlive.config.server Helpers.use_rackup? || Help...
github
arturictus/sidekiq_alive
https://github.com/arturictus/sidekiq_alive
lib/sidekiq_alive/config.rb
Ruby
mit
204
master
1,465
# frozen_string_literal: true module SidekiqAlive class Config include Singleton attr_accessor :host, :port, :path, :liveness_key, :time_to_live, :callback, :registered_instance_key, ...
github
arturictus/sidekiq_alive
https://github.com/arturictus/sidekiq_alive
lib/sidekiq_alive/worker.rb
Ruby
mit
204
master
1,575
# frozen_string_literal: true module SidekiqAlive class Worker include Sidekiq::Worker sidekiq_options retry: false # Passing the hostname argument it's only for debugging enqueued jobs def perform(_hostname = SidekiqAlive.hostname) # Checks if custom liveness probe passes should fail or retu...
github
arturictus/sidekiq_alive
https://github.com/arturictus/sidekiq_alive
lib/sidekiq_alive/redis.rb
Ruby
mit
204
master
339
# frozen_string_literal: true module SidekiqAlive module Redis class << self def adapter(capsule = nil) Helpers.sidekiq_7? ? Redis::RedisClientGem.new(capsule) : Redis::RedisGem.new end end end end require_relative "redis/base" require_relative "redis/redis_client_gem" require_relative...
github
arturictus/sidekiq_alive
https://github.com/arturictus/sidekiq_alive
lib/sidekiq_alive/server/rack.rb
Ruby
mit
204
master
1,834
# frozen_string_literal: true require_relative "base" module SidekiqAlive module Server class Rack extend Base class << self def run! logger.info("[SidekiqAlive] Starting healthcheck '#{server}' server") @server_pid = ::Process.fork do @handler = handler ...
github
arturictus/sidekiq_alive
https://github.com/arturictus/sidekiq_alive
lib/sidekiq_alive/server/default.rb
Ruby
mit
204
master
2,185
# frozen_string_literal: true require_relative "http_server" require_relative "base" module SidekiqAlive module Server class Default < HttpServer extend Base class << self def run! logger.info("[SidekiqAlive] Starting default healthcheck server on #{host}:#{port}") @serv...
github
arturictus/sidekiq_alive
https://github.com/arturictus/sidekiq_alive
lib/sidekiq_alive/server/http_server.rb
Ruby
mit
204
master
3,672
# frozen_string_literal: true require "gserver" module SidekiqAlive module Server # Simple HTTP server implementation # class HttpServer < GServer # Request class for HTTP server # class Request attr_reader :data, :header, :method, :path, :proto def initialize(data, me...
github
arturictus/sidekiq_alive
https://github.com/arturictus/sidekiq_alive
lib/sidekiq_alive/server/base.rb
Ruby
mit
204
master
1,081
# frozen_string_literal: true module SidekiqAlive module Server module Base SHUTDOWN_SIGNAL = "TERM" QUIET_SIGNAL = "TSTP" # set web server to quiet mode def quiet! logger.info("[SidekiqAlive] Setting web server to quiet mode") Process.kill(QUIET_SIGNAL, @server_pid) unle...
github
arturictus/sidekiq_alive
https://github.com/arturictus/sidekiq_alive
lib/sidekiq_alive/redis/base.rb
Ruby
mit
204
master
622
# frozen_string_literal: true module SidekiqAlive module Redis class Base def set(...) raise(NotImplementedError) end def zadd(set_key, ex, key) raise(NotImplementedError) end def zrange(set_key, start, stop) raise(NotImplementedError) end def ...
github
arturictus/sidekiq_alive
https://github.com/arturictus/sidekiq_alive
lib/sidekiq_alive/redis/redis_client_gem.rb
Ruby
mit
204
master
1,247
# frozen_string_literal: true require_relative "base" module SidekiqAlive module Redis # Wrapper for `redis-client` gem used by `sidekiq` > 7 # https://github.com/redis-rb/redis-client class RedisClientGem < Base def initialize(capsule = nil) super() @capsule = Sidekiq.default_con...
github
arturictus/sidekiq_alive
https://github.com/arturictus/sidekiq_alive
lib/sidekiq_alive/redis/redis_gem.rb
Ruby
mit
204
master
910
# frozen_string_literal: true require_relative "base" module SidekiqAlive module Redis # Wrapper for `redis` gem used by sidekiq < 7 # https://github.com/redis/redis-rb class RedisGem < Base def set(key, time:, ex:) redis { |r| r.set(key, time, ex: ex) } end def get(key) ...
github
arturictus/sidekiq_alive
https://github.com/arturictus/sidekiq_alive
spec/spec_helper.rb
Ruby
mit
204
master
760
# frozen_string_literal: true require "simplecov" SimpleCov.start require "simplecov-cobertura" SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter require "bundler/setup" require "sidekiq_alive" require "rspec-sidekiq" require "debug" require "rack" ENV["HOSTNAME"] = "test-hostname" Sidekiq.logger.level...
github
arturictus/sidekiq_alive
https://github.com/arturictus/sidekiq_alive
spec/sidekiq_alive_spec.rb
Ruby
mit
204
master
5,420
# frozen_string_literal: true begin # this is needed for spec to work with sidekiq >7 require "sidekiq/capsule" rescue LoadError # rubocop:disable Lint/SuppressedException end RSpec.describe(SidekiqAlive) do context "with configuration" do it "has a version number" do expect(SidekiqAlive::VERSION).not...
github
arturictus/sidekiq_alive
https://github.com/arturictus/sidekiq_alive
spec/config_spec.rb
Ruby
mit
204
master
278
# frozen_string_literal: true RSpec.describe(SidekiqAlive::Config) do subject(:config) { described_class.instance } describe "#worker_interval" do it "less than ttl" do expect(config.worker_interval).to(satisfy { |i| i < config.time_to_live }) end end end
github
arturictus/sidekiq_alive
https://github.com/arturictus/sidekiq_alive
spec/redis_spec.rb
Ruby
mit
204
master
612
# frozen_string_literal: true RSpec.describe(SidekiqAlive::Redis) do let(:redis) { SidekiqAlive::Redis.adapter } it "Works" do time = Time.now.to_s redis.set("hello", time: time, ex: 60) expect(redis.ttl("hello") > 1).to(be(true)) expect(redis.get("hello")).to(eq(time)) redis.zadd("test_set", ...
github
arturictus/sidekiq_alive
https://github.com/arturictus/sidekiq_alive
spec/worker_spec.rb
Ruby
mit
204
master
2,357
# frozen_string_literal: true RSpec.describe(SidekiqAlive::Worker) do subject(:perform) do described_class.new.perform end context "When being executed in the same instance" do it "stores alive key and requeues it self" do SidekiqAlive.register_current_instance expect(described_class).to(rec...
github
arturictus/sidekiq_alive
https://github.com/arturictus/sidekiq_alive
spec/server_spec.rb
Ruby
mit
204
master
4,239
# frozen_string_literal: true around_config = proc do |example| ENV["SIDEKIQ_ALIVE_HOST"] = "1.2.3.4" ENV["SIDEKIQ_ALIVE_PORT"] = "4567" ENV["SIDEKIQ_ALIVE_PATH"] = "/health" SidekiqAlive.config.set_defaults example.run ENV["SIDEKIQ_ALIVE_HOST"] = nil ENV["SIDEKIQ_ALIVE_PORT"] = nil ENV["SIDEKIQ_ALIV...
github
arturictus/sidekiq_alive
https://github.com/arturictus/sidekiq_alive
spec/server/default_spec.rb
Ruby
mit
204
master
1,682
# frozen_string_literal: true require "net/http" RSpec.describe(SidekiqAlive::Server::Default) do let(:port) { 7433 } let(:path) { "/" } let(:server) { SidekiqAlive::Server::Default.new(port, "0.0.0.0", path) } before do server.start end after do server.stop end def get(uri) @last_respo...
github
arturictus/sidekiq_alive
https://github.com/arturictus/sidekiq_alive
spec/server/rack_spec.rb
Ruby
mit
204
master
1,712
# frozen_string_literal: true require "rack/test" ENV["RACK_ENV"] = "test" RSpec.describe(SidekiqAlive::Server::Rack) do include Rack::Test::Methods subject(:app) { described_class } before do described_class.instance_variable_set(:@quiet, nil) end context "with default configuration" do it "res...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
imgproxy.gemspec
Ruby
mit
204
master
1,877
# frozen_string_literal: true lib = File.expand_path("lib", __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require "imgproxy/version" Gem::Specification.new do |spec| spec.name = "imgproxy" spec.version = Imgproxy::VERSION spec.summary = "imgproxy URL generator" spec.description = "A gem tha...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy.rb
Ruby
mit
204
master
3,323
# frozen_string_literal: true require "imgproxy/version" require "imgproxy/config" require "imgproxy/url_builders/processing" require "imgproxy/url_builders/info" require "imgproxy/extensions/active_storage" require "imgproxy/extensions/shrine" # @see Imgproxy::ClassMethods module Imgproxy class << self # Imgp...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/config.rb
Ruby
mit
204
master
4,378
# frozen_string_literal: true require "anyway_config" require "imgproxy/service_config" require "imgproxy/url_adapters" module Imgproxy # Imgproxy config # # @!attribute use_short_options # Use short processing option names (+rs+ for +resize+, +g+ for +gravity+, etc). # Defaults to true # @return [...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/url_adapters.rb
Ruby
mit
204
master
1,319
# frozen_string_literal: true require "imgproxy/url_adapters/active_storage" require "imgproxy/url_adapters/shrine" module Imgproxy # URL adapters config. Allows to use this gem with ActiveStorage, Shrine, etc. # # Imgproxy.configure do |config| # config.url_adapters.add Imgproxy::UrlAdapters::ActiveSto...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/service_config.rb
Ruby
mit
204
master
2,969
# frozen_string_literal: true require "anyway_config" module Imgproxy # Imgproxy custom config for services # # @!attribute endpoint # imgproxy endpoint # @return [String] # @!attribute key # imgproxy hex-encoded signature key # @return [String] # @!attribute salt # imgproxy hex-encoded ...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/trim_array.rb
Ruby
mit
204
master
221
# frozen_string_literal: true module Imgproxy # `Array.trim!` refinement module TrimArray refine Array do def trim! delete_at(-1) while !empty? && last.nil? self end end end end
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/extensions/active_storage.rb
Ruby
mit
204
master
903
# frozen_string_literal: true module Imgproxy module Extensions # Extension for ActiveStorage # @see Imgproxy.extend_active_storage! module ActiveStorage # Returns imgproxy URL for an attachment # # @return [String] # @param options [Hash, Imgproxy::UrlBuilders::Processing] ...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/extensions/shrine.rb
Ruby
mit
204
master
931
# frozen_string_literal: true module Imgproxy module Extensions # Extension for Shrine::UploadedFile # @see Imgproxy.extend_shrine! module Shrine # Returns imgproxy URL for a Shrine::UploadedFile instance # # @return [String] # @param options [Hash, Imgproxy::UrlBuilders::Processi...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/options_builders/base.rb
Ruby
mit
204
master
1,277
# frozen_string_literal: true require "imgproxy/trim_array" module Imgproxy module OptionsBuilders # Formats and regroups URL options class Base < Hash using TrimArray # Hash of options casters. Redefine this in subclases CASTERS = {}.freeze # Array of meta-options names. Redefine t...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/options_builders/info.rb
Ruby
mit
204
master
2,140
# frozen_string_literal: true require "imgproxy/options_builders/base" require "imgproxy/options_casters/string" require "imgproxy/options_casters/integer" require "imgproxy/options_casters/float" require "imgproxy/options_casters/bool" require "imgproxy/options_casters/array" require "imgproxy/options_casters/alpha"...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/options_builders/processing.rb
Ruby
mit
204
master
6,673
# frozen_string_literal: true require "imgproxy/options_builders/base" require "imgproxy/options_casters/string" require "imgproxy/options_casters/integer" require "imgproxy/options_casters/float" require "imgproxy/options_casters/bool" require "imgproxy/options_casters/array" require "imgproxy/options_casters/base64...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/url_builders/base.rb
Ruby
mit
204
master
5,076
# frozen_string_literal: true require "openssl" require "base64" require "erb" require "imgproxy/options_builders/base" module Imgproxy module UrlBuilders class UnknownServiceError < StandardError; end class InvalidEncryptionKeyError < StandardError; end # Builds imgproxy URL # # builder = ...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/url_builders/processing.rb
Ruby
mit
204
master
1,740
# frozen_string_literal: true require "imgproxy/option_aliases/processing" require "imgproxy/options_builders/processing" require "imgproxy/url_builders/base" module Imgproxy module UrlBuilders # Builds imgproxy URL # # builder = Imgproxy::UrlBuilders::Processing.new( # width: 500, # h...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/url_builders/info.rb
Ruby
mit
204
master
1,246
# frozen_string_literal: true require "imgproxy/option_aliases/info" require "imgproxy/options_builders/info" require "imgproxy/url_builders/base" module Imgproxy module UrlBuilders # Builds imgproxy info URL # # builder = Imgproxy::UrlBuilders::Info.new( # width: 500, # height: 400, ...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/options_casters/filename.rb
Ruby
mit
204
master
863
# frozen_string_literal: true require "imgproxy/options_casters/group" require "imgproxy/options_casters/string" require "imgproxy/options_casters/bool" require "imgproxy/options_casters/base64" module Imgproxy module OptionsCasters # Casts `filename` processing option module Filename CASTER = Imgprox...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/options_casters/group.rb
Ruby
mit
204
master
443
# frozen_string_literal: true require "imgproxy/trim_array" module Imgproxy module OptionsCasters # Casts group of options and trim nils from the end class Group using TrimArray def initialize(extractors) @extractors = extractors end def cast(raw) values = @extracto...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/options_casters/size.rb
Ruby
mit
204
master
687
# frozen_string_literal: true require "imgproxy/trim_array" require "imgproxy/options_casters/integer" require "imgproxy/options_casters/bool" require "imgproxy/options_casters/extend" module Imgproxy module OptionsCasters # Casts `size` processing option module Size using TrimArray def self.ca...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/options_casters/adjust.rb
Ruby
mit
204
master
602
# frozen_string_literal: true require "imgproxy/options_casters/group" require "imgproxy/options_casters/integer" require "imgproxy/options_casters/float" module Imgproxy module OptionsCasters # Casts `adjust` processing option module Adjust CASTER = Imgproxy::OptionsCasters::Group.new( bright...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/options_casters/webp_options.rb
Ruby
mit
204
master
570
# frozen_string_literal: true require "imgproxy/options_casters/group" require "imgproxy/options_casters/string" module Imgproxy module OptionsCasters # Casts `webp_options` processing option module WebpOptions CASTER = Imgproxy::OptionsCasters::Group.new( compression: Imgproxy::OptionsCasters...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/options_casters/float.rb
Ruby
mit
204
master
370
# frozen_string_literal: true module Imgproxy module OptionsCasters # Casts float option module Float ZERO_RE = /\.0+/.freeze def self.cast(raw) raw&.to_f&.then do |f| # Convert integral value to Integer so to_s won't give us trailing zero i = f.to_i (i == f...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/options_casters/png_options.rb
Ruby
mit
204
master
663
# frozen_string_literal: true require "imgproxy/options_casters/group" require "imgproxy/options_casters/bool" require "imgproxy/options_casters/integer" module Imgproxy module OptionsCasters # Casts `png_options` processing option module PngOptions CASTER = Imgproxy::OptionsCasters::Group.new( ...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/options_casters/blurhash.rb
Ruby
mit
204
master
513
# frozen_string_literal: true require "imgproxy/options_casters/group" require "imgproxy/options_casters/integer" module Imgproxy module OptionsCasters # Casts `blurhash` info option module Blurhash CASTER = Imgproxy::OptionsCasters::Group.new( x_components: Imgproxy::OptionsCasters::Integer, ...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/options_casters/gravity.rb
Ruby
mit
204
master
1,020
# frozen_string_literal: true require "imgproxy/trim_array" require "imgproxy/options_casters/string" require "imgproxy/options_casters/group" require "imgproxy/options_casters/array" require "imgproxy/options_casters/float" module Imgproxy module OptionsCasters # Casts `gravity` processing option module Gr...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/options_casters/average.rb
Ruby
mit
204
master
720
# frozen_string_literal: true require "imgproxy/options_casters/group" require "imgproxy/options_casters/bool" module Imgproxy module OptionsCasters # Casts `average` info option module Average CASTER = Imgproxy::OptionsCasters::Group.new( average: Imgproxy::OptionsCasters::Bool, ignor...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/options_casters/jpeg_options.rb
Ruby
mit
204
master
834
# frozen_string_literal: true require "imgproxy/options_casters/group" require "imgproxy/options_casters/bool" require "imgproxy/options_casters/integer" module Imgproxy module OptionsCasters # Casts `jpeg_options` processing option module JpegOptions CASTER = Imgproxy::OptionsCasters::Group.new( ...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/options_casters/resize.rb
Ruby
mit
204
master
518
# frozen_string_literal: true require "imgproxy/trim_array" require "imgproxy/options_casters/string" require "imgproxy/options_casters/size" module Imgproxy module OptionsCasters # Casts `resize` processing option module Resize using TrimArray def self.cast(raw) return raw unless raw.i...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/options_casters/watermark_size.rb
Ruby
mit
204
master
522
# frozen_string_literal: true require "imgproxy/options_casters/integer" require "imgproxy/options_casters/bool" require "imgproxy/options_casters/extend" module Imgproxy module OptionsCasters # Casts `watermark_size` processing option module WatermarkSize def self.cast(raw) return raw unless ...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/options_casters/hashsum.rb
Ruby
mit
204
master
603
# frozen_string_literal: true require "imgproxy/options_casters/group" require "imgproxy/options_casters/string" module Imgproxy module OptionsCasters # Casts `hashsum` info option module Hashsum CASTER = Imgproxy::OptionsCasters::Group.new( hashsum_type: Imgproxy::OptionsCasters::String, ...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/options_casters/crop.rb
Ruby
mit
204
master
637
# frozen_string_literal: true require "imgproxy/trim_array" require "imgproxy/options_casters/float" require "imgproxy/options_casters/gravity" module Imgproxy module OptionsCasters # Casts `crop` processing/info option module Crop using TrimArray def self.cast(raw) return raw unless ra...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/options_casters/base64.rb
Ruby
mit
204
master
268
# frozen_string_literal: true require "base64" module Imgproxy module OptionsCasters # Casts string option to base64 module Base64 def self.cast(raw) ::Base64.urlsafe_encode64(raw.to_s).tr("=", "") unless raw.nil? end end end end
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/options_casters/unsharp_masking.rb
Ruby
mit
204
master
657
# frozen_string_literal: true require "imgproxy/options_casters/group" require "imgproxy/options_casters/string" require "imgproxy/options_casters/float" module Imgproxy module OptionsCasters # Casts `unsharp_masking` info option module UnsharpMasking CASTER = Imgproxy::OptionsCasters::Group.new( ...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/options_casters/alpha.rb
Ruby
mit
204
master
710
# frozen_string_literal: true require "imgproxy/options_casters/group" require "imgproxy/options_casters/bool" module Imgproxy module OptionsCasters # Casts `alpha` info option module Alpha CASTER = Imgproxy::OptionsCasters::Group.new( alpha: Imgproxy::OptionsCasters::Bool, check_trans...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/options_casters/gradient.rb
Ruby
mit
204
master
902
# frozen_string_literal: true require "imgproxy/options_casters/group" require "imgproxy/options_casters/float" require "imgproxy/options_casters/string" module Imgproxy module OptionsCasters # Casts `gradient` processing option module Gradient CASTER = Imgproxy::OptionsCasters::Group.new( opa...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/options_casters/blur_detections.rb
Ruby
mit
204
master
745
# frozen_string_literal: true require "imgproxy/trim_array" require "imgproxy/options_casters/float" require "imgproxy/options_casters/array" module Imgproxy module OptionsCasters # Casts `blur_detections` processing option module BlurDetections using TrimArray def self.cast(raw) # Allo...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/options_casters/padding.rb
Ruby
mit
204
master
1,145
# frozen_string_literal: true require "imgproxy/options_casters/group" require "imgproxy/options_casters/integer" module Imgproxy module OptionsCasters # Casts `padding` info option module Padding CASTER = Imgproxy::OptionsCasters::Group.new( top: Imgproxy::OptionsCasters::Integer, rig...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/options_casters/watermark.rb
Ruby
mit
204
master
909
# frozen_string_literal: true require "imgproxy/options_casters/group" require "imgproxy/options_casters/float" require "imgproxy/options_casters/string" module Imgproxy module OptionsCasters # Casts `watermark` processing option module Watermark CASTER = Imgproxy::OptionsCasters::Group.new( o...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/options_casters/video_thumbnail_tile.rb
Ruby
mit
204
master
1,200
# frozen_string_literal: true require "imgproxy/options_casters/group" require "imgproxy/options_casters/float" require "imgproxy/options_casters/integer" require "imgproxy/options_casters/bool" module Imgproxy module OptionsCasters # Casts `video_thumbnail_tile` processing option module VideoThumbnailTile ...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/options_casters/dominant_colors.rb
Ruby
mit
204
master
753
# frozen_string_literal: true require "imgproxy/options_casters/group" require "imgproxy/options_casters/bool" module Imgproxy module OptionsCasters # Casts `dominant_colors` info option module DominantColors CASTER = Imgproxy::OptionsCasters::Group.new( dominant_colors: Imgproxy::OptionsCaste...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/options_casters/trim.rb
Ruby
mit
204
master
841
# frozen_string_literal: true require "imgproxy/options_casters/group" require "imgproxy/options_casters/float" require "imgproxy/options_casters/string" require "imgproxy/options_casters/bool" module Imgproxy module OptionsCasters # Casts `trim` processing option module Trim CASTER = Imgproxy::Option...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/options_casters/zoom.rb
Ruby
mit
204
master
681
# frozen_string_literal: true require "imgproxy/trim_array" require "imgproxy/options_casters/float" module Imgproxy module OptionsCasters # Casts `zoom` info option module Zoom using TrimArray def self.cast(raw) # Allow zoom to be just a float return Imgproxy::OptionsCasters::F...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/options_casters/bool.rb
Ruby
mit
204
master
243
# frozen_string_literal: true module Imgproxy module OptionsCasters # Casts boolean option module Bool def self.cast(raw) return if raw.nil? (raw && raw != 0 && raw != "0") ? 1 : 0 end end end end