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
taylorthurlow/panda-motd
https://github.com/taylorthurlow/panda-motd/blob/d1cc6db9220243e83fbb1a2bbf91c6a143b9f559/spec/factories/motd_factory.rb
spec/factories/motd_factory.rb
# frozen_string_literal: true FactoryBot.define do factory :motd, class: MOTD do skip_create transient do components { [] } end config { association(:config, components: components) } initialize_with { new(config.file_path, false) } end end
ruby
MIT
d1cc6db9220243e83fbb1a2bbf91c6a143b9f559
2026-01-04T17:46:36.398098Z
false
taylorthurlow/panda-motd
https://github.com/taylorthurlow/panda-motd/blob/d1cc6db9220243e83fbb1a2bbf91c6a143b9f559/spec/factories/component_factories.rb
spec/factories/component_factories.rb
# frozen_string_literal: true Dir["#{PandaMOTD.root}/lib/panda_motd/components/**/*.rb"].each do |c| component_sym = File.basename(c, ".rb").to_sym klass = Config.component_classes[component_sym] FactoryBot.define do factory component_sym, class: klass do skip_create transient do settin...
ruby
MIT
d1cc6db9220243e83fbb1a2bbf91c6a143b9f559
2026-01-04T17:46:36.398098Z
false
taylorthurlow/panda-motd
https://github.com/taylorthurlow/panda-motd/blob/d1cc6db9220243e83fbb1a2bbf91c6a143b9f559/spec/components/ascii_text_art_spec.rb
spec/components/ascii_text_art_spec.rb
# frozen_string_literal: true require "spec_helper" require "colorize" describe ASCIITextArt do context "with normal config" do subject(:component) { create(:ascii_text_art) } it "prints the properly colored art" do stub_system_call(component, returns: "helloworld") component.process exp...
ruby
MIT
d1cc6db9220243e83fbb1a2bbf91c6a143b9f559
2026-01-04T17:46:36.398098Z
false
taylorthurlow/panda-motd
https://github.com/taylorthurlow/panda-motd/blob/d1cc6db9220243e83fbb1a2bbf91c6a143b9f559/spec/components/service_status_spec.rb
spec/components/service_status_spec.rb
# frozen_string_literal: true require "spec_helper" require "colorize" describe ServiceStatus do context "with normal config" do subject(:component) { create(:service_status) } it "returns the list of statuses" do stub_system_call(component, returns: "active") component.process expect(co...
ruby
MIT
d1cc6db9220243e83fbb1a2bbf91c6a143b9f559
2026-01-04T17:46:36.398098Z
false
taylorthurlow/panda-motd
https://github.com/taylorthurlow/panda-motd/blob/d1cc6db9220243e83fbb1a2bbf91c6a143b9f559/spec/components/fail_2_ban_spec.rb
spec/components/fail_2_ban_spec.rb
# frozen_string_literal: true require "spec_helper" describe Fail2Ban do context "with normal config" do subject(:component) { create(:fail_2_ban) } it "gets statistics" do stub_system_call(component) component.process expect(component.results[:jails]).to eq( "sshd" => { total: ...
ruby
MIT
d1cc6db9220243e83fbb1a2bbf91c6a143b9f559
2026-01-04T17:46:36.398098Z
false
taylorthurlow/panda-motd
https://github.com/taylorthurlow/panda-motd/blob/d1cc6db9220243e83fbb1a2bbf91c6a143b9f559/spec/components/uptime_spec.rb
spec/components/uptime_spec.rb
# frozen_string_literal: true require "spec_helper" describe Uptime do subject(:component) { create(:uptime) } let(:sysinfo) { instance_double("sysinfo") } context "when uptime is less than 1 day" do it "formats the uptime" do allow(SysInfo).to receive(:new).and_return(sysinfo) allow(sysinfo)....
ruby
MIT
d1cc6db9220243e83fbb1a2bbf91c6a143b9f559
2026-01-04T17:46:36.398098Z
false
taylorthurlow/panda-motd
https://github.com/taylorthurlow/panda-motd/blob/d1cc6db9220243e83fbb1a2bbf91c6a143b9f559/spec/components/ssl_certificates_spec.rb
spec/components/ssl_certificates_spec.rb
# frozen_string_literal: true require "spec_helper" require "colorize" describe SSLCertificates do context "with normal config" do subject(:component) { create(:ssl_certificates) } it "returns the list of certificates" do stub_system_call(component) allow(File).to receive(:exist?).and_return(tr...
ruby
MIT
d1cc6db9220243e83fbb1a2bbf91c6a143b9f559
2026-01-04T17:46:36.398098Z
false
taylorthurlow/panda-motd
https://github.com/taylorthurlow/panda-motd/blob/d1cc6db9220243e83fbb1a2bbf91c6a143b9f559/spec/components/last_login_spec.rb
spec/components/last_login_spec.rb
# frozen_string_literal: true require "spec_helper" describe LastLogin do context "with normal config" do subject(:component) { create(:last_login, settings: { "users" => { "taylor" => 4 } }) } it "returns the list of logins" do stub_system_call(component) component.process exp...
ruby
MIT
d1cc6db9220243e83fbb1a2bbf91c6a143b9f559
2026-01-04T17:46:36.398098Z
false
taylorthurlow/panda-motd
https://github.com/taylorthurlow/panda-motd/blob/d1cc6db9220243e83fbb1a2bbf91c6a143b9f559/spec/components/filesystems_spec.rb
spec/components/filesystems_spec.rb
# frozen_string_literal: true require "spec_helper" require "colorize" describe Filesystems do context "with normal config" do subject(:component) { create(:filesystems, settings: { "filesystems" => { "/dev/sda1" => "Ubuntu" }, }) } it "retu...
ruby
MIT
d1cc6db9220243e83fbb1a2bbf91c6a143b9f559
2026-01-04T17:46:36.398098Z
false
taylorthurlow/panda-motd
https://github.com/taylorthurlow/panda-motd/blob/d1cc6db9220243e83fbb1a2bbf91c6a143b9f559/spec/matchers/should_have_attr_reader.rb
spec/matchers/should_have_attr_reader.rb
# frozen_string_literal: true # :nocov: RSpec::Matchers.define :have_attr_reader do |field| match do |object_instance| object_instance.respond_to?(field) end failure_message do |object_instance| "expected attr_reader for #{field} on #{object_instance}" end failure_message_when_negated do |object_in...
ruby
MIT
d1cc6db9220243e83fbb1a2bbf91c6a143b9f559
2026-01-04T17:46:36.398098Z
false
taylorthurlow/panda-motd
https://github.com/taylorthurlow/panda-motd/blob/d1cc6db9220243e83fbb1a2bbf91c6a143b9f559/lib/panda_motd.rb
lib/panda_motd.rb
# frozen_string_literal: true require "require_all" require_rel "panda_motd" class PandaMOTD # Creates a new MOTD instance, assuming a config file has been passed as an # argument to the command. def self.new_motd if ARGV[0].nil? puts "You must provide a config file path as an argument to panda-motd."...
ruby
MIT
d1cc6db9220243e83fbb1a2bbf91c6a143b9f559
2026-01-04T17:46:36.398098Z
false
taylorthurlow/panda-motd
https://github.com/taylorthurlow/panda-motd/blob/d1cc6db9220243e83fbb1a2bbf91c6a143b9f559/lib/panda_motd/component_error.rb
lib/panda_motd/component_error.rb
# frozen_string_literal: true require "colorize" class ComponentError attr_reader :component, :message def initialize(component, message) @component = component @message = message end # Gets a printable error string in red. def to_s return "#{@component.name} error: ".red + @message.to_s end...
ruby
MIT
d1cc6db9220243e83fbb1a2bbf91c6a143b9f559
2026-01-04T17:46:36.398098Z
false
taylorthurlow/panda-motd
https://github.com/taylorthurlow/panda-motd/blob/d1cc6db9220243e83fbb1a2bbf91c6a143b9f559/lib/panda_motd/component.rb
lib/panda_motd/component.rb
# frozen_string_literal: true class Component attr_reader :name, :errors, :results, :config def initialize(motd, name) @name = name @motd = motd @config = motd.config.component_config(@name) @errors = [] end # Evaluates the component so that it has some meaningful output when it comes # tim...
ruby
MIT
d1cc6db9220243e83fbb1a2bbf91c6a143b9f559
2026-01-04T17:46:36.398098Z
false
taylorthurlow/panda-motd
https://github.com/taylorthurlow/panda-motd/blob/d1cc6db9220243e83fbb1a2bbf91c6a143b9f559/lib/panda_motd/version.rb
lib/panda_motd/version.rb
# frozen_string_literal: true class PandaMOTD #:nodoc: VERSION ||= "0.0.12" end
ruby
MIT
d1cc6db9220243e83fbb1a2bbf91c6a143b9f559
2026-01-04T17:46:36.398098Z
false
taylorthurlow/panda-motd
https://github.com/taylorthurlow/panda-motd/blob/d1cc6db9220243e83fbb1a2bbf91c6a143b9f559/lib/panda_motd/motd.rb
lib/panda_motd/motd.rb
# frozen_string_literal: true require "sysinfo" class MOTD attr_reader :config, :components # Creates an MOTD by parsing the provided config file, and processing each # component. # # @param config_path [String] The path to the configuration file. If not # provided, the default config path will be used...
ruby
MIT
d1cc6db9220243e83fbb1a2bbf91c6a143b9f559
2026-01-04T17:46:36.398098Z
false
taylorthurlow/panda-motd
https://github.com/taylorthurlow/panda-motd/blob/d1cc6db9220243e83fbb1a2bbf91c6a143b9f559/lib/panda_motd/config.rb
lib/panda_motd/config.rb
# frozen_string_literal: true require "yaml" require "fileutils" class Config attr_reader :file_path # @param file_path [String] The file path to look for the configuration file. # If not provided, the default file path will be used. def initialize(file_path = nil) @file_path = file_path || File.join(D...
ruby
MIT
d1cc6db9220243e83fbb1a2bbf91c6a143b9f559
2026-01-04T17:46:36.398098Z
false
taylorthurlow/panda-motd
https://github.com/taylorthurlow/panda-motd/blob/d1cc6db9220243e83fbb1a2bbf91c6a143b9f559/lib/panda_motd/components/ssl_certificates.rb
lib/panda_motd/components/ssl_certificates.rb
# frozen_string_literal: true require "date" class SSLCertificates < Component def initialize(motd) super(motd, "ssl_certificates") end # @see Component#process def process @certs = @config["certs"] @results = cert_dates(@certs) end # Prints the list of SSL certificates with their statuses. ...
ruby
MIT
d1cc6db9220243e83fbb1a2bbf91c6a143b9f559
2026-01-04T17:46:36.398098Z
false
taylorthurlow/panda-motd
https://github.com/taylorthurlow/panda-motd/blob/d1cc6db9220243e83fbb1a2bbf91c6a143b9f559/lib/panda_motd/components/uptime.rb
lib/panda_motd/components/uptime.rb
# frozen_string_literal: true require "sysinfo" class Uptime < Component attr_reader :days, :hours, :minutes def initialize(motd) super(motd, "uptime") end # Calculates the number of days, hours, and minutes based on the current # uptime value. # # @see Component#process def process uptime =...
ruby
MIT
d1cc6db9220243e83fbb1a2bbf91c6a143b9f559
2026-01-04T17:46:36.398098Z
false
taylorthurlow/panda-motd
https://github.com/taylorthurlow/panda-motd/blob/d1cc6db9220243e83fbb1a2bbf91c6a143b9f559/lib/panda_motd/components/ascii_text_art.rb
lib/panda_motd/components/ascii_text_art.rb
# frozen_string_literal: true require "artii" require "colorize" class ASCIITextArt < Component def initialize(motd) super(motd, "ascii_text_art") end def process @text = `#{@config["command"]}` @art = Artii::Base.new font: @config["font"] @results = @art.asciify(@text) @results = @results....
ruby
MIT
d1cc6db9220243e83fbb1a2bbf91c6a143b9f559
2026-01-04T17:46:36.398098Z
false
taylorthurlow/panda-motd
https://github.com/taylorthurlow/panda-motd/blob/d1cc6db9220243e83fbb1a2bbf91c6a143b9f559/lib/panda_motd/components/filesystems.rb
lib/panda_motd/components/filesystems.rb
# frozen_string_literal: true require "ruby-units" require "colorize" class Filesystems < Component def initialize(motd) super(motd, "filesystems") end def process @results = parse_filesystem_usage(@config["filesystems"]) end def to_s name_col_size = @results.select { |r| r.is_a? Hash } ...
ruby
MIT
d1cc6db9220243e83fbb1a2bbf91c6a143b9f559
2026-01-04T17:46:36.398098Z
false
taylorthurlow/panda-motd
https://github.com/taylorthurlow/panda-motd/blob/d1cc6db9220243e83fbb1a2bbf91c6a143b9f559/lib/panda_motd/components/fail_2_ban.rb
lib/panda_motd/components/fail_2_ban.rb
# frozen_string_literal: true class Fail2Ban < Component def initialize(motd) super(motd, "fail_2_ban") end def process @results = { jails: {}, } @config["jails"].each do |jail| status = jail_status(jail) @results[:jails][jail] = { total: status[:total], curren...
ruby
MIT
d1cc6db9220243e83fbb1a2bbf91c6a143b9f559
2026-01-04T17:46:36.398098Z
false
taylorthurlow/panda-motd
https://github.com/taylorthurlow/panda-motd/blob/d1cc6db9220243e83fbb1a2bbf91c6a143b9f559/lib/panda_motd/components/service_status.rb
lib/panda_motd/components/service_status.rb
# frozen_string_literal: true require "colorize" class ServiceStatus < Component def initialize(motd) super(motd, "service_status") end # @see Component#process def process @services = @config["services"] @results = parse_services(@services) end # Gets a printable string to be printed in the...
ruby
MIT
d1cc6db9220243e83fbb1a2bbf91c6a143b9f559
2026-01-04T17:46:36.398098Z
false
taylorthurlow/panda-motd
https://github.com/taylorthurlow/panda-motd/blob/d1cc6db9220243e83fbb1a2bbf91c6a143b9f559/lib/panda_motd/components/last_login.rb
lib/panda_motd/components/last_login.rb
# frozen_string_literal: true require "date" class LastLogin < Component def initialize(motd) super(motd, "last_login") end # @see Component#process def process @users = @config["users"] @results = parse_last_logins end # @see Component#to_s def to_s <<~HEREDOC Last Login: ...
ruby
MIT
d1cc6db9220243e83fbb1a2bbf91c6a143b9f559
2026-01-04T17:46:36.398098Z
false
eggcaker/jekyll-org
https://github.com/eggcaker/jekyll-org/blob/a49fb272b64c063ba11cb3334f73df7c85c12b77/spec/helper.rb
spec/helper.rb
require 'jekyll' require File.expand_path('../lib/jekyll-org', File.dirname(__FILE__)) Jekyll.logger.log_level = :error RSpec.configure do |config| config.run_all_when_everything_filtered = true config.filter_run :focus config.order = 'random' SOURCE_DIR = File.expand_path("../fixtures", __FILE__) DEST_DIR...
ruby
MIT
a49fb272b64c063ba11cb3334f73df7c85c12b77
2026-01-04T17:46:40.336272Z
false
eggcaker/jekyll-org
https://github.com/eggcaker/jekyll-org/blob/a49fb272b64c063ba11cb3334f73df7c85c12b77/spec/test_jekyll-org.rb
spec/test_jekyll-org.rb
require 'helper' describe("should working with unit test") do it "added some test cases" do end end
ruby
MIT
a49fb272b64c063ba11cb3334f73df7c85c12b77
2026-01-04T17:46:40.336272Z
false
eggcaker/jekyll-org
https://github.com/eggcaker/jekyll-org/blob/a49fb272b64c063ba11cb3334f73df7c85c12b77/lib/jekyll-org.rb
lib/jekyll-org.rb
if Jekyll::VERSION < '3.0' raise Jekyll::FatalException, 'This version of jekyll-org is only compatible with Jekyll v3 and above.' end require_relative './jekyll-org/converter' module Jekyll module Filters def orgify(input) site = @context.registers[:site] converter = site.find_converter_inst...
ruby
MIT
a49fb272b64c063ba11cb3334f73df7c85c12b77
2026-01-04T17:46:40.336272Z
false
eggcaker/jekyll-org
https://github.com/eggcaker/jekyll-org/blob/a49fb272b64c063ba11cb3334f73df7c85c12b77/lib/jekyll-org/converter.rb
lib/jekyll-org/converter.rb
require 'csv' require 'org-ruby' require_relative './utils' module Jekyll module Converters class Org < Converter include Jekyll::OrgUtils safe true priority :low # true if current file is an org file def self.matches(ext) ext =~ /org/i end # matches, but ...
ruby
MIT
a49fb272b64c063ba11cb3334f73df7c85c12b77
2026-01-04T17:46:40.336272Z
false
eggcaker/jekyll-org
https://github.com/eggcaker/jekyll-org/blob/a49fb272b64c063ba11cb3334f73df7c85c12b77/lib/jekyll-org/utils.rb
lib/jekyll-org/utils.rb
module Jekyll module OrgUtils def self.site @@site ||= Jekyll.configuration({}) end def self.org_config site["org"] || Hash.new() end def site OrgUtils.site end def org_config OrgUtils.org_config end end end
ruby
MIT
a49fb272b64c063ba11cb3334f73df7c85c12b77
2026-01-04T17:46:40.336272Z
false
beenhero/omniauth-weibo-oauth2
https://github.com/beenhero/omniauth-weibo-oauth2/blob/5ef094fe0e264a98e99055bae958f55c17638786/lib/omniauth-weibo-oauth2.rb
lib/omniauth-weibo-oauth2.rb
require "omniauth-weibo-oauth2/version" require 'omniauth/strategies/weibo'
ruby
MIT
5ef094fe0e264a98e99055bae958f55c17638786
2026-01-04T17:46:39.390113Z
false
beenhero/omniauth-weibo-oauth2
https://github.com/beenhero/omniauth-weibo-oauth2/blob/5ef094fe0e264a98e99055bae958f55c17638786/lib/omniauth-weibo-oauth2/version.rb
lib/omniauth-weibo-oauth2/version.rb
module OmniAuth module WeiboOauth2 VERSION = "0.5.3" end end
ruby
MIT
5ef094fe0e264a98e99055bae958f55c17638786
2026-01-04T17:46:39.390113Z
false
beenhero/omniauth-weibo-oauth2
https://github.com/beenhero/omniauth-weibo-oauth2/blob/5ef094fe0e264a98e99055bae958f55c17638786/lib/omniauth/strategies/weibo.rb
lib/omniauth/strategies/weibo.rb
require "omniauth-oauth2" module OmniAuth module Strategies class Weibo < OmniAuth::Strategies::OAuth2 option :client_options, { :site => "https://api.weibo.com", :authorize_url => "/oauth2/authorize", :token_url => "/oauth2/access_token", :token_method => :p...
ruby
MIT
5ef094fe0e264a98e99055bae958f55c17638786
2026-01-04T17:46:39.390113Z
false
codykrieger/ace-rails-ap
https://github.com/codykrieger/ace-rails-ap/blob/d28a3e929b7d4b0fb842afb1fdef024a752fca1a/lib/ace-rails-ap.rb
lib/ace-rails-ap.rb
require 'ace/rails'
ruby
MIT
d28a3e929b7d4b0fb842afb1fdef024a752fca1a
2026-01-04T17:46:18.855250Z
false
codykrieger/ace-rails-ap
https://github.com/codykrieger/ace-rails-ap/blob/d28a3e929b7d4b0fb842afb1fdef024a752fca1a/lib/ace/rails.rb
lib/ace/rails.rb
module Ace module Rails if ::Rails.version < "3.1" # no dice! else require 'ace/rails/engine' end require "ace/rails/version" end end
ruby
MIT
d28a3e929b7d4b0fb842afb1fdef024a752fca1a
2026-01-04T17:46:18.855250Z
false
codykrieger/ace-rails-ap
https://github.com/codykrieger/ace-rails-ap/blob/d28a3e929b7d4b0fb842afb1fdef024a752fca1a/lib/ace/rails/version.rb
lib/ace/rails/version.rb
module Ace module Rails VERSION = "4.5" end end
ruby
MIT
d28a3e929b7d4b0fb842afb1fdef024a752fca1a
2026-01-04T17:46:18.855250Z
false
codykrieger/ace-rails-ap
https://github.com/codykrieger/ace-rails-ap/blob/d28a3e929b7d4b0fb842afb1fdef024a752fca1a/lib/ace/rails/engine.rb
lib/ace/rails/engine.rb
module Ace module Rails mattr_accessor :include_modes class Engine < ::Rails::Engine initializer 'ace-rails-ap.assets.precompile' do |app| app.config.assets.precompile += if Ace::Rails.include_modes.present? Ace::Rails.include_modes.each_with_object([]) { |mode, assets| ...
ruby
MIT
d28a3e929b7d4b0fb842afb1fdef024a752fca1a
2026-01-04T17:46:18.855250Z
false
twopoint718/reactive_record
https://github.com/twopoint718/reactive_record/blob/0d688eeeb508933d239e00ed3740dc5b93160720/spec/reactive_record_spec.rb
spec/reactive_record_spec.rb
require 'rspec' require_relative '../lib/reactive_record' include ReactiveRecord describe 'ReactiveRecord' do before :all do # db setup @dbname = "reactive_record_test_#{Process.pid}" # N.B. all reactive_record methods are read only and so I believe # that it is valid to share a db connection. Noth...
ruby
MIT
0d688eeeb508933d239e00ed3740dc5b93160720
2026-01-04T17:46:45.928007Z
false
twopoint718/reactive_record
https://github.com/twopoint718/reactive_record/blob/0d688eeeb508933d239e00ed3740dc5b93160720/spec/parser_spec.rb
spec/parser_spec.rb
require 'rspec' require_relative '../lib/lexer.rb' require_relative '../lib/parser.rb' require_relative '../lib/code_generator.rb' describe ConstraintParser::Parser do let(:lex){ConstraintParser::Lexer} let(:par){ConstraintParser::Parser} it 'CHECK ()' do @parser = par.new(lex.new StringIO.new 'CHECK ()') ...
ruby
MIT
0d688eeeb508933d239e00ed3740dc5b93160720
2026-01-04T17:46:45.928007Z
false
twopoint718/reactive_record
https://github.com/twopoint718/reactive_record/blob/0d688eeeb508933d239e00ed3740dc5b93160720/spec/lexer_spec.rb
spec/lexer_spec.rb
require 'rspec' require_relative '../lib/lexer.rb' describe ConstraintParser::Lexer do let(:lex){ConstraintParser::Lexer} it "CHECK (((email)::text ~~ '%@bendyworks.com'::text))" do @lex = lex.new \ StringIO.new "CHECK (((email)::text ~~ '%@bendyworks.com'::text))" @lex.tokenize.should == [ [:...
ruby
MIT
0d688eeeb508933d239e00ed3740dc5b93160720
2026-01-04T17:46:45.928007Z
false
twopoint718/reactive_record
https://github.com/twopoint718/reactive_record/blob/0d688eeeb508933d239e00ed3740dc5b93160720/lib/parser.rb
lib/parser.rb
# # DO NOT MODIFY!!!! # This file is automatically generated by Racc 1.4.9 # from Racc grammer file "". # require 'racc/parser.rb' module ConstraintParser class Parser < Racc::Parser require 'lexer' require 'code_generator' def initialize tokenizer, handler = nil @tokenizer = tokenizer super() end...
ruby
MIT
0d688eeeb508933d239e00ed3740dc5b93160720
2026-01-04T17:46:45.928007Z
false
twopoint718/reactive_record
https://github.com/twopoint718/reactive_record/blob/0d688eeeb508933d239e00ed3740dc5b93160720/lib/reactive_record.rb
lib/reactive_record.rb
require_relative "./reactive_record/version" require 'pg' require 'active_support/inflector' require 'parser' module ReactiveRecord def model_definition db, table_name header = "class #{table_name.classify.pluralize} < ActiveRecord::Base\n" footer = "end\n" body = [] body << "set_table_name '#{tabl...
ruby
MIT
0d688eeeb508933d239e00ed3740dc5b93160720
2026-01-04T17:46:45.928007Z
false
twopoint718/reactive_record
https://github.com/twopoint718/reactive_record/blob/0d688eeeb508933d239e00ed3740dc5b93160720/lib/lexer.rb
lib/lexer.rb
require 'strscan' module ConstraintParser class Lexer AND = /AND/ CASCADE = /CASCADE/ CHECK = /CHECK/ COMMA = /,/ DELETE = /DELETE/ EQ = /\=/ FOREIGN_KEY = /FOREIGN KEY/ GT = /\>/ GTEQ = /\>=/ IDENT = /[a-zA-Z][a-zA-Z...
ruby
MIT
0d688eeeb508933d239e00ed3740dc5b93160720
2026-01-04T17:46:45.928007Z
false
twopoint718/reactive_record
https://github.com/twopoint718/reactive_record/blob/0d688eeeb508933d239e00ed3740dc5b93160720/lib/code_generator.rb
lib/code_generator.rb
class Node def initialize val, *args @value = val @children = args end def gen raise "gen is not implemented: #{self}" end def column 'base' end end class UniqueNode < Node def initialize val; super(val, nil); end def gen "validates :#{@value.gen}, uniqueness: true" end end cl...
ruby
MIT
0d688eeeb508933d239e00ed3740dc5b93160720
2026-01-04T17:46:45.928007Z
false
twopoint718/reactive_record
https://github.com/twopoint718/reactive_record/blob/0d688eeeb508933d239e00ed3740dc5b93160720/lib/reactive_record/version.rb
lib/reactive_record/version.rb
module ReactiveRecord VERSION = "0.0.4" end
ruby
MIT
0d688eeeb508933d239e00ed3740dc5b93160720
2026-01-04T17:46:45.928007Z
false
twopoint718/reactive_record
https://github.com/twopoint718/reactive_record/blob/0d688eeeb508933d239e00ed3740dc5b93160720/lib/generators/reactive_record/install_generator.rb
lib/generators/reactive_record/install_generator.rb
require "reactive_record" module ReactiveRecord module Generators class InstallGenerator < Rails::Generators::Base include ReactiveRecord desc "Adds models based upon your existing Postgres DB" def create_models db_env = Rails.configuration.database_configuration[Rails.env] ra...
ruby
MIT
0d688eeeb508933d239e00ed3740dc5b93160720
2026-01-04T17:46:45.928007Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/jobs/yard_copy_assets_job.rb
app/jobs/yard_copy_assets_job.rb
class YARDCopyAssetsJob < ApplicationJob queue_as :default def perform # Copy static assets from the yard to the public directory Rails.logger.info "YARD: Copying static system files..." YARD::Templates::Engine.template(:default, :fulldoc, :html).full_paths.each do |path| %w[css js images].each d...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/jobs/generate_docs_job.rb
app/jobs/generate_docs_job.rb
class GenerateDocsJob < ApplicationJob limits_concurrency to: 1, key: ->(lv) { lv.to_s }, duration: 5.minutes include ShellHelper extend ShellHelper queue_as :docparse @prepare_mutex = Mutex.new IMAGE = "docmeta/rubydoc-docparse" attr_accessor :library_version def perform(library_version) ensure...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/jobs/source_cleaner_job.rb
app/jobs/source_cleaner_job.rb
class SourceCleanerJob < ApplicationJob queue_as :default attr_accessor :basepath def perform(library_version) return if skip?(library_version) self.basepath = library_version.source_path clean end private def skip?(library_version) skip = case library_version.source.to_sym when :fe...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/jobs/register_libraries_job.rb
app/jobs/register_libraries_job.rb
class RegisterLibrariesJob < ApplicationJob queue_as :default def perform(library_version = nil) find_github(library_version) find_stdlib if library_version.nil? end def find_github(library_version = nil) logger.info "Registering GitHub libraries (#{library_version&.name || "all"})" (library_v...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/jobs/update_remote_gems_list_job.rb
app/jobs/update_remote_gems_list_job.rb
class UpdateRemoteGemsListJob < ApplicationJob limits_concurrency to: 1, key: "updated_gems", duration: 5.minutes queue_as :update_gems def self.clear_lock_file lock_file.delete rescue nil end def self.locked? lock_file.exist? end def self.lock_file @lock_file ||= Rubydoc.storage_path.join(...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/jobs/cache_clear_job.rb
app/jobs/cache_clear_job.rb
require "net/http" require "net/http/persistent" class CacheClearJob < ApplicationJob queue_as :default def perform(*paths) clear_from_cloudflare(*paths) end private def clear_from_cloudflare(*paths) return unless cloudflare_token [ cloudflare_zones ].flatten.compact.each do |zone| uri =...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/jobs/reap_generate_docs_job.rb
app/jobs/reap_generate_docs_job.rb
class ReapGenerateDocsJob < ApplicationJob queue_as :default def perform running_containers.each do |id, created_at| if created_at < 10.minutes.ago logger.info "Stopping DEAD container #{id} (created at #{created_at})" `docker rm -f #{id}` end end end private def running...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/jobs/application_job.rb
app/jobs/application_job.rb
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
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/jobs/delete_docs_job.rb
app/jobs/delete_docs_job.rb
class DeleteDocsJob < ApplicationJob queue_as :default def perform(library_version) # Make sure library version still has not been accessed since this job was queued return unless CleanupUnvisitedDocsJob.should_invalidate?(library_version.source_path) unregister_library(library_version) remove_dir...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/jobs/cleanup_unvisited_docs_job.rb
app/jobs/cleanup_unvisited_docs_job.rb
class CleanupUnvisitedDocsJob < ApplicationJob queue_as :default INVALIDATES_AT = 1.week.ago def self.should_invalidate?(directory) Pathname.new(directory).mtime < INVALIDATES_AT end def perform cleanup_github cleanup_gems end private def cleanup_github logger.info "Cleaning up unvi...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/jobs/github_checkout_job.rb
app/jobs/github_checkout_job.rb
require "open-uri" require "shellwords" class GithubCheckoutJob < ApplicationJob include ShellHelper queue_as :default attr_accessor :owner, :project, :commit, :library_version def commit=(value) value = nil if value == "" if value value = value[0, 6] if value.length == 40 value = value[/...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/jobs/download_gem_job.rb
app/jobs/download_gem_job.rb
require "open-uri" require "rubygems/package" require "rubygems/package/tar_reader" class DownloadGemJob < ApplicationJob queue_as :default def perform(library_version) return if disallowed?(library_version) return if library_version.ready? # Remote gemfile from rubygems.org suffix = library_vers...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/serializers/library_version_serializer.rb
app/serializers/library_version_serializer.rb
class LibraryVersionSerializer < ActiveJob::Serializers::ObjectSerializer def serialize(library_version) super("marshal" => Marshal.dump(library_version)) end def deserialize(data) Marshal.load(data["marshal"]) end def klass YARD::Server::LibraryVersion end end
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/helpers/shell_helper.rb
app/helpers/shell_helper.rb
module ShellHelper def sh(command, title: nil, show_output: false, raise_error: true) title ||= command logger.info("#{title}: #{command}") if raise_error result, out_data, err_data = 0, "", "" Open3.popen3(command) do |_, out, err, thr| out_data, err_data, result = out.read, err.read...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/helpers/application_helper.rb
app/helpers/application_helper.rb
module ApplicationHelper LIBRARY_TYPES = { featured: "Gem", stdlib: "Standard Library", gems: "Gem", github: "GitHub repository" }.freeze LIBRARY_ALT_TYPES = { featured: "Gem", stdlib: "Standard Library", gems: "Gem", github: "GitHub Project" }.freeze HAS_SEARCH = Set.new(%w[...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/controllers/help_controller.rb
app/controllers/help_controller.rb
class HelpController < ApplicationController layout "modal" def index @no_margin = true end end
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/controllers/rubygems_webhook_controller.rb
app/controllers/rubygems_webhook_controller.rb
class RubygemsWebhookController < ApplicationController def create if settings.integrations.rubygems.blank? logger.error "RubyGems integration not configured, failing webhook request" render status: :unauthorized return end data = JSON.parse(request.body.read || "{}") authorization...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/controllers/github_controller.rb
app/controllers/github_controller.rb
class GithubController < ApplicationController include AlphaIndexable include Searchable include Pageable include Cacheable layout "modal", only: [ :add_project, :create ] prepend_before_action do @title = "GitHub Projects" # Select only needed columns to reduce memory usage @collection = Libr...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/controllers/yard_controller.rb
app/controllers/yard_controller.rb
class YARDController < ApplicationController include Skylight::Helpers layout "yard" ADAPTERS = { featured: { store: LibraryStore::FeaturedStore, router: LibraryRouter::FeaturedRouter }, stdlib: { store: LibraryStore::StdlibStore, router: LibraryRouter::StdlibRouter }, gems: { store: LibraryStore::Ge...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/controllers/gems_controller.rb
app/controllers/gems_controller.rb
class GemsController < ApplicationController include AlphaIndexable include Searchable include Pageable include Cacheable prepend_before_action do @title = "RubyGems" # Select only needed columns to reduce memory usage @collection = Library.allowed_gem.select(:id, :name, :source, :owner, :version...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/controllers/github_webhook_controller.rb
app/controllers/github_webhook_controller.rb
class GithubWebhookController < ApplicationController def create data = JSON.parse(request.body.read || "{}") payload = data.has_key?("payload") ? data["payload"] : data url = (payload["repository"] || {})["url"] commit = (payload["repository"] || {})["commit"] @project = GithubProject.new(url:, c...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/controllers/stdlib_controller.rb
app/controllers/stdlib_controller.rb
class StdlibController < ApplicationController include Cacheable prepend_before_action do @title = "Ruby Standard Library" @page_title = @title @collection = Library.stdlib.all end def index render "shared/library_list" end end
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/controllers/errors_controller.rb
app/controllers/errors_controller.rb
class ErrorsController < ApplicationController VALID_STATUS_CODES = %w[400 404 406 422 500].freeze def self.constraints { code: Regexp.new(VALID_STATUS_CODES.join("|")) } end def show status_code = VALID_STATUS_CODES.include?(params[:code]) ? params[:code] : 500 respond_to do |format| format...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/controllers/about_controller.rb
app/controllers/about_controller.rb
class AboutController < ApplicationController layout "modal" end
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/controllers/featured_controller.rb
app/controllers/featured_controller.rb
class FeaturedController < ApplicationController include Cacheable include ApplicationHelper prepend_before_action do @title = "Featured Libraries" @page_title = @title @collection = featured_libraries end def index render "shared/library_list" end end
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/controllers/application_controller.rb
app/controllers/application_controller.rb
class ApplicationController < ActionController::Base skip_forgery_protection end
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/controllers/concerns/pageable.rb
app/controllers/concerns/pageable.rb
module Pageable extend ActiveSupport::Concern PAGE_SIZE = 100 included do before_action :set_pagination end def set_pagination @page = params[:page]&.to_i || 1 @total_pages = (@collection.except(:select).count / PAGE_SIZE.to_f).ceil @collection = @collection.offset((@page - 1) * PAGE_SIZE)....
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/controllers/concerns/searchable.rb
app/controllers/concerns/searchable.rb
module Searchable extend ActiveSupport::Concern included do before_action :load_search_query, if: -> { params[:q].present? } end def load_search_query @search = params[:q] @page_description = "#{@title} Search Results for '#{h @search}'" @exact_match = @collection.dup.where("lower(name) = ?", ...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/controllers/concerns/alpha_indexable.rb
app/controllers/concerns/alpha_indexable.rb
module AlphaIndexable extend ActiveSupport::Concern included do before_action :set_alpha_index end def set_alpha_index @has_alpha_index = true @letter = params[:letter] || default_alpha_index @page_title = "#{@title} Index: #{@letter.upcase}" if @letter.present? set_alpha_index_collection ...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/controllers/concerns/cacheable.rb
app/controllers/concerns/cacheable.rb
module Cacheable extend ActiveSupport::Concern included do before_action :set_cache_headers end private def set_cache_headers expires_in 1.day, public: true end end
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/models/library.rb
app/models/library.rb
class Library < ApplicationRecord enum :source, %i[remote_gem github stdlib featured].index_with(&:to_s) default_scope { order("lower(name) ASC") } scope :gem, -> { where(source: :remote_gem) } scope :github, -> { where(source: :github) } scope :stdlib, -> { where(source: :stdlib) } scope :allowed_gem, -> ...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/models/stdlib_installer.rb
app/models/stdlib_installer.rb
class StdlibInstaller PREFIX = StdlibLibrary.base_path.to_s attr_accessor :path, :version def initialize(version) self.version = version setup_ruby_clone self.path = ruby_root.to_s end def ruby_root @ruby_root ||= Rubydoc.storage_path.join("ruby") end def setup_ruby_clone system "g...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/models/application_record.rb
app/models/application_record.rb
class ApplicationRecord < ActiveRecord::Base primary_abstract_class end
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/models/github_project.rb
app/models/github_project.rb
class GithubProject include ActiveModel::API attr_accessor :url, :commit validates_format_of :url, with: %r{\Ahttps://github.com/[a-z0-9\-_\.]+/[a-z0-9\-_\.]+\z}i validates_format_of :commit, with: /\A[0-9a-z_\.-]{1,40}\z/i, allow_blank: true def owner path.first end def name path.second end ...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/models/disallowed_checkout_error.rb
app/models/disallowed_checkout_error.rb
class DisallowedCheckoutError < StandardError def initialize(owner:, project:) super("Invalid checkout for #{owner}/#{project}") end end
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/models/concerns/stdlib_library.rb
app/models/concerns/stdlib_library.rb
module StdlibLibrary extend ActiveSupport::Concern def load_yardoc_from_stdlib return if ready? GenerateDocsJob.perform_later(self) raise YARD::Server::LibraryNotPreparedError end def source_path_for_stdlib StdlibLibrary.base_path.join(name, version).to_s end def yardoc_file_for_stdlib ...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/models/concerns/featured_library.rb
app/models/concerns/featured_library.rb
module FeaturedLibrary extend ActiveSupport::Concern def load_yardoc_from_featured return if ready? GenerateDocsJob.perform_later(self) raise YARD::Server::LibraryNotPreparedError end def source_path_for_featured FeaturedLibrary.base_path.join(name, version).to_s end def yardoc_file_for_...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/models/concerns/github_library.rb
app/models/concerns/github_library.rb
module GithubLibrary extend ActiveSupport::Concern def load_yardoc_from_github return if ready? GenerateDocsJob.perform_later(self) raise YARD::Server::LibraryNotPreparedError end def source_path_for_github GithubLibrary.base_path.join(name.split("/", 2).reverse.join("/"), version).to_s end...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/models/concerns/gem_library.rb
app/models/concerns/gem_library.rb
module GemLibrary extend ActiveSupport::Concern def load_yardoc_from_remote_gem return if ready? GenerateDocsJob.perform_later(self) raise YARD::Server::LibraryNotPreparedError end def source_path_for_remote_gem GemLibrary.base_path.join(name[0].downcase, name, version).to_s end def yard...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/models/concerns/disallowed_library.rb
app/models/concerns/disallowed_library.rb
module DisallowedLibrary extend ActiveSupport::Concern def disallowed? disallowed_list.any? { |disallowed_name| wilcard_match?(name, disallowed_name) } end def disallowed_list [] end def wilcard_match?(name, disallowed_name) return true if name == disallowed_name return true if disallowed...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/models/library_router/github_router.rb
app/models/library_router/github_router.rb
module LibraryRouter class GithubRouter < YARD::Server::Router def docs_prefix; "github" end def list_prefix; "list/github" end def search_prefix; "search/github" end def static_prefix; "static/github" end def parse_library_from_path(paths) library, paths = nil, paths.dup github_proj ...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/models/library_router/stdlib_router.rb
app/models/library_router/stdlib_router.rb
module LibraryRouter class StdlibRouter < YARD::Server::Router def docs_prefix; "stdlib" end def list_prefix; "list/stdlib" end def search_prefix; "search/stdlib" end def static_prefix; "static/stdlib" end end end
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/models/library_router/featured_router.rb
app/models/library_router/featured_router.rb
module LibraryRouter class FeaturedRouter < YARD::Server::Router def docs_prefix; "docs" end def list_prefix; "list/docs" end def search_prefix; "search/docs" end def static_prefix; "static/docs" end end end
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/models/library_router/gem_router.rb
app/models/library_router/gem_router.rb
module LibraryRouter class GemRouter < YARD::Server::Router def docs_prefix; "gems" end def list_prefix; "list/gems" end def search_prefix; "search/gems" end def static_prefix; "static/gems" end end end
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/models/library_store/github_store.rb
app/models/library_store/github_store.rb
module LibraryStore class GithubStore include Enumerable def [](name) (@items ||= {})[name] ||= begin parts = parse_name(name) Library.allowed_github.find_by(owner: parts.first, name: parts.last)&.library_versions end end def []=(name, versions) # read-only access ...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/models/library_store/stdlib_store.rb
app/models/library_store/stdlib_store.rb
module LibraryStore class StdlibStore include Enumerable def base_path @base_path ||= StdlibLibrary.base_path.to_s end def [](name) versions = Dir.glob(File.join(base_path, name, "*")).map { |path| File.basename(path) } VersionSorter.sort(versions).map do |version| YARD::Se...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/models/library_store/gem_store.rb
app/models/library_store/gem_store.rb
module LibraryStore class GemStore include Enumerable def [](name) (@items ||= {})[name] ||= scope.find_by(name: name)&.library_versions end def []=(name, versions) # read-only access end def has_key?(name) scope.exists?(name: name) end def each(&block) scope.all.each { |lib...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/app/models/library_store/featured_store.rb
app/models/library_store/featured_store.rb
module LibraryStore class FeaturedStore include Enumerable def [](name) (@items ||= {})[name] ||= case Rubydoc.config.libraries.featured[name] when "gem" Library.gem.find_by(name: name)&.library_versions when "featured" versions = FeaturedLibrary.versions_for(name) L...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/docker/docparse/generate.rb
docker/docparse/generate.rb
#!/usr/bin/env ruby require 'shellwords' if File.exist?('.yardopts') args = Shellwords.split(File.read('.yardopts').gsub(/^[ \t]*#.+/m, '')) args.each_with_index do |arg, i| next unless arg == '--plugin' next unless args[i + 1] cmd = "gem install --user-install yard-#{args[i + 1].inspect}" puts "[...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/db/seeds.rb
db/seeds.rb
# 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:seed command (or created alongsi...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/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
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/db/migrate/20250426212855_create_libraries.rb
db/migrate/20250426212855_create_libraries.rb
class CreateLibraries < ActiveRecord::Migration[8.0] def change create_table :libraries do |t| t.string :name t.string :source t.string :owner t.boolean :primary_fork, default: true t.json :versions t.timestamps end add_index :libraries, [ :name, :source, :owner ], uni...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/db/migrate/20251201000001_add_lower_name_index_to_libraries.rb
db/migrate/20251201000001_add_lower_name_index_to_libraries.rb
class AddLowerNameIndexToLibraries < ActiveRecord::Migration[8.0] def change # Add a functional index for efficient alphabetical filtering # This improves the LIKE 'a%' queries used in AlphaIndexable concern add_index :libraries, "lower(name) varchar_pattern_ops", name: "index_libraries_on_lower_name_patt...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/db/migrate/20250425155411_add_solid.rb
db/migrate/20250425155411_add_solid.rb
class AddSolid < ActiveRecord::Migration[8.0] def change create_table "solid_cache_entries", force: :cascade do |t| t.binary "key", limit: 1024, null: false t.binary "value", limit: 536870912, null: false t.datetime "created_at", null: false t.integer "key_hash", limit: 8, null: false ...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/spec/rails_helper.rb
spec/rails_helper.rb
# This file is copied to spec/ when you run 'rails generate rspec:install' require 'spec_helper' ENV['RAILS_ENV'] ||= 'test' require_relative '../config/environment' # Prevent database truncation if the environment is production abort("The Rails environment is running in production mode!") if Rails.env.production? # Un...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/spec/spec_helper.rb
spec/spec_helper.rb
# This file was generated by the `rails generate rspec:install` command. Conventionally, all # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. # The generated `.rspec` file contains `--require spec_helper` which will cause # this file to always be loaded, without a need to explicitly require ...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false