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 |
|---|---|---|---|---|---|---|---|---|
stripe-contrib/stripe-cli | https://github.com/stripe-contrib/stripe-cli/blob/ee98caab204fabf3d5cc34d1baef33c1cc45c881/lib/stripe/cli/version.rb | lib/stripe/cli/version.rb | module Stripe
module CLI
VERSION = "1.8.4"
end
end
| ruby | MIT | ee98caab204fabf3d5cc34d1baef33c1cc45c881 | 2026-01-04T17:48:21.359522Z | false |
stripe-contrib/stripe-cli | https://github.com/stripe-contrib/stripe-cli/blob/ee98caab204fabf3d5cc34d1baef33c1cc45c881/lib/stripe/cli/runner.rb | lib/stripe/cli/runner.rb | module Stripe
module CLI
class Runner < Thor
map "-v" => :version
map "--version" => :version
register Commands::Cards, 'cards', 'cards', 'find, list, create, & delete cards for both customers & recipients'
register Commands::Charges, 'charges', 'charges', 'find, list, create, capture, & r... | ruby | MIT | ee98caab204fabf3d5cc34d1baef33c1cc45c881 | 2026-01-04T17:48:21.359522Z | false |
stripe-contrib/stripe-cli | https://github.com/stripe-contrib/stripe-cli/blob/ee98caab204fabf3d5cc34d1baef33c1cc45c881/lib/stripe/cli/commands.rb | lib/stripe/cli/commands.rb | module Stripe
module CLI
module Commands
autoload :Cards, 'stripe/cli/commands/cards'
autoload :Charges, 'stripe/cli/commands/charges'
autoload :Customers, 'stripe/cli/commands/customers'
autoload :Tokens, 'stripe/cli/commands/tokens'
autoload :Plans, 'stripe/cli/commands/plans'
... | ruby | MIT | ee98caab204fabf3d5cc34d1baef33c1cc45c881 | 2026-01-04T17:48:21.359522Z | false |
stripe-contrib/stripe-cli | https://github.com/stripe-contrib/stripe-cli/blob/ee98caab204fabf3d5cc34d1baef33c1cc45c881/lib/stripe/cli/commands/customers.rb | lib/stripe/cli/commands/customers.rb | require 'chronic'
module Stripe
module CLI
module Commands
class Customers < Command
include Stripe::Utils
desc "list", "List customers"
option :starting_after, :desc => "The ID of the last object in the previous paged result set. For cursor-based pagination."
option :ending... | ruby | MIT | ee98caab204fabf3d5cc34d1baef33c1cc45c881 | 2026-01-04T17:48:21.359522Z | false |
stripe-contrib/stripe-cli | https://github.com/stripe-contrib/stripe-cli/blob/ee98caab204fabf3d5cc34d1baef33c1cc45c881/lib/stripe/cli/commands/events.rb | lib/stripe/cli/commands/events.rb | module Stripe
module CLI
module Commands
class Events < Command
desc "list", "List events"
option :starting_after, :desc => "The ID of the last object in the previous paged result set. For cursor-based pagination."
option :ending_before, :desc => "The ID of the first object in the p... | ruby | MIT | ee98caab204fabf3d5cc34d1baef33c1cc45c881 | 2026-01-04T17:48:21.359522Z | false |
stripe-contrib/stripe-cli | https://github.com/stripe-contrib/stripe-cli/blob/ee98caab204fabf3d5cc34d1baef33c1cc45c881/lib/stripe/cli/commands/tokens.rb | lib/stripe/cli/commands/tokens.rb | module Stripe
module CLI
module Commands
class Tokens < Command
include Stripe::Utils
desc "find ID", "Find a Token"
def find event_id
super Stripe::Token, event_id
end
desc "create TYPE", "create a new token of type TYPE(card or account)"
option :... | ruby | MIT | ee98caab204fabf3d5cc34d1baef33c1cc45c881 | 2026-01-04T17:48:21.359522Z | false |
stripe-contrib/stripe-cli | https://github.com/stripe-contrib/stripe-cli/blob/ee98caab204fabf3d5cc34d1baef33c1cc45c881/lib/stripe/cli/commands/charges.rb | lib/stripe/cli/commands/charges.rb | module Stripe
module CLI
module Commands
class Charges < Command
include Stripe::Utils
desc "list", "List charges (optionally by customer_id)"
option :starting_after, :desc => "The ID of the last object in the previous paged result set. For cursor-based pagination."
option :... | ruby | MIT | ee98caab204fabf3d5cc34d1baef33c1cc45c881 | 2026-01-04T17:48:21.359522Z | false |
stripe-contrib/stripe-cli | https://github.com/stripe-contrib/stripe-cli/blob/ee98caab204fabf3d5cc34d1baef33c1cc45c881/lib/stripe/cli/commands/balance.rb | lib/stripe/cli/commands/balance.rb | module Stripe
module CLI
module Commands
class Balance < Command
desc "current", "show currently available and pending balance figures"
def current
request Stripe::Balance, :retrieve, api_key
end
default_command :current
end
end
end
end | ruby | MIT | ee98caab204fabf3d5cc34d1baef33c1cc45c881 | 2026-01-04T17:48:21.359522Z | false |
stripe-contrib/stripe-cli | https://github.com/stripe-contrib/stripe-cli/blob/ee98caab204fabf3d5cc34d1baef33c1cc45c881/lib/stripe/cli/commands/coupons.rb | lib/stripe/cli/commands/coupons.rb | require 'chronic'
module Stripe
module CLI
module Commands
class Coupons < Command
desc "list", "List coupons"
option :starting_after, :desc => "The ID of the last object in the previous paged result set. For cursor-based pagination."
option :ending_before, :desc => "The ID of the f... | ruby | MIT | ee98caab204fabf3d5cc34d1baef33c1cc45c881 | 2026-01-04T17:48:21.359522Z | false |
stripe-contrib/stripe-cli | https://github.com/stripe-contrib/stripe-cli/blob/ee98caab204fabf3d5cc34d1baef33c1cc45c881/lib/stripe/cli/commands/invoices.rb | lib/stripe/cli/commands/invoices.rb | module Stripe
module CLI
module Commands
class Invoices < Command
desc "list", "List invoices (optionally by customer_id)"
option :starting_after, :desc => "The ID of the last object in the previous paged result set. For cursor-based pagination."
option :ending_before, :desc => "The... | ruby | MIT | ee98caab204fabf3d5cc34d1baef33c1cc45c881 | 2026-01-04T17:48:21.359522Z | false |
stripe-contrib/stripe-cli | https://github.com/stripe-contrib/stripe-cli/blob/ee98caab204fabf3d5cc34d1baef33c1cc45c881/lib/stripe/cli/commands/refunds.rb | lib/stripe/cli/commands/refunds.rb | module Stripe
module CLI
module Commands
class Refunds < Command
include Stripe::Utils
desc "list", "List refunds for CHARGE charge"
option :starting_after, :desc => "The ID of the last object in the previous paged result set. For cursor-based pagination."
option :ending_bef... | ruby | MIT | ee98caab204fabf3d5cc34d1baef33c1cc45c881 | 2026-01-04T17:48:21.359522Z | false |
stripe-contrib/stripe-cli | https://github.com/stripe-contrib/stripe-cli/blob/ee98caab204fabf3d5cc34d1baef33c1cc45c881/lib/stripe/cli/commands/plans.rb | lib/stripe/cli/commands/plans.rb | module Stripe
module CLI
module Commands
class Plans < Command
include Stripe::Utils
desc "list", "List plans"
option :starting_after, :desc => "The ID of the last object in the previous paged result set. For cursor-based pagination."
option :ending_before, :desc => "The ID ... | ruby | MIT | ee98caab204fabf3d5cc34d1baef33c1cc45c881 | 2026-01-04T17:48:21.359522Z | false |
stripe-contrib/stripe-cli | https://github.com/stripe-contrib/stripe-cli/blob/ee98caab204fabf3d5cc34d1baef33c1cc45c881/lib/stripe/cli/commands/transfers.rb | lib/stripe/cli/commands/transfers.rb | module Stripe
module CLI
module Commands
class Transfers < Command
include Stripe::Utils
desc "list", "List transfers, optionaly filter by recipient or transfer status: ( pending paid failed )"
option :starting_after, :desc => "The ID of the last object in the previous paged result ... | ruby | MIT | ee98caab204fabf3d5cc34d1baef33c1cc45c881 | 2026-01-04T17:48:21.359522Z | false |
stripe-contrib/stripe-cli | https://github.com/stripe-contrib/stripe-cli/blob/ee98caab204fabf3d5cc34d1baef33c1cc45c881/lib/stripe/cli/commands/recipients.rb | lib/stripe/cli/commands/recipients.rb | module Stripe
module CLI
module Commands
class Recipients < Command
include Stripe::Utils
desc "list", "List recipients"
option :starting_after, :desc => "The ID of the last object in the previous paged result set. For cursor-based pagination."
option :ending_before, :desc =... | ruby | MIT | ee98caab204fabf3d5cc34d1baef33c1cc45c881 | 2026-01-04T17:48:21.359522Z | false |
stripe-contrib/stripe-cli | https://github.com/stripe-contrib/stripe-cli/blob/ee98caab204fabf3d5cc34d1baef33c1cc45c881/lib/stripe/cli/commands/invoice_items.rb | lib/stripe/cli/commands/invoice_items.rb | module Stripe
module CLI
module Commands
class InvoiceItems < Command
include Stripe::Utils
desc "list", "List invoice items (optionally by customer_id)"
option :starting_after, :desc => "The ID of the last object in the previous paged result set. For cursor-based pagination."
... | ruby | MIT | ee98caab204fabf3d5cc34d1baef33c1cc45c881 | 2026-01-04T17:48:21.359522Z | false |
stripe-contrib/stripe-cli | https://github.com/stripe-contrib/stripe-cli/blob/ee98caab204fabf3d5cc34d1baef33c1cc45c881/lib/stripe/cli/commands/subscriptions.rb | lib/stripe/cli/commands/subscriptions.rb | require 'chronic'
module Stripe
module CLI
module Commands
class Subscriptions < Command
include Stripe::Utils
desc "list", "List subscriptions for CUSTOMER customer"
option :starting_after, :desc => "The ID of the last object in the previous paged result set. For cursor-based pagin... | ruby | MIT | ee98caab204fabf3d5cc34d1baef33c1cc45c881 | 2026-01-04T17:48:21.359522Z | false |
stripe-contrib/stripe-cli | https://github.com/stripe-contrib/stripe-cli/blob/ee98caab204fabf3d5cc34d1baef33c1cc45c881/lib/stripe/cli/commands/gem_version.rb | lib/stripe/cli/commands/gem_version.rb | module Stripe
module CLI
module Commands
class Version < Command
desc "version", "display the current gem version number"
option :hide
def version
puts "stripe-cli v#{Stripe::CLI::VERSION}"
end
default_command :version
end
end
end
end | ruby | MIT | ee98caab204fabf3d5cc34d1baef33c1cc45c881 | 2026-01-04T17:48:21.359522Z | false |
stripe-contrib/stripe-cli | https://github.com/stripe-contrib/stripe-cli/blob/ee98caab204fabf3d5cc34d1baef33c1cc45c881/lib/stripe/cli/commands/transactions.rb | lib/stripe/cli/commands/transactions.rb | module Stripe
module CLI
module Commands
class Transactions < Command
desc "list [TYPE]", "List transactions, optionaly filter by type: ( charges, refunds, adjustments, application_fees, application_fee_refunds, transfers, transfer_failures )"
option :starting_after, :desc => "The ID of the... | ruby | MIT | ee98caab204fabf3d5cc34d1baef33c1cc45c881 | 2026-01-04T17:48:21.359522Z | false |
stripe-contrib/stripe-cli | https://github.com/stripe-contrib/stripe-cli/blob/ee98caab204fabf3d5cc34d1baef33c1cc45c881/lib/stripe/cli/commands/cards.rb | lib/stripe/cli/commands/cards.rb | module Stripe
module CLI
module Commands
class Cards < Command
include Stripe::Utils
desc "list", "List cards for OWNER (customer or recipient)"
option :starting_after, :desc => "The ID of the last object in the previous paged result set. For cursor-based pagination."
option... | ruby | MIT | ee98caab204fabf3d5cc34d1baef33c1cc45c881 | 2026-01-04T17:48:21.359522Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/jobs/application_job.rb | app/jobs/application_job.rb | # frozen_string_literal: true
class ApplicationJob < ActiveJob::Base
# Automatically retry jobs that encountered a deadlock
# retry_on ActiveRecord::Deadlocked
# Most jobs are safe to ignore if the underlying records are no longer available
# discard_on ActiveJob::DeserializationError
end
| ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/jobs/types/sample_job.rb | app/jobs/types/sample_job.rb | # frozen_string_literal: true
class Types::SampleJob < ApplicationJob
retry_on Exception, wait: :exponentially_longer, attempts: 50
queue_as :default
def perform(sample, source_ip)
sample = ::Types::Sample.create(**sample, source_ip:)
Rails.logger.debug sample.inspect
raise "Couldn't process samp... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/helpers/meta_helper.rb | app/helpers/meta_helper.rb | # frozen_string_literal: true
module MetaHelper
def default_meta_tags
{
site: "gem.sh",
title: "",
reverse: true,
separator: "-",
description: "Beautiful documentation for any Ruby gem",
keywords: "ruby, rails, rubyonrails, programming, documentation",
canonical: request... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/helpers/heroicon_helper.rb | app/helpers/heroicon_helper.rb | # frozen_string_literal: true
module HeroiconHelper
include Heroicon::Engine.helpers
end
| ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/helpers/application_helper.rb | app/helpers/application_helper.rb | # frozen_string_literal: true
module ApplicationHelper
def to_short_sentence(array, limit: 3)
if array.length > limit
remaining = array.length - limit
"#{array.first(3).join(', ')} and #{remaining} more"
else
array.to_sentence
end
end
end
| ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/helpers/markdown_helper.rb | app/helpers/markdown_helper.rb | # frozen_string_literal: true
module MarkdownHelper
def render_markdown(content)
MarkdownRenderer.new(sanitize(content)).render
end
end
| ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/helpers/yard_helpers.rb | app/helpers/yard_helpers.rb | # frozen_string_literal: true
# rubocop:disable Rails/HelperInstanceVariable
module YARDHelpers
def yard_docs
parser = YARD::DocstringParser.new
@object.comments.each do |c|
parser.parse(c)
end
if parser.tags.any?
parser.tags.group_by(&:tag_name).map do |tag_name, tags|
case ta... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/errors/gem_constant_not_found_error.rb | app/errors/gem_constant_not_found_error.rb | # frozen_string_literal: true
class GemConstantNotFoundError < StandardError
end
| ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/errors/gem_not_found_error.rb | app/errors/gem_not_found_error.rb | # frozen_string_literal: true
class GemNotFoundError < StandardError
def initialize(name, version = nil)
super(name)
@name = name
@version = version
end
def message
if @name && @version
%(Couldn't find gem "#{@name} with version "#{@version}")
else
%(Couldn't find gem "#{@name}")... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/controllers/page_controller.rb | app/controllers/page_controller.rb | # frozen_string_literal: true
class PageController < ApplicationController
def home
@featured_gems = [
GemSpec.find("nokogiri"),
GemSpec.find("async"),
GemSpec.find("roda"),
]
@images = [
"https://nokogiri.org/images/nokogiri-serif-black.png",
"https://github.com/socketry/a... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/controllers/gems_controller.rb | app/controllers/gems_controller.rb | # frozen_string_literal: true
class GemsController < ApplicationController
include GemScoped
before_action :set_gem, except: :index
def index
@gems = Gems.just_updated
end
def show
@getting_started = [
{ title: "Installation", url: readme_gem_version_gem_path(@gem.name, @gem.version), descri... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/controllers/application_controller.rb | app/controllers/application_controller.rb | # frozen_string_literal: true
class ApplicationController < ActionController::Base
end
| ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/controllers/search_controller.rb | app/controllers/search_controller.rb | # frozen_string_literal: true
class SearchController < ApplicationController
def index
@result = GemSearch.search(params[:name])
end
end
| ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/controllers/concerns/gem_module_scoped.rb | app/controllers/concerns/gem_module_scoped.rb | # frozen_string_literal: true
module GemModuleScoped
extend ActiveSupport::Concern
included do
before_action :set_module, except: :index
end
private
def set_module
@module = @gem.find_module!(params[:id])
end
end
| ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/controllers/concerns/gem_target_scoped.rb | app/controllers/concerns/gem_target_scoped.rb | # frozen_string_literal: true
module GemTargetScoped
extend ActiveSupport::Concern
included do
before_action :set_target
end
private
def set_target
if params[:class_id]
@target = @gem.find_class!(params[:class_id])
@namespace = @gem.find_namespace(@target.qualified_namespace)
elsif... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/controllers/concerns/gem_scoped.rb | app/controllers/concerns/gem_scoped.rb | # frozen_string_literal: true
module GemScoped
extend ActiveSupport::Concern
included do
before_action :set_gem
rescue_from "GemNotFoundError", "Gems::NotFound" do |exception|
redirect_to gems_path, notice: exception.message
end
rescue_from "GemConstantNotFoundError" do |exception|
r... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/controllers/concerns/gem_file_scoped.rb | app/controllers/concerns/gem_file_scoped.rb | # frozen_string_literal: true
module GemFileScoped
extend ActiveSupport::Concern
included do
before_action :set_file
end
private
def set_file
SourceFile.new(file: params[:id], gem: @gem).tap do |file|
@file = file if file.exist?
end
end
end
| ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/controllers/concerns/gem_class_scoped.rb | app/controllers/concerns/gem_class_scoped.rb | # frozen_string_literal: true
module GemClassScoped
extend ActiveSupport::Concern
included do
before_action :set_class, except: :index
end
private
def set_class
@class = @gem.find_class!(params[:id])
end
end
| ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/controllers/gems/files_controller.rb | app/controllers/gems/files_controller.rb | # frozen_string_literal: true
class Gems::FilesController < ApplicationController
include GemScoped
include GemFileScoped
def index
end
def show
end
end
| ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/controllers/gems/docs_controller.rb | app/controllers/gems/docs_controller.rb | # frozen_string_literal: true
class Gems::DocsController < ApplicationController
include GemScoped
def index
end
def show
end
end
| ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/controllers/gems/class_methods_controller.rb | app/controllers/gems/class_methods_controller.rb | # frozen_string_literal: true
class Gems::ClassMethodsController < ApplicationController
include GemScoped
include GemTargetScoped
def show
@method = @target.class_methods.find { |class_method| class_method.name == params[:id] }
raise(GemConstantNotFoundError, "Class method '#{params[:id]}' not found o... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/controllers/gems/modules_controller.rb | app/controllers/gems/modules_controller.rb | # frozen_string_literal: true
class Gems::ModulesController < ApplicationController
include GemScoped
include GemModuleScoped
def index
end
def show
@modules = @gem.modules.select { |mod| mod.qualified_namespace == @module.qualified_name }
@classes = @gem.classes.select { |klass| klass.qualified_na... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/controllers/gems/guides_controller.rb | app/controllers/gems/guides_controller.rb | # frozen_string_literal: true
class Gems::GuidesController < ApplicationController
include GemScoped
def index
end
def show
end
end
| ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/controllers/gems/classes_controller.rb | app/controllers/gems/classes_controller.rb | # frozen_string_literal: true
class Gems::ClassesController < ApplicationController
include GemScoped
include GemClassScoped
def index
end
def show
@classes = @gem.classes.select { |klass| klass.qualified_namespace == @class.qualified_name }
@namespace = @gem.find_namespace(@class.qualified_namespa... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/controllers/gems/types_controller.rb | app/controllers/gems/types_controller.rb | # frozen_string_literal: true
class Gems::TypesController < ApplicationController
include GemScoped
def index
@samples = Types::Sample
.group(:gem_name, :gem_version, :receiver, :method_name)
.where(gem_name: @gem.name)
.where("gem_version LIKE ?", "#{@gem.version.... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/controllers/gems/rbs_controller.rb | app/controllers/gems/rbs_controller.rb | # frozen_string_literal: true
class Gems::RBSController < ApplicationController
include GemScoped
def index
require_samples = params[:require_samples].present?
signature = @gem.rbs_signature(require_samples:)
filename = "#{@gem.name}-#{@gem.version}-#{require_samples ? 'only-samples' : 'complete'}.rb... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/controllers/gems/versions_controller.rb | app/controllers/gems/versions_controller.rb | # frozen_string_literal: true
class Gems::VersionsController < ApplicationController
include GemScoped
def index
end
end
| ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/controllers/gems/pages_controller.rb | app/controllers/gems/pages_controller.rb | # frozen_string_literal: true
class Gems::PagesController < ApplicationController
include GemScoped
def show
render params[:id].to_sym
end
end
| ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/controllers/gems/search_controller.rb | app/controllers/gems/search_controller.rb | # frozen_string_literal: true
class Gems::SearchController < ApplicationController
include GemScoped
def index
query = params[:q].to_s.downcase
@modules = @gem.modules.select { |mod| mod.qualified_name.downcase.include?(query) }
@classes = @gem.classes.select { |klass| klass.qualified_name.downcase.i... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/controllers/gems/instance_methods_controller.rb | app/controllers/gems/instance_methods_controller.rb | # frozen_string_literal: true
class Gems::InstanceMethodsController < ApplicationController
include GemScoped
include GemTargetScoped
def show
@method = @target.instance_methods.find { |instance_method| instance_method.name == params[:id] }
raise(GemConstantNotFoundError, "Instance method '#{params[:id... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/controllers/api/v1/types/samples_controller.rb | app/controllers/api/v1/types/samples_controller.rb | # frozen_string_literal: true
module API
module V1
module Types
class SamplesController < ApplicationController
skip_before_action :verify_authenticity_token
def create
::Types::SampleJob.perform_later(sample_params, request.remote_ip)
head :ok
end
pri... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/components/rbs_signature.rb | app/components/rbs_signature.rb | # frozen_string_literal: true
class RBSSignature < ViewComponent::Base
def initialize(rbs:, samples: [])
@rbs = rbs
@samples = samples
end
def sample_count
@samples.to_a.length
end
def application_count
@samples.pluck(:application_name).uniq.count
end
end
| ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/components/method_details.rb | app/components/method_details.rb | # frozen_string_literal: true
class MethodDetails < ViewComponent::Base
include YARDHelpers
def initialize(object:, parent:, gem:)
@object = object
@parent = parent
@gem = gem
end
def comments_content
@object.comments.join("<br>").force_encoding("UTF-8")
rescue StandardError
""
end
... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/components/gems/heading.rb | app/components/gems/heading.rb | # frozen_string_literal: true
class Gems::Heading < ViewComponent::Base
def initialize(title:)
@title = title
end
end
| ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/components/gems/wrapper.rb | app/components/gems/wrapper.rb | # frozen_string_literal: true
class Gems::Wrapper < ViewComponent::Base
renders_one :sidebar
def initialize(gem:, modules:, classes:, class_methods:, instance_methods:)
@gem = gem
@modules = modules
@classes = classes
@class_methods = class_methods
@instance_methods = instance_methods
end
... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/components/gems/metadata.rb | app/components/gems/metadata.rb | # frozen_string_literal: true
class Gems::Metadata < ViewComponent::Base
def initialize(gem:)
@gem = gem
end
def types_status
@gem.rbs_files.any? ? :green : :default
end
def types_tooltip
(types_status == :green) ? "This gem ships type annotations" : "No type annotations detected"
end
def ... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/components/ui/status_badge.rb | app/components/ui/status_badge.rb | # frozen_string_literal: true
class UI::StatusBadge < ViewComponent::Base
CLASSES = ClassVariants.build(
base: "rounded-md bg-white px-2.5 py-1 text-xs font-semibold text-gray-900 ring-1 ring-inset ring-gray-300 flex",
variants: {},
defaults: {},
)
def initialize(label:, status: :default, tooltip: n... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/components/ui/card.rb | app/components/ui/card.rb | # frozen_string_literal: true
class UI::Card < ViewComponent::Base
renders_one :badge, UI::Badge
def initialize(title:, description:)
@title = title
@description = description
end
end
| ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/components/ui/badge.rb | app/components/ui/badge.rb | # frozen_string_literal: true
class UI::Badge < ViewComponent::Base
CLASSES = ClassVariants.build(
base: "rounded-md py-1 px-2 fs-step--2 monospace-font-family font-medium ring-1 ring-inset self-end",
variants: {
color: {
gray: "bg-gray-50 text-gray-600 ring-gray-600/10",
red: "bg-red-5... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/components/ui/code_block.rb | app/components/ui/code_block.rb | # frozen_string_literal: true
class UI::CodeBlock < ViewComponent::Base
def initialize(language: "ruby")
@language = language
end
def formatter
@formatter ||= Rouge::Formatters::HTML.new
end
def lexer
"Rouge::Lexers::#{@language.camelize}".constantize.new
rescue StandardError
Rouge::Lexer... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/components/ui/subheading.rb | app/components/ui/subheading.rb | # frozen_string_literal: true
class UI::Subheading < ViewComponent::Base
def initialize(title:)
@title = title
end
end
| ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/components/ui/heading.rb | app/components/ui/heading.rb | # frozen_string_literal: true
class UI::Heading < ViewComponent::Base
def initialize(title:)
@title = title
end
end
| ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/components/ui/code_list.rb | app/components/ui/code_list.rb | # frozen_string_literal: true
class UI::CodeList < ViewComponent::Base
def initialize(items:, gem:, title: "Items")
items = items.to_a if items.is_a?(Set)
@items = Array.wrap(items).sort_by { |item| item.try(:title) || item.to_s }
@gem = gem
@title = title
end
end
| ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/components/ui/status.rb | app/components/ui/status.rb | # frozen_string_literal: true
class UI::Status < ViewComponent::Base
CLASSES = ClassVariants.build(
base: "flex-none rounded-full p-1 ",
variants: {
status: {
default: "text-gray-500",
orange: "text-orange-400",
green: "text-green-400",
red: "text-rose-400",
},
... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/components/ui/container.rb | app/components/ui/container.rb | # frozen_string_literal: true
class UI::Container < ViewComponent::Base
end
| ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/models/gem_info.rb | app/models/gem_info.rb | # frozen_string_literal: true
class GemInfo
attr_accessor :analyzer
def self.for(name)
new(GemSpec.find(name))
end
def initialize(gemspec)
@gemspec = gemspec
@analyzer = Analyzer.new(gemspec)
analyze
end
delegate :classes, to: :@analyzer
def analyze
@gemspec.files.each do |file|
... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/models/source_file.rb | app/models/source_file.rb | # frozen_string_literal: true
SourceFile = Data.define(:file, :gem) do
def initialize(file:, gem: nil)
super
end
def url(gem)
Router.gem_version_file_path(gem.name, gem.version, file)
end
def source_path
"#{gem.unpack_data_path}/#{file}"
end
def exist?
file && gem.files.include?(file) ... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/models/markdown_renderer.rb | app/models/markdown_renderer.rb | # frozen_string_literal: true
class MarkdownRenderer
class DefaultRenderer < Redcarpet::Render::HTML
include Redcarpet::Render::SmartyPants
def block_code(code, language)
ApplicationController.render(UI::CodeBlock.new(language:).with_content(code), layout: false)
end
end
def initialize(conten... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/models/class_definition.rb | app/models/class_definition.rb | # frozen_string_literal: true
ClassDefinition = Struct.new(:namespace, :name, :qualified_name, :node, :location, :superclass, :instance_methods, :class_methods, :extended_modules, :included_modules, :comments, :defined_files, :referenced_files) do
include MethodFinders
include RBSNamespaceHelpers
def initialize... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/models/constant_reference.rb | app/models/constant_reference.rb | # frozen_string_literal: true
ConstantReference = Data.define(:path, :location) do
def initialize(path:, location: nil)
super
end
end
| ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/models/router.rb | app/models/router.rb | # frozen_string_literal: true
module Router
class << self
include Rails.application.routes.url_helpers
end
end
| ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/models/method_definition.rb | app/models/method_definition.rb | # frozen_string_literal: true
MethodDefinition = Struct.new(:name, :target, :node, :location, :comments, :defined_files) do
include RBSHelpers
def initialize(
name: nil,
target: nil,
node: nil,
location: nil,
comments: [],
defined_files: []
)
super
end
def instance_method?
f... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/models/analyzer.rb | app/models/analyzer.rb | # frozen_string_literal: true
class Analyzer
class Visitor < Prism::Visitor
# This object represents a set of comments being returned from the parser
# for a given file. It can be used to quickly access a set of comments at
# a given line number.
class CommentSet
attr_reader :comments
de... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/models/application_record.rb | app/models/application_record.rb | # frozen_string_literal: true
class ApplicationRecord < ActiveRecord::Base
primary_abstract_class
end
| ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/models/types.rb | app/models/types.rb | # frozen_string_literal: true
module Types
def self.table_name_prefix
"types_"
end
end
| ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/models/location_to_content.rb | app/models/location_to_content.rb | # frozen_string_literal: true
class LocationToContent
attr_reader :path, :location
def initialize(path, location)
@path = path.to_s
@location = location
end
def lines
File.exist?(path) ? File.readlines(path) : []
end
def code
lines.pluck(location.start_column..)
end
def location_con... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/models/module_definition.rb | app/models/module_definition.rb | # frozen_string_literal: true
ModuleDefinition = Struct.new(:namespace, :name, :qualified_name, :node, :location, :instance_methods, :class_methods, :included_modules, :extended_modules, :comments, :defined_files, :referenced_files) do
include MethodFinders
include RBSNamespaceHelpers
def initialize(
namesp... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/models/namespace_reopen.rb | app/models/namespace_reopen.rb | # frozen_string_literal: true
NamespaceReopen = Data.define(:path, :gem, :location) do
def initialize(path:, gem:, location: nil)
super
end
def relative_path
path.delete_prefix("#{gem.unpack_data_path}/")
end
def url(gem = nil)
Router.gem_version_file_path(gem.name, gem.version, relative_path)
... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/models/class_method.rb | app/models/class_method.rb | # frozen_string_literal: true
class ClassMethod < MethodDefinition
def url(gem)
if target.is_a?(ModuleDefinition)
Router.gem_version_module_class_method_path(gem.name, gem.version, target.qualified_name, name)
elsif target.is_a?(ClassDefinition)
Router.gem_version_class_class_method_path(gem.name... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/models/instance_method.rb | app/models/instance_method.rb | # frozen_string_literal: true
class InstanceMethod < MethodDefinition
def url(gem)
if target.is_a?(ModuleDefinition)
Router.gem_version_module_instance_method_path(gem.name, gem.version, target.qualified_name, name)
elsif target.is_a?(ClassDefinition)
Router.gem_version_class_instance_method_path... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/models/gem_spec.rb | app/models/gem_spec.rb | # frozen_string_literal: true
class GemSpec
def self.latest_version_for(name)
return nil if name.blank?
Gem.latest_spec_for(name).try(:version)
end
def self.find(name, version = nil)
return nil if name.nil?
version ||= latest_version_for(name)
return nil if version.nil?
info = Gems::... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/models/gem_search.rb | app/models/gem_search.rb | # frozen_string_literal: true
class GemSearch
def self.search(query)
return [] if query.blank?
Gems.search(query)
end
end
| ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/models/metadata.rb | app/models/metadata.rb | # frozen_string_literal: true
Metadata = Data.define(:files, :dependencies, :authors, :error) do
def initialize(files: [], dependencies: [], authors: [], error: nil)
super
end
end
| ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/models/concerns/rbs_namespace_helpers.rb | app/models/concerns/rbs_namespace_helpers.rb | # frozen_string_literal: true
module RBSNamespaceHelpers
def rbs_signature(gem, require_samples: true)
rbs_method_signatures = methods.map { |method| method.rbs_signature(gem, require_samples:) }.compact
return nil if rbs_method_signatures.empty?
rbs_superclass = (defined?(superclass) && superclass) ? ... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/models/concerns/rbs_helpers.rb | app/models/concerns/rbs_helpers.rb | # frozen_string_literal: true
module RBSHelpers
def rbs_signature(gem, require_samples: true)
return nil if require_samples && samples(gem).empty?
signature = "def #{class_method? ? 'self.' : ''}#{name}: (#{rbs_parameters(gem)}) -> #{rbs_return_value(gem)}"
if custom_types.any?
types = custom_typ... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/models/concerns/method_finders.rb | app/models/concerns/method_finders.rb | # frozen_string_literal: true
module MethodFinders
def methods
class_methods.sort_by(&:name) + instance_methods.sort_by(&:name)
end
def find_method(name)
find_class_method(name) || find_instance_method(name)
end
def find_method!(name)
find_method(name) || raise(GemConstantNotFoundError, "Couldn... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/models/types/sample.rb | app/models/types/sample.rb | # frozen_string_literal: true
class Types::Sample < ApplicationRecord
validates :gem_name, :gem_version, :method_name, :location, :type_fusion_version, :application_name, :source_ip, presence: true
# TODO: there are methods which don't have params.
# Currently `[]` is considerd invalid since [].blank? returns t... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/mailers/application_mailer.rb | app/mailers/application_mailer.rb | # frozen_string_literal: true
class ApplicationMailer < ActionMailer::Base
default from: "from@example.com"
layout "mailer"
end
| ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/channels/application_cable/channel.rb | app/channels/application_cable/channel.rb | # frozen_string_literal: true
module ApplicationCable
class Channel < ActionCable::Channel::Base
end
end
| ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/app/channels/application_cable/connection.rb | app/channels/application_cable/connection.rb | # frozen_string_literal: true
module ApplicationCable
class Connection < ActionCable::Connection::Base
end
end
| ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/db/seeds.rb | db/seeds.rb | # frozen_string_literal: true
# This file should ensure the existence of records required to run the application in every environment (production,
# development, test). The code here should be idempotent so that it can be executed at any point in every environment.
# The data can then be loaded with the bin/rails db:s... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/db/schema.rb | db/schema.rb | # This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# This file is the source Rails uses to define your schema when running `bin/rai... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/db/migrate/20231212112539_add_service_name_to_active_storage_blobs.active_storage.rb | db/migrate/20231212112539_add_service_name_to_active_storage_blobs.active_storage.rb | # frozen_string_literal: true
# This migration comes from active_storage (originally 20190112182829)
class AddServiceNameToActiveStorageBlobs < ActiveRecord::Migration[6.0]
def up
return unless table_exists?(:active_storage_blobs)
return if column_exists?(:active_storage_blobs, :service_name)
add_colum... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/db/migrate/20230825163543_change_types_sample_return_value_type.rb | db/migrate/20230825163543_change_types_sample_return_value_type.rb | # frozen_string_literal: true
class ChangeTypesSampleReturnValueType < ActiveRecord::Migration[7.0]
def change
reversible do |direction|
direction.up do
change_column :types_samples, :return_value, :jsonb, using: "to_json(return_value)"
end
direction.down do
change_column :type... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/db/migrate/20231212112540_create_active_storage_variant_records.active_storage.rb | db/migrate/20231212112540_create_active_storage_variant_records.active_storage.rb | # frozen_string_literal: true
# This migration comes from active_storage (originally 20191206030411)
class CreateActiveStorageVariantRecords < ActiveRecord::Migration[6.0]
def change
return unless table_exists?(:active_storage_blobs)
# Use Active Record's configured type for primary key
create_table :ac... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/db/migrate/20230813213022_create_types_samples.rb | db/migrate/20230813213022_create_types_samples.rb | # frozen_string_literal: true
class CreateTypesSamples < ActiveRecord::Migration[7.0]
def change
create_table :types_samples do |t|
t.string :gem_name
t.string :gem_version
t.string :receiver
t.string :method_name
t.string :location
t.string :type_fusion_version
t.string... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/db/migrate/20231212112541_remove_not_null_on_active_storage_blobs_checksum.active_storage.rb | db/migrate/20231212112541_remove_not_null_on_active_storage_blobs_checksum.active_storage.rb | # frozen_string_literal: true
# This migration comes from active_storage (originally 20211119233751)
class RemoveNotNullOnActiveStorageBlobsChecksum < ActiveRecord::Migration[6.0]
def change
return unless table_exists?(:active_storage_blobs)
change_column_null(:active_storage_blobs, :checksum, true)
end
e... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/db/migrate/20230815223413_add_return_value_to_types_samples.rb | db/migrate/20230815223413_add_return_value_to_types_samples.rb | # frozen_string_literal: true
class AddReturnValueToTypesSamples < ActiveRecord::Migration[7.0]
def change
add_column :types_samples, :return_value, :string
end
end
| ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/test/application_system_test_case.rb | test/application_system_test_case.rb | # frozen_string_literal: true
require "test_helper"
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
driven_by :selenium, using: :chrome, screen_size: [1400, 1400]
end
| ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/test/test_helper.rb | test/test_helper.rb | # frozen_string_literal: true
ENV["RAILS_ENV"] ||= "test"
require_relative "../config/environment"
require "rails/test_help"
FactoryBot.find_definitions
module ActiveSupport
class TestCase
# Run tests in parallel with specified workers
parallelize(workers: :number_of_processors)
# Setup all fixtures i... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
marcoroth/gem.sh | https://github.com/marcoroth/gem.sh/blob/8a4a44bdd857ea79114017608d73c5cd03c21dba/test/factories/types/sample.rb | test/factories/types/sample.rb | # frozen_string_literal: true
FactoryBot.define do
factory :type_sample, class: Types::Sample do
gem_name { "railties" }
gem_version { "7.0.6" }
receiver { "Rails" }
method_name { "env" }
parameters { [] }
return_value { "String" }
location { "/test/file.rb:123" }
application_name { ... | ruby | MIT | 8a4a44bdd857ea79114017608d73c5cd03c21dba | 2026-01-04T17:48:24.521520Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.