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 |
|---|---|---|---|---|---|---|---|---|
endoflife-date/endoflife.date | https://github.com/endoflife-date/endoflife.date/blob/a79c1123ddf8b7a14346b8eb37c80f3fab973eeb/_plugins/identifier-to-url.rb | _plugins/identifier-to-url.rb | require 'package_url'
require 'pp'
require 'jekyll'
# Generate URLs for different package type, raising an error if the type is unknown or the identifier invalid.
class IdentifierToUrl
def render(identifier_hash)
if identifier_hash.size != 1 or not identifier_hash.values[0].kind_of?(String)
raise "expecti... | ruby | MIT | a79c1123ddf8b7a14346b8eb37c80f3fab973eeb | 2026-01-04T15:51:43.049429Z | false |
endoflife-date/endoflife.date | https://github.com/endoflife-date/endoflife.date/blob/a79c1123ddf8b7a14346b8eb37c80f3fab973eeb/_plugins/product-data-validator.rb | _plugins/product-data-validator.rb | # Verify product data by performing some validation before and after products are enriched.
# Note that the site build is stopped if the validation fails.
#
# The validation done before enrichment is the validation of the properties set by the users.
#
# The validation done after enrichment is mainly the validation of ... | ruby | MIT | a79c1123ddf8b7a14346b8eb37c80f3fab973eeb | 2026-01-04T15:51:43.049429Z | false |
endoflife-date/endoflife.date | https://github.com/endoflife-date/endoflife.date/blob/a79c1123ddf8b7a14346b8eb37c80f3fab973eeb/_plugins/create-icalendar-files.rb | _plugins/create-icalendar-files.rb | #!/usr/bin/env ruby
# This script creates an calendar/[product].ics file
# in each markdown source file, where [product] is the permalink value and
require 'fileutils'
require 'icalendar'
require 'yaml'
CALENDAR_DIR = 'calendar'.freeze
def load_yaml(file)
if YAML.respond_to?(:unsafe_load)
YAML.unsafe_load_fil... | ruby | MIT | a79c1123ddf8b7a14346b8eb37c80f3fab973eeb | 2026-01-04T15:51:43.049429Z | false |
endoflife-date/endoflife.date | https://github.com/endoflife-date/endoflife.date/blob/a79c1123ddf8b7a14346b8eb37c80f3fab973eeb/_plugins/end-of-life.rb | _plugins/end-of-life.rb | # All categories on endoflife.date.
# This also defines the order in which they appear in the navigation, so keep ordered alphabetically.
CATEGORIES = %w[app database device framework lang os server-app service standard]
def is_category?(name)
CATEGORIES.include?(name)
end
# Transform a tag name to a title.
# By de... | ruby | MIT | a79c1123ddf8b7a14346b8eb37c80f3fab973eeb | 2026-01-04T15:51:43.049429Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/gems.rb | gems.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2017-2025, by Samuel Williams.
source "https://rubygems.org"
gemspec
# gem "async-http", path: "../async-http"
# gem "async-http", path: "../async-http-native-io"
# gem "openssl", git: "https://github.com/ruby/openssl.git"
# gem "async-con... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/bake.rb | bake.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2024, by Samuel Williams.
# Update the project documentation with the new version number.
#
# @parameter version [String] The new version number.
def after_gem_release_version_increment(version)
context["releases:update"].call(version)
con... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/gems/async-v1.rb | gems/async-v1.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2021-2025, by Samuel Williams.
source "https://rubygems.org"
eval_gemfile("../gems.rb")
gem "async", "~> 1.0"
| ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/gems/rack-v1.rb | gems/rack-v1.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2019-2023, by Samuel Williams.
eval_gemfile("../gems.rb")
gem "rack", "~> 1.0"
| ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/gems/async-head.rb | gems/async-head.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2021-2025, by Samuel Williams.
source "https://rubygems.org"
eval_gemfile("../gems.rb")
gem "async", git: "https://github.com/socketry/async"
| ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/gems/rack-v2.rb | gems/rack-v2.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2022-2023, by Samuel Williams.
eval_gemfile("../gems.rb")
gem "rack", "~> 2.0"
| ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/gems/rack-v3.rb | gems/rack-v3.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2022-2023, by Samuel Williams.
eval_gemfile("../gems.rb")
gem "rack", "~> 3.0.0"
gem "rackup"
| ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/gems/rack-head.rb | gems/rack-head.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2019-2025, by Samuel Williams.
source "https://rubygems.org"
eval_gemfile("../gems.rb")
gem "rack", github: "rack/rack"
| ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/fixtures/server_context.rb | fixtures/server_context.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2023-2024, by Samuel Williams.
require "sus/fixtures/async"
require "falcon/server"
require "async/http/client"
require "async/http/endpoint"
module ServerContext
include Sus::Fixtures::Async::ReactorContext
def protocol
::Async::HTT... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/fixtures/temporary_directory_context.rb | fixtures/temporary_directory_context.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2024, by Samuel Williams.
require "tmpdir"
module TemporaryDirectoryContext
def around(&block)
Dir.mktmpdir do |root|
@root = root
super(&block)
@root = nil
end
end
attr :root
end
| ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/test/falcon/ssl_server.rb | test/falcon/ssl_server.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2018-2024, by Samuel Williams.
# Copyright, 2020, by Tasos Latsas.
require "server_context"
require "sus/fixtures/openssl/valid_certificate_context"
require "sus/fixtures/openssl/verified_certificate_context"
describe Falcon::Server do
wit... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/test/falcon/configuration.rb | test/falcon/configuration.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2019-2024, by Samuel Williams.
# Copyright, 2020, by Daniel Evans.
require "falcon/configuration"
describe Falcon::Configuration do
let(:configuration) {subject.new}
it "can configurure proxy" do
configuration.load_file(File.expand_pa... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/test/falcon/server.rb | test/falcon/server.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2017-2024, by Samuel Williams.
require "server_context"
require "sus/fixtures/openssl/valid_certificate_context"
require "sus/fixtures/openssl/verified_certificate_context"
describe Falcon::Server do
include ServerContext
with "http cli... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/test/falcon/service/server.rb | test/falcon/service/server.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2024, by Samuel Williams.
require "falcon/service/server"
require "falcon/configuration"
require "falcon/environment/server"
require "falcon/environment/rackup"
describe Falcon::Service::Server do
let(:environment) do
Async::Service::Env... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/test/falcon/.configuration/proxy.rb | test/falcon/.configuration/proxy.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2019-2025, by Samuel Williams.
require "falcon/environment/proxy"
service "localhost" do
include Falcon::Environment::Proxy
url "https://www.google.com"
end
| ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/test/falcon/.configuration/rack.rb | test/falcon/.configuration/rack.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2020, by Daniel Evans.
# Copyright, 2023-2025, by Samuel Williams.
require "falcon/environment/rack"
service "localhost" do
include Falcon::Environment::Rack
count 3
end
| ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/test/falcon/command/serve.rb | test/falcon/command/serve.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2018-2025, by Samuel Williams.
# Copyright, 2019, by Sho Ito.
require "falcon/command/serve"
ServeCommand = Sus::Shared("falcon serve") do
let(:command) do
subject[
"--port", port,
"--config", File.expand_path("config.ru", __dir__)... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/test/falcon/command/top.rb | test/falcon/command/top.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2018-2024, by Samuel Williams.
require "falcon/command"
describe Falcon::Command::Top do
with "basic server configuration" do
it "can listen on specified port" do
top = subject[
"--verbose",
"serve",
"--threaded",
"--c... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/test/falcon/command/virtual.rb | test/falcon/command/virtual.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2019-2025, by Samuel Williams.
require "falcon/command/virtual"
require "async/http"
require "protocol/http/request"
require "async/websocket/client"
VirtualCommand = Sus::Shared("falcon virtual") do
let(:paths) {[
File.expand_path("he... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/test/falcon/rackup/handler/falcon.rb | test/falcon/rackup/handler/falcon.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2019-2024, by Samuel Williams.
require "sus/fixtures/async"
require "falcon/server"
require "async/http/endpoint"
require "async/http/client"
require "async/process"
require "rackup/handler/falcon"
RackupHandler = Sus::Shared("rackup hand... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/test/falcon/middleware/proxy.rb | test/falcon/middleware/proxy.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2018-2024, by Samuel Williams.
require "falcon/middleware/proxy"
require "sus/fixtures/async"
require "async/http/client"
require "async/http/endpoint"
require "async/service/environment"
describe Falcon::Middleware::Proxy do
include Sus:... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/test/falcon/environment/supervisor.rb | test/falcon/environment/supervisor.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2024-2025, by Samuel Williams.
require "falcon/configuration"
require "falcon/environment/supervisor"
require "temporary_directory_context"
describe Falcon::Environment::Supervisor do
include TemporaryDirectoryContext
let(:environment)... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/bake/falcon/supervisor.rb | bake/falcon/supervisor.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2020-2025, by Samuel Williams.
def restart
context.lookup("async:container:supervisor:restart").call
end
| ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/examples/push/client.rb | examples/push/client.rb | #!/usr/bin/env ruby
# frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2019-2025, by Samuel Williams.
require "async"
require "async/http/endpoint"
require "async/http/client"
Async do
endpoint = Async::HTTP::Endpoint.parse("https://localhost:9292")
client = Async::HTTP::Client.new(endpoi... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/examples/limited/limited.rb | examples/limited/limited.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2025, by Samuel Williams.
module Limited
# Thread local storage for the semaphore (per-worker):
Thread.attr_accessor :limited_semaphore
# We use a thread-safe semaphore to limit the number of connections that can be accepted at once.
c... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/examples/limited/falcon.rb | examples/limited/falcon.rb | #!/usr/bin/env falcon-host
# frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2025, by Samuel Williams.
require "falcon/environment/rack"
require_relative "limited"
service "limited.localhost" do
include Falcon::Environment::Rack
scheme "http"
protocol {Async::HTTP::Protocol::HTTP}
... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/examples/tls-client-verify/falcon.rb | examples/tls-client-verify/falcon.rb | #!/usr/bin/env falcon-host
# frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2025, by Samuel Williams.
require "falcon/environment/self_signed_tls"
require "falcon/environment/rack"
require "falcon/environment/supervisor"
service "hello.localhost" do
include Falcon::Environment::SelfSigne... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/examples/service/gems.rb | examples/service/gems.rb | # frozen_string_literal: true
source "https://rubygems.org"
gem "falcon"
gem "async-redis"
| ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/examples/service/falcon.rb | examples/service/falcon.rb | #!/usr/bin/env falcon-host
# frozen_string_literal: true
require "falcon/environment/rack"
require "async/redis"
service "localhost" do
include Falcon::Environment::Rack
endpoint {Async::HTTP::Endpoint.parse("http://0.0.0.0:8013")}
end
class MyService < Async::Service::Generic
def setup(container)
container.spa... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/examples/proxy/application.rb | examples/proxy/application.rb | #!/usr/bin/env falcon-host
# frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2024-2025, by Samuel Williams.
require "async/http/client"
class Application
# The endpoint we will proxy requests to:
DEFAULT_PROXY_ENDPOINT = Async::HTTP::Endpoint.parse("http://localhost:3000")
def initial... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/examples/proxy/falcon.rb | examples/proxy/falcon.rb | #!/usr/bin/env falcon-host
# frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2024-2025, by Samuel Williams.
require "falcon/environment/application"
require_relative "application"
service "proxy.localhost" do
include Falcon::Environment::Application
scheme "http"
protocol {Async::HTTP... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/examples/hello/preload.rb | examples/hello/preload.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2020-2024, by Samuel Williams.
# $stderr.puts "Preloading..."
| ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/examples/hello/falcon.rb | examples/hello/falcon.rb | #!/usr/bin/env falcon-host
# frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2019-2025, by Samuel Williams.
require "falcon/environment/self_signed_tls"
require "falcon/environment/rack"
require "falcon/environment/supervisor"
service "hello.localhost" do
include Falcon::Environment::Self... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/examples/supervisor/preload.rb | examples/supervisor/preload.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2025, by Samuel Williams.
# $stderr.puts "Preloading..."
| ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/examples/supervisor/falcon.rb | examples/supervisor/falcon.rb | #!/usr/bin/env falcon-host
# frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2025, by Samuel Williams.
require "falcon/environment/self_signed_tls"
require "falcon/environment/rack"
require "falcon/environment/supervisor"
class MemoryMonitor < Async::Container::Supervisor::MemoryMonitor
d... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/examples/supervisor/bake.rb | examples/supervisor/bake.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2025, by Samuel Williams.
def leak(size: 1024*1024)
require "async/http/internet/instance"
Sync do
response = Async::HTTP::Internet.get("http://localhost:8080/?leak=#{size}")
ensure
response&.finish
end
end
| ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/examples/call/gems.rb | examples/call/gems.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2021-2023, by Samuel Williams.
source "https://rubygems.org"
gem "falcon"
gem "trenni"
| ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/examples/benchmark/falcon.rb | examples/benchmark/falcon.rb | #!/usr/bin/env -S ./bin/falcon virtual
# frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2019-2025, by Samuel Williams.
require "falcon/environment/rack"
require "falcon/environment/self_signed_tls"
require "falcon/environment/supervisor"
service "benchmark.localhost" do
include Falcon::E... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/examples/benchmark/bake.rb | examples/benchmark/bake.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2018-2024, by Samuel Williams.
require "etc"
require "async"
require "async/process"
require "async/clock"
require "async/http/endpoint"
def hello
@config_path = File.expand_path("../hello/config.ru", __dir__)
@request_path = "/"
end
de... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/examples/streaming/gems.rb | examples/streaming/gems.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2022-2025, by Samuel Williams.
source "https://rubygems.org"
gem "xrb"
gem "rack", "~> 3"
gem "falcon", path: "../../"
| ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/examples/unicorn/gems.rb | examples/unicorn/gems.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2025, by Samuel Williams.
source "https://rubygems.org"
gem "unicorn", "~> 6.1"
gem "falcon", path: "../../"
| ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/examples/unicorn/falcon.rb | examples/unicorn/falcon.rb | #!/usr/bin/env falcon-host
# frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2025, by Samuel Williams.
require "falcon/environment/rack"
require_relative "../limited/limited"
service "limited.localhost" do
include Falcon::Environment::Rack
scheme "http"
protocol do
Async::HTTP::Prot... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/examples/memory/allocations.rb | examples/memory/allocations.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2019-2023, by Samuel Williams.
class Allocations
def initialize(app)
@app = app
end
def allocations
counts = Hash.new{|h,k| h[k] = 0}
ObjectSpace.each_object do |object|
counts[object.class] += 1
end
return counts
en... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/examples/async-service/hello.rb | examples/async-service/hello.rb | #!/usr/bin/env async-service
# frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2019-2024, by Samuel Williams.
require "falcon/environment/server"
service "hello-server" do
include Falcon::Environment::Server
middleware do
::Protocol::HTTP::Middleware::HelloWorld
end
end
| ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/examples/grpc/gems.rb | examples/grpc/gems.rb | # frozen_string_literal: true
source "https://rubygems.org"
gem "falcon", path: "../.."
gem "bake"
gem "grpc"
gem "grpc-tools"
| ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/examples/grpc/my_service_services_pb.rb | examples/grpc/my_service_services_pb.rb | # frozen_string_literal: true
# Generated by the protocol buffer compiler. DO NOT EDIT!
# Source: my_service.proto for package 'my_service'
require "grpc"
require_relative "my_service_pb"
module MyService
module Greeter
# The greeting service definition.
class Service
include ::GRPC::GenericService
s... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/examples/grpc/my_service_pb.rb | examples/grpc/my_service_pb.rb | # frozen_string_literal: true
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: my_service.proto
require "google/protobuf"
descriptor_data = "\n\x10my_service.proto\x12\nmy_service\"\x1c\n\x0cHelloRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\"\x1d\n\nHelloReply\x12\x0f\n\x07message\x18\x01 \x01(\t2G... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/examples/grpc/client.rb | examples/grpc/client.rb | #!/usr/bin/env ruby
# frozen_string_literal: true
require "grpc"
require_relative "my_service_services_pb"
def main
# Create a stub for the Greeter service
stub = MyService::Greeter::Stub.new("localhost:50051", :this_channel_is_insecure)
# Create and populate a HelloRequest object
request = MyService::HelloRequ... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/examples/grpc/server.rb | examples/grpc/server.rb | #!/usr/bin/env ruby
# frozen_string_literal: true
require "grpc"
require_relative "my_service_services_pb"
class Greeter < MyService::Greeter::Service
def say_hello(hello_req, _unused_call)
name = hello_req.name
return MyService::HelloReply.new(message: "Hello, #{name}!")
end
end
def main
# Start the gRPC ... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/examples/grpc/falcon.rb | examples/grpc/falcon.rb | #!/usr/bin/env falcon-host
# frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2025, by Samuel Williams.
require "falcon/environment/application"
require_relative "my_service_services_pb"
# Define the service handling
class GreeterService
def say_hello(hello_req, _unused_call)
name = hell... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/examples/grpc/bake.rb | examples/grpc/bake.rb | # frozen_string_literal: true
def build
system("grpc_tools_ruby_protoc", "--ruby_out=.", "--grpc_out=.", "--proto_path=.", "my_service.proto")
end | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/examples/server/standalone.rb | examples/server/standalone.rb | #!/usr/bin/env ruby
# frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2020-2024, by Samuel Williams.
require "async"
require "async/http/endpoint"
require "async/websocket/adapters/rack"
require "falcon"
module WebSocketApp
def self.call(env)
Async::WebSocket::Adapters::Rack.open(env, ... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/examples/websockets/falcon.rb | examples/websockets/falcon.rb | #!/usr/bin/env falcon-host
# frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2024, by Samuel Williams.
require "falcon/environment/self_signed_tls"
require "falcon/environment/rack"
require "falcon/environment/supervisor"
service "websockets.localhost" do
include Falcon::Environment::Self... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/examples/beer/falcon.rb | examples/beer/falcon.rb | #!/usr/bin/env falcon-host
# frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2019-2025, by Samuel Williams.
require "falcon/environment/rack"
require "falcon/environment/self_signed_tls"
require "falcon/environment/supervisor"
service "beer.localhost" do
include Falcon::Environment::Rack
... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/examples/post/client.rb | examples/post/client.rb | #!/usr/bin/env ruby
# frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2025, by Samuel Williams.
require "async/http"
require "async/http/internet/instance"
url = ARGV.shift || "https://localhost:9292"
Async do
120.times do |index|
Async::HTTP::Internet.post(url, body: "Hello, World!") ... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/lib/falcon.rb | lib/falcon.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2017-2024, by Samuel Williams.
require_relative "falcon/version"
require_relative "falcon/server"
# Falcon, running on Rails, requires specific configuration:
require_relative "falcon/railtie" if defined?(Rails::Railtie)
| ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/lib/rack/handler/falcon.rb | lib/rack/handler/falcon.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2017-2025, by Samuel Williams.
# Copyright, 2019, by Bryan Powell.
require "rack/handler"
require_relative "../../falcon/rackup/handler"
# Generally speaking, you should not require this file directly, or assume the existance of the `Rack:... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/lib/rackup/handler/falcon.rb | lib/rackup/handler/falcon.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2023-2025, by Samuel Williams.
require "rackup/handler"
require_relative "../../falcon/rackup/handler"
# Generally speaking, you should not require this file directly, or assume the existance of the `Rackup::Handler::Falcon` constant. Inst... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/lib/falcon/command.rb | lib/falcon/command.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2017-2025, by Samuel Williams.
# Copyright, 2018, by Mitsutaka Mimura.
require_relative "command/top"
module Falcon
module Command
# The main entry point for the `falcon` executable.
# @parameter arguments [Array(String)] The command l... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/lib/falcon/version.rb | lib/falcon/version.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2017-2025, by Samuel Williams.
module Falcon
VERSION = "0.53.1"
end
| ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/lib/falcon/environment.rb | lib/falcon/environment.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2019-2024, by Samuel Williams.
module Falcon
# Pre-defined environments for hosting web applications.
#
# See {Configuration::Loader#load} for more details.
module Environment
LEGACY_ENVIRONMENTS = {}
end
end
| ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/lib/falcon/tls.rb | lib/falcon/tls.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2020-2023, by Samuel Williams.
module Falcon
module TLS
# The list of supported ciphers.
#
# We follow "Intermediate compatibility" as oulined here:
# <https://wiki.mozilla.org/Security/Server_Side_TLS>
SERVER_CIPHERS = [
# TLS... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/lib/falcon/railtie.rb | lib/falcon/railtie.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2024, by Samuel Williams.
module Falcon
class Railtie < Rails::Railtie
config.active_support.isolation_level = :fiber
end
end
| ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/lib/falcon/configuration.rb | lib/falcon/configuration.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2019-2025, by Samuel Williams.
# Copyright, 2019, by Sho Ito.
require "async/service"
module Falcon
# Manages environments which describes how to host a specific application.
#
# Environments are key-value maps with lazy value resolution... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/lib/falcon/proxy_endpoint.rb | lib/falcon/proxy_endpoint.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2019-2024, by Samuel Williams.
require "io/endpoint/unix_endpoint"
module Falcon
# An endpoint suitable for proxing requests, typically via a unix pipe.
class ProxyEndpoint < ::IO::Endpoint::Generic
# Initialize the proxy endpoint.
# ... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/lib/falcon/server.rb | lib/falcon/server.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2017-2025, by Samuel Williams.
require "async/http/server"
require "protocol/http/middleware/builder"
require "protocol/http/content_encoding"
require "async/http/cache"
require_relative "middleware/verbose"
require "protocol/rack"
module... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/lib/falcon/endpoint.rb | lib/falcon/endpoint.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2018-2025, by Samuel Williams.
require "async/http/endpoint"
require "localhost/authority"
module Falcon
# An HTTP-specific endpoint which adds localhost TLS.
class Endpoint < Async::HTTP::Endpoint
# The SSL context to use, which invoke... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/lib/falcon/service/server.rb | lib/falcon/service/server.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2019-2025, by Samuel Williams.
# Copyright, 2020, by Daniel Evans.
require "async/service/managed_service"
require "async/container/supervisor/supervised"
require "async/http/endpoint"
require_relative "../server"
module Falcon
module Ser... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/lib/falcon/service/virtual.rb | lib/falcon/service/virtual.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2020-2024, by Samuel Williams.
require "async/service/generic"
module Falcon
module Service
# A controller which mananages several virtual hosts.
# Spawns instances of {Proxy} and {Redirect} to handle incoming requests.
#
# A virtu... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/lib/falcon/command/serve.rb | lib/falcon/command/serve.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2018-2025, by Samuel Williams.
# Copyright, 2018, by Mitsutaka Mimura.
require_relative "../server"
require_relative "../endpoint"
require_relative "../configuration"
require_relative "../service/server"
require_relative "../environment/rack... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/lib/falcon/command/top.rb | lib/falcon/command/top.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2020-2025, by Samuel Williams.
require_relative "serve"
require_relative "host"
require_relative "virtual"
require_relative "proxy"
require_relative "redirect"
require_relative "../version"
require "samovar"
module Falcon
module Command
... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/lib/falcon/command/host.rb | lib/falcon/command/host.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2019-2024, by Samuel Williams.
require_relative "paths"
require_relative "../version"
require "samovar"
require "async/service/controller"
module Falcon
module Command
# Implements the `falcon host` command. Designed for *deployment*.
... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/lib/falcon/command/proxy.rb | lib/falcon/command/proxy.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2020-2024, by Samuel Williams.
require_relative "../environment/proxy"
require_relative "paths"
require "samovar"
module Falcon
module Command
# Implements the `falcon proxy` command.
#
# Manages a {Controller::Proxy} instance which... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/lib/falcon/command/paths.rb | lib/falcon/command/paths.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2020-2024, by Samuel Williams.
require_relative "../configuration"
module Falcon
module Command
# A helper for resolving wildcard configuration paths.
module Paths
# Resolve a set of `@paths` that may contain wildcards, into a sorte... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/lib/falcon/command/virtual.rb | lib/falcon/command/virtual.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2018-2025, by Samuel Williams.
require "async/service"
require_relative "../environment/virtual"
require "samovar"
module Falcon
module Command
# Implements the `falcon virtual` command. Designed for *deployment*.
#
# Manages a {Co... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/lib/falcon/command/redirect.rb | lib/falcon/command/redirect.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2020-2024, by Samuel Williams.
require_relative "../environment/redirect"
require_relative "paths"
require "samovar"
module Falcon
module Command
class Redirect < Samovar::Command
self.description = "Redirect from insecure HTTP to se... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/lib/falcon/rackup/handler.rb | lib/falcon/rackup/handler.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2024-2025, by Samuel Williams.
require_relative "../../falcon"
require "kernel/sync"
require "io/endpoint/host_endpoint"
module Falcon
module Rackup
# The falcon adaptor for the `rackup` executable.
class Handler
# The default sche... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/lib/falcon/middleware/proxy.rb | lib/falcon/middleware/proxy.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2018-2025, by Samuel Williams.
require "async/http/client"
require "protocol/http/headers"
require "protocol/http/middleware"
require "console/event/failure"
require "traces/provider"
module Falcon
module Middleware
# A static middlewar... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/lib/falcon/middleware/verbose.rb | lib/falcon/middleware/verbose.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2018-2025, by Samuel Williams.
require "console"
require "async/http/statistics"
module Falcon
module Middleware
# A HTTP middleware for logging requests and responses.
class Verbose < Protocol::HTTP::Middleware
# Initialize the ver... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/lib/falcon/middleware/redirect.rb | lib/falcon/middleware/redirect.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2018-2025, by Samuel Williams.
require "async/http/client"
module Falcon
module Middleware
# A static middleware which always returns a 404 not found response.
module NotFound
def self.call(request)
return Protocol::HTTP::Respon... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/lib/falcon/environment/supervisor.rb | lib/falcon/environment/supervisor.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2019-2025, by Samuel Williams.
require_relative "../environment"
require "async/container/supervisor"
module Falcon
module Environment
# Provides an environment for hosting a supervisor which can monitor multiple applications.
module ... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/lib/falcon/environment/rackup.rb | lib/falcon/environment/rackup.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2020-2024, by Samuel Williams.
require "rack/builder"
require_relative "../server"
module Falcon
module Environment
# Provides an environment for hosting loading a Rackup `config.ru` file.
module Rackup
def rackup_path
File.expa... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/lib/falcon/environment/application.rb | lib/falcon/environment/application.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2019-2024, by Samuel Williams.
# Copyright, 2020, by Daniel Evans.
require_relative "server"
require_relative "../proxy_endpoint"
module Falcon
module Environment
# Provides an environment for hosting a web application that uses TLS.
m... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/lib/falcon/environment/tls.rb | lib/falcon/environment/tls.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2019-2024, by Samuel Williams.
require_relative "../tls"
require_relative "../environment"
module Falcon
module Environment
# Provides an environment that exposes a TLS context for hosting a secure web application.
module TLS
# The ... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/lib/falcon/environment/proxy.rb | lib/falcon/environment/proxy.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2020-2024, by Samuel Williams.
require_relative "server"
require_relative "../tls"
require_relative "../middleware/proxy"
require_relative "../environment"
module Falcon
module Environment
# Provides an environment for hosting a TLS-capa... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/lib/falcon/environment/configured.rb | lib/falcon/environment/configured.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2024, by Samuel Williams.
module Falcon
module Environment
# This module provides a common interface for configuring the Falcon application.
# @todo Reuse this for proxy and redirect services.
module Configured
# All the falcon app... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/lib/falcon/environment/rack.rb | lib/falcon/environment/rack.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2024, by Samuel Williams.
require_relative "application"
require_relative "rackup"
require_relative "../environment"
module Falcon
module Environment
# Provides an environment for hosting a web application that use a Rackup `config.ru` f... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/lib/falcon/environment/self_signed_tls.rb | lib/falcon/environment/self_signed_tls.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2019-2024, by Samuel Williams.
require "localhost/authority"
require_relative "tls"
require_relative "../environment"
module Falcon
module Environment
# Provides an environment that exposes a self-signed TLS certificate using the `localh... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/lib/falcon/environment/server.rb | lib/falcon/environment/server.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2020-2025, by Samuel Williams.
require "async/service/managed_environment"
require "async/http/endpoint"
require_relative "../service/server"
require_relative "../server"
module Falcon
module Environment
# Provides an environment for ho... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/lib/falcon/environment/virtual.rb | lib/falcon/environment/virtual.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2024, by Samuel Williams.
require_relative "configured"
require_relative "../service/virtual"
module Falcon
module Environment
module Virtual
include Configured
# The service class to use for the virtual host.
# @returns [C... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/lib/falcon/environment/lets_encrypt_tls.rb | lib/falcon/environment/lets_encrypt_tls.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2020-2024, by Samuel Williams.
require_relative "tls"
require_relative "../environment"
module Falcon
module Environment
# Provides an environment that uses "Lets Encrypt" for TLS.
module LetsEncryptTLS
# The Lets Encrypt certificat... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/lib/falcon/environment/redirect.rb | lib/falcon/environment/redirect.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2020-2025, by Samuel Williams.
require_relative "server"
require_relative "application"
require_relative "../middleware/redirect"
module Falcon
module Environment
# Provides an environment for redirecting insecure web traffic to a secure... | ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
socketry/falcon | https://github.com/socketry/falcon/blob/183d32c7cf54e15612e9f090c2088b14b8bf4a66/config/sus.rb | config/sus.rb | # frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2017-2025, by Samuel Williams.
require "covered/sus"
include Covered::Sus
ENV["CONSOLE_LEVEL"] ||= "warn"
ENV["TRACES_BACKEND"] ||= "traces/backend/test"
ENV["METRICS_BACKEND"] ||= "metrics/backend/test"
| ruby | MIT | 183d32c7cf54e15612e9f090c2088b14b8bf4a66 | 2026-01-04T15:52:17.828183Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/packaging/suse/rubygem_check.rb | packaging/suse/rubygem_check.rb | # frozen_string_literal: true
##
# Get build dir.
unless Dir.exist?("build")
puts <<~HERE
You are supposed to be running this script inside of packaging/suse and after a
successful run of `make_spec.sh`.
HERE
exit 1
end
dir = ""
Dir.entries("build").each do |d|
next if d == "." || d == ".."
dir = ... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/app/services/base_validate_service.rb | app/services/base_validate_service.rb | # frozen_string_literal: true
class BaseValidateService
attr_accessor :params
def initialize(params = {})
@params = params.dup
@messages = {}
end
private
def only_params
params[:only]
end
def messages
return @messages if only_params.nil?
@messages.keep_if { |key, v| v.present? &&... | ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
SUSE/Portus | https://github.com/SUSE/Portus/blob/2843437742515c1f0896fafaee166cde336f5b18/app/services/base_service.rb | app/services/base_service.rb | # frozen_string_literal: true
class BaseService
attr_accessor :current_user, :params
def initialize(user, params = {})
@current_user = user
@params = params.dup
end
end
| ruby | Apache-2.0 | 2843437742515c1f0896fafaee166cde336f5b18 | 2026-01-04T15:51:56.938548Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.