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 |
|---|---|---|---|---|---|---|---|---|
fastruby/rails_stats | https://github.com/fastruby/rails_stats/blob/805b022b27464b5767ccbf8bf053c03b6d693aa7/test/dummy/config/initializers/pagy.rb | test/dummy/config/initializers/pagy.rb | # copy https://github.com/ddnexus/pagy/blob/3.8.1/lib/config/pagy.rb here and customize if needed
| ruby | MIT | 805b022b27464b5767ccbf8bf053c03b6d693aa7 | 2026-01-04T17:54:07.356535Z | false |
fastruby/rails_stats | https://github.com/fastruby/rails_stats/blob/805b022b27464b5767ccbf8bf053c03b6d693aa7/test/dummy/config/initializers/wrap_parameters.rb | test/dummy/config/initializers/wrap_parameters.rb | # Be sure to restart your server when you modify this file.
# This file contains settings for ActionController::ParamsWrapper which
# is enabled by default.
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
ActiveSupport.on_load(:action_controller) do
wrap_parameters f... | ruby | MIT | 805b022b27464b5767ccbf8bf053c03b6d693aa7 | 2026-01-04T17:54:07.356535Z | false |
fastruby/rails_stats | https://github.com/fastruby/rails_stats/blob/805b022b27464b5767ccbf8bf053c03b6d693aa7/test/dummy/config/initializers/inflections.rb | test/dummy/config/initializers/inflections.rb | # Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format. Inflections
# are locale specific, and you may define rules for as many different
# locales as you wish. All of these examples are active by default:
# ActiveSupport::Inflector.inflections(:en) do |inflec... | ruby | MIT | 805b022b27464b5767ccbf8bf053c03b6d693aa7 | 2026-01-04T17:54:07.356535Z | false |
fastruby/rails_stats | https://github.com/fastruby/rails_stats/blob/805b022b27464b5767ccbf8bf053c03b6d693aa7/test/dummy/config/initializers/cookies_serializer.rb | test/dummy/config/initializers/cookies_serializer.rb | # Be sure to restart your server when you modify this file.
# Specify a serializer for the signed and encrypted cookie jars.
# Valid options are :json, :marshal, and :hybrid.
Rails.application.config.action_dispatch.cookies_serializer = :json
| ruby | MIT | 805b022b27464b5767ccbf8bf053c03b6d693aa7 | 2026-01-04T17:54:07.356535Z | false |
fastruby/rails_stats | https://github.com/fastruby/rails_stats/blob/805b022b27464b5767ccbf8bf053c03b6d693aa7/test/dummy/config/initializers/assets.rb | test/dummy/config/initializers/assets.rb | # Be sure to restart your server when you modify this file.
# Version of your assets, change this if you want to expire all your assets.
Rails.application.config.assets.version = '1.0'
# Add additional assets to the asset load path.
# Rails.application.config.assets.paths << Emoji.images_path
# Add Yarn node_modules ... | ruby | MIT | 805b022b27464b5767ccbf8bf053c03b6d693aa7 | 2026-01-04T17:54:07.356535Z | false |
fastruby/rails_stats | https://github.com/fastruby/rails_stats/blob/805b022b27464b5767ccbf8bf053c03b6d693aa7/test/dummy/config/initializers/backtrace_silencers.rb | test/dummy/config/initializers/backtrace_silencers.rb | # Be sure to restart your server when you modify this file.
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
# You can also remove all the silencers if you're trying to debug a probl... | ruby | MIT | 805b022b27464b5767ccbf8bf053c03b6d693aa7 | 2026-01-04T17:54:07.356535Z | false |
fastruby/rails_stats | https://github.com/fastruby/rails_stats/blob/805b022b27464b5767ccbf8bf053c03b6d693aa7/test/dummy/config/initializers/mime_types.rb | test/dummy/config/initializers/mime_types.rb | # Be sure to restart your server when you modify this file.
# Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf
| ruby | MIT | 805b022b27464b5767ccbf8bf053c03b6d693aa7 | 2026-01-04T17:54:07.356535Z | false |
fastruby/rails_stats | https://github.com/fastruby/rails_stats/blob/805b022b27464b5767ccbf8bf053c03b6d693aa7/test/dummy/config/environments/test.rb | test/dummy/config/environments/test.rb | # The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
# and recreated between test runs. Don't rely on the data there!
Rails.application.configure do
# Settings... | ruby | MIT | 805b022b27464b5767ccbf8bf053c03b6d693aa7 | 2026-01-04T17:54:07.356535Z | false |
fastruby/rails_stats | https://github.com/fastruby/rails_stats/blob/805b022b27464b5767ccbf8bf053c03b6d693aa7/test/dummy/config/environments/development.rb | test/dummy/config/environments/development.rb | Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web serv... | ruby | MIT | 805b022b27464b5767ccbf8bf053c03b6d693aa7 | 2026-01-04T17:54:07.356535Z | false |
fastruby/rails_stats | https://github.com/fastruby/rails_stats/blob/805b022b27464b5767ccbf8bf053c03b6d693aa7/test/dummy/config/environments/production.rb | test/dummy/config/environments/production.rb | Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web serve... | ruby | MIT | 805b022b27464b5767ccbf8bf053c03b6d693aa7 | 2026-01-04T17:54:07.356535Z | false |
fastruby/rails_stats | https://github.com/fastruby/rails_stats/blob/805b022b27464b5767ccbf8bf053c03b6d693aa7/test/lib/rails_stats/json_formatter_test.rb | test/lib/rails_stats/json_formatter_test.rb | # frozen_string_literal: true
require "test_helper"
describe RailsStats::JSONFormatter do
describe "#result" do
JSON_STRING = <<~EOS
[{
"summary": {
"declared": 9,
"unpinned": 6,
"total": 18,
"github": 0
},
"gems": [
{
"... | ruby | MIT | 805b022b27464b5767ccbf8bf053c03b6d693aa7 | 2026-01-04T17:54:07.356535Z | false |
fastruby/rails_stats | https://github.com/fastruby/rails_stats/blob/805b022b27464b5767ccbf8bf053c03b6d693aa7/test/lib/rails_stats/code_statistics_test.rb | test/lib/rails_stats/code_statistics_test.rb | # frozen_string_literal: true
require "test_helper"
Minitest::Test.make_my_diffs_pretty!
describe RailsStats::CodeStatistics do
describe "#to_s" do
it "outputs useful stats for a Rails project" do
root_directory = File.expand_path('../../../test/dummy', File.dirname(__FILE__))
table = File.read(Fil... | ruby | MIT | 805b022b27464b5767ccbf8bf053c03b6d693aa7 | 2026-01-04T17:54:07.356535Z | false |
fastruby/rails_stats | https://github.com/fastruby/rails_stats/blob/805b022b27464b5767ccbf8bf053c03b6d693aa7/lib/rails_stats.rb | lib/rails_stats.rb | require "rails_stats/version"
module RailsStats
end
require 'rake'
require 'rails_stats/tasks'
| ruby | MIT | 805b022b27464b5767ccbf8bf053c03b6d693aa7 | 2026-01-04T17:54:07.356535Z | false |
fastruby/rails_stats | https://github.com/fastruby/rails_stats/blob/805b022b27464b5767ccbf8bf053c03b6d693aa7/lib/rails_stats/console_formatter.rb | lib/rails_stats/console_formatter.rb | require "bundler/stats/cli"
module RailsStats
class ConsoleFormatter < StatsFormatter
def to_s
Bundler::Stats::CLI.start
print_header
sorted_keys = @statistics.keys.sort
sorted_keys.each { |key| print_line(key, @statistics[key]) }
print_splitter
if @grand_total
print... | ruby | MIT | 805b022b27464b5767ccbf8bf053c03b6d693aa7 | 2026-01-04T17:54:07.356535Z | false |
fastruby/rails_stats | https://github.com/fastruby/rails_stats/blob/805b022b27464b5767ccbf8bf053c03b6d693aa7/lib/rails_stats/spec_statistics.rb | lib/rails_stats/spec_statistics.rb | module RailsStats
class SpecStatistics
attr_reader :statistics, :total, :test
SPEC_FOLDERS = ['controllers',
'features',
'helpers',
'models',
'requests',
'routing',
'integrations',
... | ruby | MIT | 805b022b27464b5767ccbf8bf053c03b6d693aa7 | 2026-01-04T17:54:07.356535Z | false |
fastruby/rails_stats | https://github.com/fastruby/rails_stats/blob/805b022b27464b5767ccbf8bf053c03b6d693aa7/lib/rails_stats/version.rb | lib/rails_stats/version.rb | # frozen_string_literal: true
module RailsStats
VERSION = "2.0.1"
end
| ruby | MIT | 805b022b27464b5767ccbf8bf053c03b6d693aa7 | 2026-01-04T17:54:07.356535Z | false |
fastruby/rails_stats | https://github.com/fastruby/rails_stats/blob/805b022b27464b5767ccbf8bf053c03b6d693aa7/lib/rails_stats/json_formatter.rb | lib/rails_stats/json_formatter.rb | require "json"
module RailsStats
class JSONFormatter < StatsFormatter
def result
@result = []
old_stdout = $stdout
$stdout = StringIO.new
Bundler::Stats::CLI.start(["-f", "json"])
bundler_stats_cli_json_result = $stdout.string
$stdout = old_stdout
@result << JSON.parse(... | ruby | MIT | 805b022b27464b5767ccbf8bf053c03b6d693aa7 | 2026-01-04T17:54:07.356535Z | false |
fastruby/rails_stats | https://github.com/fastruby/rails_stats/blob/805b022b27464b5767ccbf8bf053c03b6d693aa7/lib/rails_stats/gem_statistics.rb | lib/rails_stats/gem_statistics.rb | module RailsStats
class GemStatistics
attr_reader :statistics, :total, :test
def initialize(directory)
@test = false
@directory = directory
@statistics = calculate_statistics
@total = calculate_total
end
private
def calculate_total
out = CodeStatisticsCalcula... | ruby | MIT | 805b022b27464b5767ccbf8bf053c03b6d693aa7 | 2026-01-04T17:54:07.356535Z | false |
fastruby/rails_stats | https://github.com/fastruby/rails_stats/blob/805b022b27464b5767ccbf8bf053c03b6d693aa7/lib/rails_stats/code_statistics.rb | lib/rails_stats/code_statistics.rb | # railties/lib/rails/code_statistics.rb
module RailsStats
class CodeStatistics
def initialize(root_directory, opts = {})
@calculator = RailsStats::StatsCalculator.new(root_directory)
@formatter = load_formatter(opts)
end
def to_s
@formatter.to_s
end
private
def... | ruby | MIT | 805b022b27464b5767ccbf8bf053c03b6d693aa7 | 2026-01-04T17:54:07.356535Z | false |
fastruby/rails_stats | https://github.com/fastruby/rails_stats/blob/805b022b27464b5767ccbf8bf053c03b6d693aa7/lib/rails_stats/root_statistics.rb | lib/rails_stats/root_statistics.rb | module RailsStats
class RootStatistics
attr_reader :statistics, :total, :test
ROOT_FOLDERS = {
"lib" => "Libraries",
"config" => "Configuration"
}
def initialize(directory)
@test = false
@directory = directory
@statistics = calculate_statistics
@total = calc... | ruby | MIT | 805b022b27464b5767ccbf8bf053c03b6d693aa7 | 2026-01-04T17:54:07.356535Z | false |
fastruby/rails_stats | https://github.com/fastruby/rails_stats/blob/805b022b27464b5767ccbf8bf053c03b6d693aa7/lib/rails_stats/inflector.rb | lib/rails_stats/inflector.rb | # encoding: utf-8
module RailsStats
# The Inflector transforms words from singular to plural, class names to table
# names, modularized class names to ones without, and class names to foreign
# keys. The default inflections for pluralization, singularization, and
# uncountable words are kept in inflections.rb.... | ruby | MIT | 805b022b27464b5767ccbf8bf053c03b6d693aa7 | 2026-01-04T17:54:07.356535Z | false |
fastruby/rails_stats | https://github.com/fastruby/rails_stats/blob/805b022b27464b5767ccbf8bf053c03b6d693aa7/lib/rails_stats/code_statistics_calculator.rb | lib/rails_stats/code_statistics_calculator.rb | # railties/lib/rails/code_statistics_calculator.rb
module RailsStats
class CodeStatisticsCalculator #:nodoc:
attr_reader :files_total, :lines, :code_lines, :classes, :methods, :test
PATTERNS = {
rb: {
line_comment: /^\s*#/,
begin_block_comment: /^=begin/,
end_block_comment: /^=... | ruby | MIT | 805b022b27464b5767ccbf8bf053c03b6d693aa7 | 2026-01-04T17:54:07.356535Z | false |
fastruby/rails_stats | https://github.com/fastruby/rails_stats/blob/805b022b27464b5767ccbf8bf053c03b6d693aa7/lib/rails_stats/stats_formatter.rb | lib/rails_stats/stats_formatter.rb | module RailsStats
class StatsFormatter
def initialize(calculator, opts = {})
@calculator = calculator
@statistics = calculator.statistics
@code_total = calculator.code_total
@tests_total = calculator.tests_total
@grand_total = calculator.grand_total
end
attr_reader :calcu... | ruby | MIT | 805b022b27464b5767ccbf8bf053c03b6d693aa7 | 2026-01-04T17:54:07.356535Z | false |
fastruby/rails_stats | https://github.com/fastruby/rails_stats/blob/805b022b27464b5767ccbf8bf053c03b6d693aa7/lib/rails_stats/stats_calculator.rb | lib/rails_stats/stats_calculator.rb | module RailsStats
class StatsCalculator
RAILS_APP_FOLDERS = ['models',
'controllers',
'helpers',
'mailers',
'views',
'assets']
def initialize(root_directory)
@root_directory = ro... | ruby | MIT | 805b022b27464b5767ccbf8bf053c03b6d693aa7 | 2026-01-04T17:54:07.356535Z | false |
fastruby/rails_stats | https://github.com/fastruby/rails_stats/blob/805b022b27464b5767ccbf8bf053c03b6d693aa7/lib/rails_stats/app_statistics.rb | lib/rails_stats/app_statistics.rb | module RailsStats
class AppStatistics
attr_reader :statistics, :total, :test
def initialize(directory)
@directories = []
@test = false
@directory = directory
@statistics = calculate_statistics
@total = calculate_total
end
def key_concepts
directories.coll... | ruby | MIT | 805b022b27464b5767ccbf8bf053c03b6d693aa7 | 2026-01-04T17:54:07.356535Z | false |
fastruby/rails_stats | https://github.com/fastruby/rails_stats/blob/805b022b27464b5767ccbf8bf053c03b6d693aa7/lib/rails_stats/tasks.rb | lib/rails_stats/tasks.rb | desc "Report code statistics (KLOCs, etc) from the current (or given) application"
task :stats, [:path, :format] do |t, args|
Rake::Task["stats"].clear # clear out normal one if there
require 'rails_stats/all'
path = args[:path]
path = Rails.root.to_s if defined?(Rails)
fmt = args[:format] || ""
raise "no ... | ruby | MIT | 805b022b27464b5767ccbf8bf053c03b6d693aa7 | 2026-01-04T17:54:07.356535Z | false |
fastruby/rails_stats | https://github.com/fastruby/rails_stats/blob/805b022b27464b5767ccbf8bf053c03b6d693aa7/lib/rails_stats/cucumber_statistics.rb | lib/rails_stats/cucumber_statistics.rb | module RailsStats
class CucumberStatistics
attr_reader :statistics, :total, :test
def initialize(directory)
@test = true
@directory = directory
@statistics = calculate_statistics
@total = calculate_total
end
private
def calculate_total
out = CodeStatist... | ruby | MIT | 805b022b27464b5767ccbf8bf053c03b6d693aa7 | 2026-01-04T17:54:07.356535Z | false |
fastruby/rails_stats | https://github.com/fastruby/rails_stats/blob/805b022b27464b5767ccbf8bf053c03b6d693aa7/lib/rails_stats/util.rb | lib/rails_stats/util.rb | module RailsStats
module Util
extend self
def calculate_projects(*args)
projects = {}
children = [args.pop].flatten
parent = args.flatten
children.each do |dirname|
child_folder_pattern = File.join(*(parent.dup + [dirname]))
Dir[child_folder_pattern].each do |marker... | ruby | MIT | 805b022b27464b5767ccbf8bf053c03b6d693aa7 | 2026-01-04T17:54:07.356535Z | false |
fastruby/rails_stats | https://github.com/fastruby/rails_stats/blob/805b022b27464b5767ccbf8bf053c03b6d693aa7/lib/rails_stats/test_statistics.rb | lib/rails_stats/test_statistics.rb | module RailsStats
class TestStatistics
attr_reader :statistics, :total, :test
SPEC_FOLDERS = ['controllers',
'functional',
'helpers',
'models',
'requests',
'unit',
'integrations',
... | ruby | MIT | 805b022b27464b5767ccbf8bf053c03b6d693aa7 | 2026-01-04T17:54:07.356535Z | false |
fastruby/rails_stats | https://github.com/fastruby/rails_stats/blob/805b022b27464b5767ccbf8bf053c03b6d693aa7/lib/rails_stats/all.rb | lib/rails_stats/all.rb | require 'rails_stats/stats_calculator'
require 'rails_stats/stats_formatter'
require 'rails_stats/json_formatter'
require 'rails_stats/console_formatter'
require 'rails_stats/inflector'
require 'rails_stats/code_statistics_calculator'
require 'rails_stats/util'
require 'rails_stats/app_statistics'
require 'rails_stats/... | ruby | MIT | 805b022b27464b5767ccbf8bf053c03b6d693aa7 | 2026-01-04T17:54:07.356535Z | false |
dry-rb/dry-events | https://github.com/dry-rb/dry-events/blob/719370eb3e259cc2762998b076ceb18beeae9ce7/spec/spec_helper.rb | spec/spec_helper.rb | # frozen_string_literal: true
require_relative "support/coverage"
begin
require "pry"
require "pry-byebug"
rescue LoadError;
end
require "dry-events"
SPEC_ROOT = Pathname(__dir__)
Dir[SPEC_ROOT.join("shared/**/*.rb")].each(&method(:require))
Dir[SPEC_ROOT.join("support/**/*.rb")].each(&method(:require))
RSpec.... | ruby | MIT | 719370eb3e259cc2762998b076ceb18beeae9ce7 | 2026-01-04T17:54:09.241488Z | false |
dry-rb/dry-events | https://github.com/dry-rb/dry-events/blob/719370eb3e259cc2762998b076ceb18beeae9ce7/spec/support/warnings.rb | spec/support/warnings.rb | # frozen_string_literal: true
# This file is synced from hanakai-rb/repo-sync
require "warning"
Warning.ignore(%r{rspec/core})
Warning.ignore(%r{rspec/mocks})
Warning.ignore(/codacy/)
Warning[:experimental] = false if Warning.respond_to?(:[])
| ruby | MIT | 719370eb3e259cc2762998b076ceb18beeae9ce7 | 2026-01-04T17:54:09.241488Z | false |
dry-rb/dry-events | https://github.com/dry-rb/dry-events/blob/719370eb3e259cc2762998b076ceb18beeae9ce7/spec/support/coverage.rb | spec/support/coverage.rb | # frozen_string_literal: true
# This file is synced from hanakai-rb/repo-sync
if ENV["COVERAGE"] == "true"
require "simplecov"
require "simplecov-cobertura"
SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter
SimpleCov.start do
add_filter "/spec/"
enable_coverage :branch
end
end
| ruby | MIT | 719370eb3e259cc2762998b076ceb18beeae9ce7 | 2026-01-04T17:54:09.241488Z | false |
dry-rb/dry-events | https://github.com/dry-rb/dry-events/blob/719370eb3e259cc2762998b076ceb18beeae9ce7/spec/support/rspec.rb | spec/support/rspec.rb | # frozen_string_literal: true
# This file is synced from hanakai-rb/repo-sync
RSpec.configure do |config|
# When no filter given, search and run focused tests
config.filter_run_when_matching :focus
# Disables rspec monkey patches (no reason for their existence tbh)
config.disable_monkey_patching!
# Run ru... | ruby | MIT | 719370eb3e259cc2762998b076ceb18beeae9ce7 | 2026-01-04T17:54:09.241488Z | false |
dry-rb/dry-events | https://github.com/dry-rb/dry-events/blob/719370eb3e259cc2762998b076ceb18beeae9ce7/spec/unit/dry/events/listener_spec.rb | spec/unit/dry/events/listener_spec.rb | # frozen_string_literal: true
require "dry/events/listener"
RSpec.describe Dry::Events::Listener do
subject(:listener) do
Class.new {
include Dry::Events::Listener[:test_publisher]
}
end
let!(:publisher) do
Class.new {
include Dry::Events::Publisher[:test_publisher]
register_even... | ruby | MIT | 719370eb3e259cc2762998b076ceb18beeae9ce7 | 2026-01-04T17:54:09.241488Z | false |
dry-rb/dry-events | https://github.com/dry-rb/dry-events/blob/719370eb3e259cc2762998b076ceb18beeae9ce7/spec/unit/dry/events/filter_spec.rb | spec/unit/dry/events/filter_spec.rb | # frozen_string_literal: true
RSpec.describe Dry::Events::Filter do
subject(:filter) { described_class.new(query) }
context "nested hash" do
let(:query) do
{logger: {level: :info}}
end
specify do
expect(filter.()).to be false
expect(filter.(logger: {level: :info, output: :stdin})).t... | ruby | MIT | 719370eb3e259cc2762998b076ceb18beeae9ce7 | 2026-01-04T17:54:09.241488Z | false |
dry-rb/dry-events | https://github.com/dry-rb/dry-events/blob/719370eb3e259cc2762998b076ceb18beeae9ce7/spec/unit/dry/events/event_spec.rb | spec/unit/dry/events/event_spec.rb | # frozen_string_literal: true
require "dry/events/event"
RSpec.describe Dry::Events::Event do
subject(:event) do
described_class.new(event_id, payload)
end
let(:payload) { {} }
describe "invalid event name" do
let(:event_id) { nil }
it "raises InvalidEventNameError" do
expect { event }.to ... | ruby | MIT | 719370eb3e259cc2762998b076ceb18beeae9ce7 | 2026-01-04T17:54:09.241488Z | false |
dry-rb/dry-events | https://github.com/dry-rb/dry-events/blob/719370eb3e259cc2762998b076ceb18beeae9ce7/spec/unit/dry/events/publisher_spec.rb | spec/unit/dry/events/publisher_spec.rb | # frozen_string_literal: true
require "dry/events/publisher"
RSpec.describe Dry::Events::Publisher do
subject(:publisher) do
Class.new {
include Dry::Events::Publisher[:test_publisher]
register_event :test_event
}.new
end
describe ".[]" do
it "creates a publisher extension with provide... | ruby | MIT | 719370eb3e259cc2762998b076ceb18beeae9ce7 | 2026-01-04T17:54:09.241488Z | false |
dry-rb/dry-events | https://github.com/dry-rb/dry-events/blob/719370eb3e259cc2762998b076ceb18beeae9ce7/lib/dry-events.rb | lib/dry-events.rb | # frozen_string_literal: true
require "dry/events"
| ruby | MIT | 719370eb3e259cc2762998b076ceb18beeae9ce7 | 2026-01-04T17:54:09.241488Z | false |
dry-rb/dry-events | https://github.com/dry-rb/dry-events/blob/719370eb3e259cc2762998b076ceb18beeae9ce7/lib/dry/events.rb | lib/dry/events.rb | # frozen_string_literal: true
require "dry/events/publisher"
| ruby | MIT | 719370eb3e259cc2762998b076ceb18beeae9ce7 | 2026-01-04T17:54:09.241488Z | false |
dry-rb/dry-events | https://github.com/dry-rb/dry-events/blob/719370eb3e259cc2762998b076ceb18beeae9ce7/lib/dry/events/version.rb | lib/dry/events/version.rb | # frozen_string_literal: true
module Dry
module Events
VERSION = "1.1.0"
end
end
| ruby | MIT | 719370eb3e259cc2762998b076ceb18beeae9ce7 | 2026-01-04T17:54:09.241488Z | false |
dry-rb/dry-events | https://github.com/dry-rb/dry-events/blob/719370eb3e259cc2762998b076ceb18beeae9ce7/lib/dry/events/event.rb | lib/dry/events/event.rb | # frozen_string_literal: true
require "dry/events/constants"
module Dry
module Events
# Event object
#
# @api public
class Event
include ::Dry::Equalizer(:id, :payload)
InvalidEventNameError = ::Class.new(::StandardError) do
# @api private
def initialize
super(... | ruby | MIT | 719370eb3e259cc2762998b076ceb18beeae9ce7 | 2026-01-04T17:54:09.241488Z | false |
dry-rb/dry-events | https://github.com/dry-rb/dry-events/blob/719370eb3e259cc2762998b076ceb18beeae9ce7/lib/dry/events/filter.rb | lib/dry/events/filter.rb | # frozen_string_literal: true
module Dry
module Events
# Event filter
#
# A filter cherry-picks probes payload of events.
# Events not matching the predicates don't fire callbacks.
#
# @api private
class Filter
NO_MATCH = ::Object.new.freeze
# @!attribute [r] events
# ... | ruby | MIT | 719370eb3e259cc2762998b076ceb18beeae9ce7 | 2026-01-04T17:54:09.241488Z | false |
dry-rb/dry-events | https://github.com/dry-rb/dry-events/blob/719370eb3e259cc2762998b076ceb18beeae9ce7/lib/dry/events/publisher.rb | lib/dry/events/publisher.rb | # frozen_string_literal: true
require "dry/core"
require "dry/events/constants"
require "dry/events/event"
require "dry/events/bus"
require "dry/events/filter"
module Dry
module Events
# Exception raised when the same publisher is registered more than once
#
# @api public
PublisherAlreadyRegisteredE... | ruby | MIT | 719370eb3e259cc2762998b076ceb18beeae9ce7 | 2026-01-04T17:54:09.241488Z | false |
dry-rb/dry-events | https://github.com/dry-rb/dry-events/blob/719370eb3e259cc2762998b076ceb18beeae9ce7/lib/dry/events/constants.rb | lib/dry/events/constants.rb | # frozen_string_literal: true
require "concurrent/map"
module Dry
module Events
include ::Dry::Core::Constants
LISTENERS_HASH = ::Concurrent::Map.new do |h, k|
h.compute_if_absent(k) { [] }
end
end
end
| ruby | MIT | 719370eb3e259cc2762998b076ceb18beeae9ce7 | 2026-01-04T17:54:09.241488Z | false |
dry-rb/dry-events | https://github.com/dry-rb/dry-events/blob/719370eb3e259cc2762998b076ceb18beeae9ce7/lib/dry/events/bus.rb | lib/dry/events/bus.rb | # frozen_string_literal: true
require "dry/events/constants"
module Dry
module Events
# Event bus
#
# An event bus stores listeners (callbacks) and events
#
# @api private
class Bus
# @!attribute [r] events
# @return [Hash] A hash with events registered within a bus
attr_... | ruby | MIT | 719370eb3e259cc2762998b076ceb18beeae9ce7 | 2026-01-04T17:54:09.241488Z | false |
dry-rb/dry-events | https://github.com/dry-rb/dry-events/blob/719370eb3e259cc2762998b076ceb18beeae9ce7/lib/dry/events/listener.rb | lib/dry/events/listener.rb | # frozen_string_literal: true
require "dry/events/publisher"
module Dry
module Events
# Extension for objects that can listen to events
#
# @example
# class AppEvents
# include Dry::Events::Publisher[:app]
#
# register_event("users.created")
# end
#
# class MyLi... | ruby | MIT | 719370eb3e259cc2762998b076ceb18beeae9ce7 | 2026-01-04T17:54:09.241488Z | false |
soveran/scrivener | https://github.com/soveran/scrivener/blob/0695419ab75a608669741d873c5fa047371b65e0/test/scrivener_test.rb | test/scrivener_test.rb | require File.expand_path("../lib/scrivener", File.dirname(__FILE__))
class A < Scrivener
attr_accessor :a
attr_accessor :b
end
scope do
test "ignore extra fields" do
atts = { :a => 1, :b => 2, :c => 3 }
filter = A.new(atts)
atts.delete(:c)
assert_equal atts, filter.attributes
end
test "n... | ruby | MIT | 0695419ab75a608669741d873c5fa047371b65e0 | 2026-01-04T17:54:11.403060Z | false |
soveran/scrivener | https://github.com/soveran/scrivener/blob/0695419ab75a608669741d873c5fa047371b65e0/lib/scrivener.rb | lib/scrivener.rb | require_relative "scrivener/validations"
class Scrivener
VERSION = "1.1.1"
include Validations
# Initialize with a hash of attributes and values.
# Extra attributes are discarded.
#
# @example
#
# class EditPost < Scrivener
# attr_accessor :title
# attr_accessor :body
#
# def va... | ruby | MIT | 0695419ab75a608669741d873c5fa047371b65e0 | 2026-01-04T17:54:11.403060Z | false |
soveran/scrivener | https://github.com/soveran/scrivener/blob/0695419ab75a608669741d873c5fa047371b65e0/lib/scrivener/validations.rb | lib/scrivener/validations.rb | class Scrivener
# Provides a base implementation for extensible validation routines.
# {Scrivener::Validations} currently only provides the following assertions:
#
# * assert
# * assert_present
# * assert_format
# * assert_numeric
# * assert_url
# * assert_email
# * assert_member
# * assert_lengt... | ruby | MIT | 0695419ab75a608669741d873c5fa047371b65e0 | 2026-01-04T17:54:11.403060Z | false |
algolia/algoliasearch-jekyll | https://github.com/algolia/algoliasearch-jekyll/blob/cb21e83402de3cea46201fe12bd1b9a2eaacebfb/spec/record_extractor_spec.rb | spec/record_extractor_spec.rb | require 'spec_helper'
describe(AlgoliaSearchRecordExtractor) do
let(:extractor) { AlgoliaSearchRecordExtractor }
let(:site) { get_site }
let(:page_file) { extractor.new(site.file_by_name('about.md')) }
let(:html_page_file) { extractor.new(site.file_by_name('authors.html')) }
let(:post_file) { extractor.new(s... | ruby | MIT | cb21e83402de3cea46201fe12bd1b9a2eaacebfb | 2026-01-04T17:53:57.372095Z | false |
algolia/algoliasearch-jekyll | https://github.com/algolia/algoliasearch-jekyll/blob/cb21e83402de3cea46201fe12bd1b9a2eaacebfb/spec/spec_helper_simplecov.rb | spec/spec_helper_simplecov.rb | require 'simplecov'
SimpleCov.configure do
load_profile 'test_frameworks'
end
ENV['COVERAGE'] && SimpleCov.start do
add_filter '/.rvm/'
end
| ruby | MIT | cb21e83402de3cea46201fe12bd1b9a2eaacebfb | 2026-01-04T17:53:57.372095Z | false |
algolia/algoliasearch-jekyll | https://github.com/algolia/algoliasearch-jekyll/blob/cb21e83402de3cea46201fe12bd1b9a2eaacebfb/spec/credential_checker_spec.rb | spec/credential_checker_spec.rb | require 'spec_helper'
describe(AlgoliaSearchCredentialChecker) do
let(:config) do
{
'source' => fixture_path,
'markdown_ext' => 'md,mkd',
'algolia' => {
'application_id' => 'APPID',
'index_name' => 'INDEXNAME'
}
}
end
let(:checker) { AlgoliaSearchCredentialChecker.... | ruby | MIT | cb21e83402de3cea46201fe12bd1b9a2eaacebfb | 2026-01-04T17:53:57.372095Z | false |
algolia/algoliasearch-jekyll | https://github.com/algolia/algoliasearch-jekyll/blob/cb21e83402de3cea46201fe12bd1b9a2eaacebfb/spec/error_handler_spec.rb | spec/error_handler_spec.rb | require 'spec_helper'
describe(AlgoliaSearchErrorHandler) do
before(:each) do
@error_handler = AlgoliaSearchErrorHandler.new
end
describe 'display' do
before(:each) do
allow(Jekyll.logger).to receive(:error)
allow(Jekyll.logger).to receive(:warn)
end
it 'should display first line as... | ruby | MIT | cb21e83402de3cea46201fe12bd1b9a2eaacebfb | 2026-01-04T17:53:57.372095Z | false |
algolia/algoliasearch-jekyll | https://github.com/algolia/algoliasearch-jekyll/blob/cb21e83402de3cea46201fe12bd1b9a2eaacebfb/spec/push_spec.rb | spec/push_spec.rb | require 'spec_helper'
describe(AlgoliaSearchJekyllPush) do
let(:push) { AlgoliaSearchJekyllPush }
let(:site) { get_site }
let(:page_file) { site.file_by_name('about.md') }
let(:html_page_file) { site.file_by_name('authors.html') }
let(:excluded_page_file) { site.file_by_name('excluded.html') }
let(:post_fi... | ruby | MIT | cb21e83402de3cea46201fe12bd1b9a2eaacebfb | 2026-01-04T17:53:57.372095Z | false |
algolia/algoliasearch-jekyll | https://github.com/algolia/algoliasearch-jekyll/blob/cb21e83402de3cea46201fe12bd1b9a2eaacebfb/spec/spec_helper.rb | spec/spec_helper.rb | if ENV['TRAVIS']
require 'coveralls'
Coveralls.wear!
end
require 'awesome_print'
require 'jekyll'
require_relative './spec_helper_simplecov.rb'
require './lib/push.rb'
RSpec.configure do |config|
config.filter_run(focus: true)
config.fail_fast = true
config.run_all_when_everything_filtered = true
end
# Dis... | ruby | MIT | cb21e83402de3cea46201fe12bd1b9a2eaacebfb | 2026-01-04T17:53:57.372095Z | false |
algolia/algoliasearch-jekyll | https://github.com/algolia/algoliasearch-jekyll/blob/cb21e83402de3cea46201fe12bd1b9a2eaacebfb/lib/version.rb | lib/version.rb | # Expose gem version
class AlgoliaSearchJekyllVersion
def self.to_s
'0.9.1'
end
end
| ruby | MIT | cb21e83402de3cea46201fe12bd1b9a2eaacebfb | 2026-01-04T17:53:57.372095Z | false |
algolia/algoliasearch-jekyll | https://github.com/algolia/algoliasearch-jekyll/blob/cb21e83402de3cea46201fe12bd1b9a2eaacebfb/lib/error_handler.rb | lib/error_handler.rb | require 'json'
require 'verbal_expressions'
# Helps in displaying useful error messages to users, to help them debug their
# issues
class AlgoliaSearchErrorHandler
# Will output the specified error file.
# First line is displayed as error, next ones as warning
def display(file)
file = File.expand_path(File.j... | ruby | MIT | cb21e83402de3cea46201fe12bd1b9a2eaacebfb | 2026-01-04T17:53:57.372095Z | false |
algolia/algoliasearch-jekyll | https://github.com/algolia/algoliasearch-jekyll/blob/cb21e83402de3cea46201fe12bd1b9a2eaacebfb/lib/credential_checker.rb | lib/credential_checker.rb | require 'algoliasearch'
require 'nokogiri'
require 'json'
require_relative './error_handler.rb'
# Given an HTML file as input, will return an array of records to index
class AlgoliaSearchCredentialChecker
attr_accessor :config, :logger
def initialize(config)
@config = config
@logger = AlgoliaSearchErrorHa... | ruby | MIT | cb21e83402de3cea46201fe12bd1b9a2eaacebfb | 2026-01-04T17:53:57.372095Z | false |
algolia/algoliasearch-jekyll | https://github.com/algolia/algoliasearch-jekyll/blob/cb21e83402de3cea46201fe12bd1b9a2eaacebfb/lib/push.rb | lib/push.rb | require 'algoliasearch'
require 'nokogiri'
require 'json'
require_relative './version'
require_relative './record_extractor'
require_relative './credential_checker'
require_relative './error_handler'
# `jekyll algolia push` command
class AlgoliaSearchJekyllPush < Jekyll::Command
class << self
attr_accessor :opti... | ruby | MIT | cb21e83402de3cea46201fe12bd1b9a2eaacebfb | 2026-01-04T17:53:57.372095Z | false |
algolia/algoliasearch-jekyll | https://github.com/algolia/algoliasearch-jekyll/blob/cb21e83402de3cea46201fe12bd1b9a2eaacebfb/lib/record_extractor.rb | lib/record_extractor.rb | require 'algoliasearch'
require 'nokogiri'
require 'json'
# Given an HTML file as input, will return an array of records to index
class AlgoliaSearchRecordExtractor
attr_reader :file
def initialize(file)
@file = file
@config = file.site.config
default_config = {
'record_css_selector' => 'p'
... | ruby | MIT | cb21e83402de3cea46201fe12bd1b9a2eaacebfb | 2026-01-04T17:53:57.372095Z | false |
algolia/algoliasearch-jekyll | https://github.com/algolia/algoliasearch-jekyll/blob/cb21e83402de3cea46201fe12bd1b9a2eaacebfb/lib/algoliasearch-jekyll.rb | lib/algoliasearch-jekyll.rb | require 'rubygems'
require 'bundler/setup'
require 'awesome_print'
require_relative './version'
require_relative './push'
# `jekyll algolia` main entry
class AlgoliaSearchJekyll < Jekyll::Command
class << self
def init_with_program(prog)
prog.command(:algolia) do |command|
command.syntax 'algolia... | ruby | MIT | cb21e83402de3cea46201fe12bd1b9a2eaacebfb | 2026-01-04T17:53:57.372095Z | false |
mikbe/eventable | https://github.com/mikbe/eventable/blob/316a8e7e93ad4a897c14c84f321941d767bf362b/autotest/discover.rb | autotest/discover.rb | Autotest.add_discovery {"rspec2"} | ruby | MIT | 316a8e7e93ad4a897c14c84f321941d767bf362b | 2026-01-04T17:54:26.651177Z | false |
mikbe/eventable | https://github.com/mikbe/eventable/blob/316a8e7e93ad4a897c14c84f321941d767bf362b/spec/spec_helper.rb | spec/spec_helper.rb | $: << '.'
$:.unshift File.expand_path(File.join(File.dirname(__FILE__), "/../lib"))
require 'rspec'
require 'eventable'
| ruby | MIT | 316a8e7e93ad4a897c14c84f321941d767bf362b | 2026-01-04T17:54:26.651177Z | false |
mikbe/eventable | https://github.com/mikbe/eventable/blob/316a8e7e93ad4a897c14c84f321941d767bf362b/spec/eventable/eventable_spec.rb | spec/eventable/eventable_spec.rb | require 'spec_helper'
# Callbacks are threaded to avoid blocking so tests need to wait for the callback to be scheduled and run
CALLBACK_WAIT = 0.01
describe Eventable do
before(:each) do
@evented = EventClass.new
@listener = ListenClass.new
end
context "when mixing in Eventable" do
it "should no... | ruby | MIT | 316a8e7e93ad4a897c14c84f321941d767bf362b | 2026-01-04T17:54:26.651177Z | false |
mikbe/eventable | https://github.com/mikbe/eventable/blob/316a8e7e93ad4a897c14c84f321941d767bf362b/lib/eventable.rb | lib/eventable.rb | require "eventable/version"
require "eventable/errors"
require "eventable/eventable"
| ruby | MIT | 316a8e7e93ad4a897c14c84f321941d767bf362b | 2026-01-04T17:54:26.651177Z | false |
mikbe/eventable | https://github.com/mikbe/eventable/blob/316a8e7e93ad4a897c14c84f321941d767bf362b/lib/eventable/version.rb | lib/eventable/version.rb | module Eventable
VERSION = "0.2.1"
end
| ruby | MIT | 316a8e7e93ad4a897c14c84f321941d767bf362b | 2026-01-04T17:54:26.651177Z | false |
mikbe/eventable | https://github.com/mikbe/eventable/blob/316a8e7e93ad4a897c14c84f321941d767bf362b/lib/eventable/errors.rb | lib/eventable/errors.rb | module Eventable
module Errors
UnknownEvent = Class.new(StandardError)
SuperNotCalledInInitialize = Class.new(ScriptError)
end
end | ruby | MIT | 316a8e7e93ad4a897c14c84f321941d767bf362b | 2026-01-04T17:54:26.651177Z | false |
mikbe/eventable | https://github.com/mikbe/eventable/blob/316a8e7e93ad4a897c14c84f321941d767bf362b/lib/eventable/eventable.rb | lib/eventable/eventable.rb | require 'thread'
# Incredibly simple framework for adding events
module Eventable
module EventableEventMethods
# register an event
def event(event_name)
@eventable_events ||= []
@eventable_events << event_name unless @eventable_events.include? event_name
end
# returns a list of registe... | ruby | MIT | 316a8e7e93ad4a897c14c84f321941d767bf362b | 2026-01-04T17:54:26.651177Z | false |
fatkodima/columns_trace | https://github.com/fatkodima/columns_trace/blob/76cdd86a78d99b8001e1bfd23fe36946a2d578c6/test/sidekiq_test.rb | test/sidekiq_test.rb | # frozen_string_literal: true
require "test_helper"
class SidekiqTest < ActiveSupport::TestCase
test "reports unused columns" do
output = capture_logging do
SidekiqJob.perform_inline
end
assert_match %(SidekiqJob#perform\n 1 User record: unused columns - "id", "email", "created_at", "updated_at"... | ruby | MIT | 76cdd86a78d99b8001e1bfd23fe36946a2d578c6 | 2026-01-04T17:54:31.811968Z | false |
fatkodima/columns_trace | https://github.com/fatkodima/columns_trace/blob/76cdd86a78d99b8001e1bfd23fe36946a2d578c6/test/controller_test.rb | test/controller_test.rb | # frozen_string_literal: true
require "test_helper"
class ControllerTest < ActionDispatch::IntegrationTest
test "GET /action1" do
output = capture_logging do
get action1_path
end
assert_match %(UsersController#action1\n 2 User records: unused columns - "id", "created_at", "updated_at"; used colu... | ruby | MIT | 76cdd86a78d99b8001e1bfd23fe36946a2d578c6 | 2026-01-04T17:54:31.811968Z | false |
fatkodima/columns_trace | https://github.com/fatkodima/columns_trace/blob/76cdd86a78d99b8001e1bfd23fe36946a2d578c6/test/test_helper.rb | test/test_helper.rb | # frozen_string_literal: true
ENV["RAILS_ENV"] = "test"
require "columns_trace"
require "logger"
require "minitest/autorun"
require_relative "dummy/config/environment"
ActiveRecord::Migration.suppress_messages do
require_relative "dummy/db/schema"
end
User.create!([
{ name: "John", email: "john@example.com" },... | ruby | MIT | 76cdd86a78d99b8001e1bfd23fe36946a2d578c6 | 2026-01-04T17:54:31.811968Z | false |
fatkodima/columns_trace | https://github.com/fatkodima/columns_trace/blob/76cdd86a78d99b8001e1bfd23fe36946a2d578c6/test/mailer_test.rb | test/mailer_test.rb | # frozen_string_literal: true
require "test_helper"
class MailerTest < ActionMailer::TestCase
setup do
@user = User.first
end
test "reports unused columns" do
email = UserMailer.with(user: @user).unused_fields_email
output = capture_logging do
email.deliver_now
end
assert_match %(Use... | ruby | MIT | 76cdd86a78d99b8001e1bfd23fe36946a2d578c6 | 2026-01-04T17:54:31.811968Z | false |
fatkodima/columns_trace | https://github.com/fatkodima/columns_trace/blob/76cdd86a78d99b8001e1bfd23fe36946a2d578c6/test/job_test.rb | test/job_test.rb | # frozen_string_literal: true
require "test_helper"
class JobTest < ActiveJob::TestCase
test "reports unused columns" do
output = capture_logging do
UnusedJob.perform_now
end
assert_match %(UnusedJob#perform\n 1 User record: unused columns - "id", "name", "created_at", "updated_at"; used columns... | ruby | MIT | 76cdd86a78d99b8001e1bfd23fe36946a2d578c6 | 2026-01-04T17:54:31.811968Z | false |
fatkodima/columns_trace | https://github.com/fatkodima/columns_trace/blob/76cdd86a78d99b8001e1bfd23fe36946a2d578c6/test/dummy/app/jobs/used_job.rb | test/dummy/app/jobs/used_job.rb | # frozen_string_literal: true
class UsedJob < ActiveJob::Base
def perform
User.first.attributes
end
end
| ruby | MIT | 76cdd86a78d99b8001e1bfd23fe36946a2d578c6 | 2026-01-04T17:54:31.811968Z | false |
fatkodima/columns_trace | https://github.com/fatkodima/columns_trace/blob/76cdd86a78d99b8001e1bfd23fe36946a2d578c6/test/dummy/app/jobs/unused_job.rb | test/dummy/app/jobs/unused_job.rb | # frozen_string_literal: true
class UnusedJob < ActiveJob::Base
def perform
User.first.email
end
end
| ruby | MIT | 76cdd86a78d99b8001e1bfd23fe36946a2d578c6 | 2026-01-04T17:54:31.811968Z | false |
fatkodima/columns_trace | https://github.com/fatkodima/columns_trace/blob/76cdd86a78d99b8001e1bfd23fe36946a2d578c6/test/dummy/app/jobs/sidekiq_job.rb | test/dummy/app/jobs/sidekiq_job.rb | # frozen_string_literal: true
class SidekiqJob
include Sidekiq::Job
def perform
User.first.name
end
end
| ruby | MIT | 76cdd86a78d99b8001e1bfd23fe36946a2d578c6 | 2026-01-04T17:54:31.811968Z | false |
fatkodima/columns_trace | https://github.com/fatkodima/columns_trace/blob/76cdd86a78d99b8001e1bfd23fe36946a2d578c6/test/dummy/app/controllers/users_controller.rb | test/dummy/app/controllers/users_controller.rb | # frozen_string_literal: true
class UsersController < ActionController::Base
# Multiple records with unused columns.
def action1
user1, user2 = User.all.to_a
user1.email
user2.name
head :ok
end
# Single record with unused columns.
def action2
user = User.first
user.id
head :ok
... | ruby | MIT | 76cdd86a78d99b8001e1bfd23fe36946a2d578c6 | 2026-01-04T17:54:31.811968Z | false |
fatkodima/columns_trace | https://github.com/fatkodima/columns_trace/blob/76cdd86a78d99b8001e1bfd23fe36946a2d578c6/test/dummy/app/models/project.rb | test/dummy/app/models/project.rb | # frozen_string_literal: true
class Project < ActiveRecord::Base
end
| ruby | MIT | 76cdd86a78d99b8001e1bfd23fe36946a2d578c6 | 2026-01-04T17:54:31.811968Z | false |
fatkodima/columns_trace | https://github.com/fatkodima/columns_trace/blob/76cdd86a78d99b8001e1bfd23fe36946a2d578c6/test/dummy/app/models/user.rb | test/dummy/app/models/user.rb | # frozen_string_literal: true
class User < ActiveRecord::Base
end
| ruby | MIT | 76cdd86a78d99b8001e1bfd23fe36946a2d578c6 | 2026-01-04T17:54:31.811968Z | false |
fatkodima/columns_trace | https://github.com/fatkodima/columns_trace/blob/76cdd86a78d99b8001e1bfd23fe36946a2d578c6/test/dummy/app/mailers/user_mailer.rb | test/dummy/app/mailers/user_mailer.rb | # frozen_string_literal: true
class UserMailer < ActionMailer::Base
default from: "foo@example.com"
def unused_fields_email
user = params[:user]
_projects = Project.all.map(&:name)
mail(to: user.email) do |format|
format.text { render plain: "Text" }
end
end
def used_fields_email
u... | ruby | MIT | 76cdd86a78d99b8001e1bfd23fe36946a2d578c6 | 2026-01-04T17:54:31.811968Z | false |
fatkodima/columns_trace | https://github.com/fatkodima/columns_trace/blob/76cdd86a78d99b8001e1bfd23fe36946a2d578c6/test/dummy/db/schema.rb | test/dummy/db/schema.rb | # frozen_string_literal: true
ActiveRecord::Schema.define do
create_table :users, force: true do |t|
t.string :name
t.string :email
t.timestamps
end
create_table :projects, force: true do |t|
t.string :name
end
end
| ruby | MIT | 76cdd86a78d99b8001e1bfd23fe36946a2d578c6 | 2026-01-04T17:54:31.811968Z | false |
fatkodima/columns_trace | https://github.com/fatkodima/columns_trace/blob/76cdd86a78d99b8001e1bfd23fe36946a2d578c6/test/dummy/config/application.rb | test/dummy/config/application.rb | # frozen_string_literal: true
require_relative "boot"
require "rails"
require "active_record/railtie"
require "action_mailer/railtie"
require "active_job/railtie"
require "rails/test_unit/railtie"
Bundler.require(*Rails.groups)
module Dummy
class Application < Rails::Application
config.root = File.expand_path... | ruby | MIT | 76cdd86a78d99b8001e1bfd23fe36946a2d578c6 | 2026-01-04T17:54:31.811968Z | false |
fatkodima/columns_trace | https://github.com/fatkodima/columns_trace/blob/76cdd86a78d99b8001e1bfd23fe36946a2d578c6/test/dummy/config/environment.rb | test/dummy/config/environment.rb | # frozen_string_literal: true
# Load the Rails application.
require_relative "application"
# Initialize the Rails application.
Rails.application.initialize!
| ruby | MIT | 76cdd86a78d99b8001e1bfd23fe36946a2d578c6 | 2026-01-04T17:54:31.811968Z | false |
fatkodima/columns_trace | https://github.com/fatkodima/columns_trace/blob/76cdd86a78d99b8001e1bfd23fe36946a2d578c6/test/dummy/config/routes.rb | test/dummy/config/routes.rb | # frozen_string_literal: true
Rails.application.routes.draw do
(1..5).each do |i|
get "/action#{i}", to: "users#action#{i}", as: "action#{i}"
end
end
| ruby | MIT | 76cdd86a78d99b8001e1bfd23fe36946a2d578c6 | 2026-01-04T17:54:31.811968Z | false |
fatkodima/columns_trace | https://github.com/fatkodima/columns_trace/blob/76cdd86a78d99b8001e1bfd23fe36946a2d578c6/test/dummy/config/boot.rb | test/dummy/config/boot.rb | # frozen_string_literal: true
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __dir__)
require "bundler/setup" # Set up gems listed in the Gemfile.
| ruby | MIT | 76cdd86a78d99b8001e1bfd23fe36946a2d578c6 | 2026-01-04T17:54:31.811968Z | false |
fatkodima/columns_trace | https://github.com/fatkodima/columns_trace/blob/76cdd86a78d99b8001e1bfd23fe36946a2d578c6/test/dummy/config/environments/test.rb | test/dummy/config/environments/test.rb | # frozen_string_literal: true
Rails.application.configure do
config.cache_classes = false
config.eager_load = false
config.active_job.queue_adapter = :inline
end
| ruby | MIT | 76cdd86a78d99b8001e1bfd23fe36946a2d578c6 | 2026-01-04T17:54:31.811968Z | false |
fatkodima/columns_trace | https://github.com/fatkodima/columns_trace/blob/76cdd86a78d99b8001e1bfd23fe36946a2d578c6/lib/columns_trace.rb | lib/columns_trace.rb | # frozen_string_literal: true
require "active_record"
require_relative "columns_trace/created_record"
require_relative "columns_trace/registry"
require_relative "columns_trace/rails_integration"
require_relative "columns_trace/log_reporter"
require_relative "columns_trace/version"
require_relative "columns_trace/rail... | ruby | MIT | 76cdd86a78d99b8001e1bfd23fe36946a2d578c6 | 2026-01-04T17:54:31.811968Z | false |
fatkodima/columns_trace | https://github.com/fatkodima/columns_trace/blob/76cdd86a78d99b8001e1bfd23fe36946a2d578c6/lib/columns_trace/version.rb | lib/columns_trace/version.rb | # frozen_string_literal: true
module ColumnsTrace
VERSION = "0.3.1"
end
| ruby | MIT | 76cdd86a78d99b8001e1bfd23fe36946a2d578c6 | 2026-01-04T17:54:31.811968Z | false |
fatkodima/columns_trace | https://github.com/fatkodima/columns_trace/blob/76cdd86a78d99b8001e1bfd23fe36946a2d578c6/lib/columns_trace/created_record.rb | lib/columns_trace/created_record.rb | # frozen_string_literal: true
module ColumnsTrace
# Class that is used to store metadata about created ActiveRecord records.
class CreatedRecord
# Model class
# @return [Class]
#
attr_reader :model
# Model instance
# @return [ActiveRecord::Base]
#
attr_reader :record
# Backtra... | ruby | MIT | 76cdd86a78d99b8001e1bfd23fe36946a2d578c6 | 2026-01-04T17:54:31.811968Z | false |
fatkodima/columns_trace | https://github.com/fatkodima/columns_trace/blob/76cdd86a78d99b8001e1bfd23fe36946a2d578c6/lib/columns_trace/registry.rb | lib/columns_trace/registry.rb | # frozen_string_literal: true
module ColumnsTrace
# @private
# Note: can use ActiveSupport::IsolatedExecutionState instead of this module for rails 7.0+.
module Registry
class << self
def register(record, backtrace)
state << CreatedRecord.new(record, backtrace)
end
def clear
... | ruby | MIT | 76cdd86a78d99b8001e1bfd23fe36946a2d578c6 | 2026-01-04T17:54:31.811968Z | false |
fatkodima/columns_trace | https://github.com/fatkodima/columns_trace/blob/76cdd86a78d99b8001e1bfd23fe36946a2d578c6/lib/columns_trace/railtie.rb | lib/columns_trace/railtie.rb | # frozen_string_literal: true
module ColumnsTrace
# @private
class Railtie < Rails::Railtie
initializer "columns_trace.set_configs" do
ColumnsTrace.backtrace_cleaner = Rails.backtrace_cleaner
logger = ActiveSupport::Logger.new(Rails.root.join("log", "columns_trace.log"))
ColumnsTrace.reporte... | ruby | MIT | 76cdd86a78d99b8001e1bfd23fe36946a2d578c6 | 2026-01-04T17:54:31.811968Z | false |
fatkodima/columns_trace | https://github.com/fatkodima/columns_trace/blob/76cdd86a78d99b8001e1bfd23fe36946a2d578c6/lib/columns_trace/rails_integration.rb | lib/columns_trace/rails_integration.rb | # frozen_string_literal: true
module ColumnsTrace
ActiveSupport.on_load(:active_record) do
after_find do
backtrace = Kernel.caller
if ColumnsTrace.backtrace_cleaner
backtrace = ColumnsTrace.backtrace_cleaner.call(backtrace)
end
Registry.register(self, backtrace) unless ColumnsTr... | ruby | MIT | 76cdd86a78d99b8001e1bfd23fe36946a2d578c6 | 2026-01-04T17:54:31.811968Z | false |
fatkodima/columns_trace | https://github.com/fatkodima/columns_trace/blob/76cdd86a78d99b8001e1bfd23fe36946a2d578c6/lib/columns_trace/log_reporter.rb | lib/columns_trace/log_reporter.rb | # frozen_string_literal: true
module ColumnsTrace
# Reporter that reports into the provided logger.
class LogReporter
def initialize(logger)
@logger = logger
end
# Main reporter's method
#
# @param title [String] title of the reporting, e.g. controller action etc
# @param created_rec... | ruby | MIT | 76cdd86a78d99b8001e1bfd23fe36946a2d578c6 | 2026-01-04T17:54:31.811968Z | false |
fatkodima/columns_trace | https://github.com/fatkodima/columns_trace/blob/76cdd86a78d99b8001e1bfd23fe36946a2d578c6/lib/columns_trace/sidekiq_integration.rb | lib/columns_trace/sidekiq_integration.rb | # frozen_string_literal: true
module ColumnsTrace
# @private
class SidekiqMiddleware
def call(worker, _job, _queue, &block)
ColumnsTrace.report("#{worker.class.name}#perform", &block)
end
end
end
Sidekiq.configure_server do |config|
config.server_middleware do |chain|
chain.add(ColumnsTrace:... | ruby | MIT | 76cdd86a78d99b8001e1bfd23fe36946a2d578c6 | 2026-01-04T17:54:31.811968Z | false |
adamalbrecht/docx_replace | https://github.com/adamalbrecht/docx_replace/blob/87012115d4316994ff498b5cefabe340a67f7e10/spec/docx_replace_spec.rb | spec/docx_replace_spec.rb | require 'spec_helper'
require 'docx_replace'
require 'zip'
describe DocxReplace::Doc do
let(:output_file) { Tempfile.new('docx_replace_tmp_output') }
let(:output_text) { docx_content(output_file) }
it "replaces a single variable in a very basic document" do
doc = described_class.new(get_fixture("basic.docx"... | ruby | MIT | 87012115d4316994ff498b5cefabe340a67f7e10 | 2026-01-04T17:54:29.790964Z | false |
adamalbrecht/docx_replace | https://github.com/adamalbrecht/docx_replace/blob/87012115d4316994ff498b5cefabe340a67f7e10/spec/spec_helper.rb | spec/spec_helper.rb | RSpec.configure do |config|
config.run_all_when_everything_filtered = true
config.filter_run :focus
# Run specs in random order to surface order dependencies. If you find an
# order dependency and want to debug it, you can fix the order by providing
# the seed, which is printed after each run.
# --seed... | ruby | MIT | 87012115d4316994ff498b5cefabe340a67f7e10 | 2026-01-04T17:54:29.790964Z | false |
adamalbrecht/docx_replace | https://github.com/adamalbrecht/docx_replace/blob/87012115d4316994ff498b5cefabe340a67f7e10/lib/docx_replace.rb | lib/docx_replace.rb | # encoding: UTF-8
require "docx_replace/version"
require 'zip'
require 'tempfile'
module DocxReplace
class Doc
attr_reader :document_content
def initialize(path, temp_dir=nil)
@zip_file = Zip::File.new(path)
@temp_dir = temp_dir
read_docx_file
end
def replace(pattern, replacement... | ruby | MIT | 87012115d4316994ff498b5cefabe340a67f7e10 | 2026-01-04T17:54:29.790964Z | false |
adamalbrecht/docx_replace | https://github.com/adamalbrecht/docx_replace/blob/87012115d4316994ff498b5cefabe340a67f7e10/lib/docx_replace/version.rb | lib/docx_replace/version.rb | module DocxReplace
VERSION = "1.2.1"
end
| ruby | MIT | 87012115d4316994ff498b5cefabe340a67f7e10 | 2026-01-04T17:54:29.790964Z | false |
chesterbr/ruby2600 | https://github.com/chesterbr/ruby2600/blob/7a947c978423b53e9770b54a86a594bcb37906ac/spec/spec_helper.rb | spec/spec_helper.rb | require 'simplecov'
require 'simplecov-gem-adapter'
SimpleCov.start 'gem'
require 'rubygems'
require 'json'
require 'humanize'
require 'timeout'
require 'ruby2600'
require 'support/shared_examples_for_bus.rb'
require 'support/shared_examples_for_cpu.rb'
require 'support/shared_examples_for_riot.rb'
require 'support/s... | ruby | MIT | 7a947c978423b53e9770b54a86a594bcb37906ac | 2026-01-04T17:54:37.265867Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.