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
inch-ci/inch_ci-web
https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/lib/inch_ci/worker/project/update_info.rb
lib/inch_ci/worker/project/update_info.rb
require 'inch_ci/git_hub_info' module InchCI module Worker module Project # The UpdateInfo worker is responsible for updating a project's # meta information, like homepage and documentation URLs. class UpdateInfo include Sidekiq::Worker # @param uid [String] # @return [...
ruby
MIT
db1437218f544e4f21bdfd3690a952bf26a84028
2026-01-04T17:44:13.103953Z
false
inch-ci/inch_ci-web
https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/lib/inch_ci/worker/project/build_json.rb
lib/inch_ci/worker/project/build_json.rb
require 'inch_ci/worker/project/build/handle_worker_output' require 'inch_ci/gossip' require 'open3' require 'json' module InchCI module Worker module Project # The Build worker is responsible for "building" projects, # i.e. cloning and analysing repos, by utilizing a gem called # "inch_ci-work...
ruby
MIT
db1437218f544e4f21bdfd3690a952bf26a84028
2026-01-04T17:44:13.103953Z
false
inch-ci/inch_ci-web
https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/lib/inch_ci/worker/project/build_tags.rb
lib/inch_ci/worker/project/build_tags.rb
module InchCI module Worker module Project # The BuildTags worker is responsible for "building" projects, # i.e. cloning the repo, getting all tag names and then # analysing each revision. module BuildTags # @param url [String] # @param branch_name [String] # @retur...
ruby
MIT
db1437218f544e4f21bdfd3690a952bf26a84028
2026-01-04T17:44:13.103953Z
false
inch-ci/inch_ci-web
https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/lib/inch_ci/worker/project/update_hook.rb
lib/inch_ci/worker/project/update_hook.rb
require 'inch_ci/git_hub_info' module InchCI module Worker module Project # The UpdateInfo worker is responsible for updating a project's # meta information, like homepage and documentation URLs. class UpdateHook include Sidekiq::Worker REBUILD_URL_PATTERN = /https*\:\/\/inch-c...
ruby
MIT
db1437218f544e4f21bdfd3690a952bf26a84028
2026-01-04T17:44:13.103953Z
false
inch-ci/inch_ci-web
https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/lib/inch_ci/worker/project/build/save_build_data.rb
lib/inch_ci/worker/project/build/save_build_data.rb
require 'inch_ci/repo_url' require 'inch_ci/worker/project/build/calculate_diff' require 'inch_ci/worker/project/build/generate_badge' module InchCI module Worker module Project module Build class SaveBuildData DUPLICATE_STATUS = 'duplicate' def self.call(*args) new...
ruby
MIT
db1437218f544e4f21bdfd3690a952bf26a84028
2026-01-04T17:44:13.103953Z
false
inch-ci/inch_ci-web
https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/lib/inch_ci/worker/project/build/generate_badge.rb
lib/inch_ci/worker/project/build/generate_badge.rb
require 'fileutils' require 'inch_ci/badge' require 'inch_ci/grade_list_collection' module InchCI module Worker module Project module Build class GenerateBadge def self.call(*args) new(*args) end def initialize(project, branch, code_objects) Ba...
ruby
MIT
db1437218f544e4f21bdfd3690a952bf26a84028
2026-01-04T17:44:13.103953Z
false
inch-ci/inch_ci-web
https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/lib/inch_ci/worker/project/build/handle_worker_output.rb
lib/inch_ci/worker/project/build/handle_worker_output.rb
require 'yaml' require 'inch_ci/worker/project/build/save_build_data' module InchCI module Worker module Project module Build class HandleWorkerOutput def initialize(stdout, stderr, build = nil, save_service = SaveBuildData) data = handle_stdout(stdout) if data && ...
ruby
MIT
db1437218f544e4f21bdfd3690a952bf26a84028
2026-01-04T17:44:13.103953Z
false
inch-ci/inch_ci-web
https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/lib/inch_ci/worker/project/build/calculate_diff.rb
lib/inch_ci/worker/project/build/calculate_diff.rb
require 'inch_ci/diff' module InchCI module Worker module Project module Build class CalculateDiff attr_reader :diff def self.call(*args) new(*args).diff end def initialize(revision1, revision2) objects1 = if revision1 ...
ruby
MIT
db1437218f544e4f21bdfd3690a952bf26a84028
2026-01-04T17:44:13.103953Z
false
inch-ci/inch_ci-web
https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/config/application.rb
config/application.rb
require File.expand_path('../boot', __FILE__) require 'rails/all' # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) module InchCI class Application < Rails::Application # Settings in config/environments/* take preced...
ruby
MIT
db1437218f544e4f21bdfd3690a952bf26a84028
2026-01-04T17:44:13.103953Z
false
inch-ci/inch_ci-web
https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/config/environment.rb
config/environment.rb
# Load the Rails application. require File.expand_path('../application', __FILE__) # Initialize the Rails application. InchCI::Application.initialize!
ruby
MIT
db1437218f544e4f21bdfd3690a952bf26a84028
2026-01-04T17:44:13.103953Z
false
inch-ci/inch_ci-web
https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/config/routes.rb
config/routes.rb
require 'sidekiq/web' InchCI::Application.routes.draw do mount Sidekiq::Web => '/sidekiq' get "/auth/:provider/callback" => "sessions#create" get "/signout" => "sessions#destroy", :as => :signout namespace :api do get 'v1/cli' => 'cli#hint' post 'v1/cli' => 'cli#run' get 'v1/builds' => 'builds#h...
ruby
MIT
db1437218f544e4f21bdfd3690a952bf26a84028
2026-01-04T17:44:13.103953Z
false
inch-ci/inch_ci-web
https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/config/boot.rb
config/boot.rb
# Set up gems listed in the Gemfile. ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
ruby
MIT
db1437218f544e4f21bdfd3690a952bf26a84028
2026-01-04T17:44:13.103953Z
false
inch-ci/inch_ci-web
https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/config/initializers/filter_parameter_logging.rb
config/initializers/filter_parameter_logging.rb
# Be sure to restart your server when you modify this file. # Configure sensitive parameters which will be filtered from the log file. Rails.application.config.filter_parameters += [:password]
ruby
MIT
db1437218f544e4f21bdfd3690a952bf26a84028
2026-01-04T17:44:13.103953Z
false
inch-ci/inch_ci-web
https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/config/initializers/session_store.rb
config/initializers/session_store.rb
# Be sure to restart your server when you modify this file. InchCI::Application.config.session_store :cookie_store, key: '_inch_ci-web_session'
ruby
MIT
db1437218f544e4f21bdfd3690a952bf26a84028
2026-01-04T17:44:13.103953Z
false
inch-ci/inch_ci-web
https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/config/initializers/requires.rb
config/initializers/requires.rb
require 'inch_ci/config' require 'inch_ci/store' require 'inch_ci/worker/project' require 'inch_ci/worker/user'
ruby
MIT
db1437218f544e4f21bdfd3690a952bf26a84028
2026-01-04T17:44:13.103953Z
false
inch-ci/inch_ci-web
https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/config/initializers/wrap_parameters.rb
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
db1437218f544e4f21bdfd3690a952bf26a84028
2026-01-04T17:44:13.103953Z
false
inch-ci/inch_ci-web
https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/config/initializers/omniauth.rb
config/initializers/omniauth.rb
require 'inch_ci/access_token' if InchCI::AccessToken[:github_client_id] Rails.application.config.middleware.use OmniAuth::Builder do provider :github, InchCI::AccessToken[:github_client_id], InchCI::AccessToken[:github_secret], :scope => 'user:email,write:repo_hook,read:org' end end
ruby
MIT
db1437218f544e4f21bdfd3690a952bf26a84028
2026-01-04T17:44:13.103953Z
false
inch-ci/inch_ci-web
https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/config/initializers/inflections.rb
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
db1437218f544e4f21bdfd3690a952bf26a84028
2026-01-04T17:44:13.103953Z
false
inch-ci/inch_ci-web
https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/config/initializers/featured_projects.rb
config/initializers/featured_projects.rb
FEATURED_PROJECT_UIDS = { ruby: %w( github:bbatsov/rubocop github:bundler/bundler github:guard/guard github:haml/haml github:justinfrench/formtastic github:mbj/mutant github:peek/peek github:pry/pry github:redis/redis-rb github:rkh/mustermann github:rom-rb/rom github:sf...
ruby
MIT
db1437218f544e4f21bdfd3690a952bf26a84028
2026-01-04T17:44:13.103953Z
false
inch-ci/inch_ci-web
https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/config/initializers/sentry.rb
config/initializers/sentry.rb
require 'raven'
ruby
MIT
db1437218f544e4f21bdfd3690a952bf26a84028
2026-01-04T17:44:13.103953Z
false
inch-ci/inch_ci-web
https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/config/initializers/backtrace_silencers.rb
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
db1437218f544e4f21bdfd3690a952bf26a84028
2026-01-04T17:44:13.103953Z
false
inch-ci/inch_ci-web
https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/config/initializers/mime_types.rb
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 # Mime::Type.register_alias "text/html", :iphone
ruby
MIT
db1437218f544e4f21bdfd3690a952bf26a84028
2026-01-04T17:44:13.103953Z
false
inch-ci/inch_ci-web
https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/config/initializers/secret_token.rb
config/initializers/secret_token.rb
# Be sure to restart your server when you modify this file. # Your secret key is used for verifying the integrity of signed cookies. # If you change this key, all old signed cookies will become invalid! # Make sure the secret is at least 30 characters and all random, # no regular words or you'll be exposed to diction...
ruby
MIT
db1437218f544e4f21bdfd3690a952bf26a84028
2026-01-04T17:44:13.103953Z
false
inch-ci/inch_ci-web
https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/config/environments/test.rb
config/environments/test.rb
InchCI::Application.configure do # Settings specified here will take precedence over those in config/application.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 su...
ruby
MIT
db1437218f544e4f21bdfd3690a952bf26a84028
2026-01-04T17:44:13.103953Z
false
inch-ci/inch_ci-web
https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/config/environments/development.rb
config/environments/development.rb
InchCI::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 se...
ruby
MIT
db1437218f544e4f21bdfd3690a952bf26a84028
2026-01-04T17:44:13.103953Z
false
inch-ci/inch_ci-web
https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/config/environments/production.rb
config/environments/production.rb
InchCI::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 thread web serve...
ruby
MIT
db1437218f544e4f21bdfd3690a952bf26a84028
2026-01-04T17:44:13.103953Z
false
rich/acts_as_revisable
https://github.com/rich/acts_as_revisable/blob/32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf/rails/init.rb
rails/init.rb
require 'acts_as_revisable'
ruby
MIT
32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf
2026-01-04T17:44:21.594614Z
false
rich/acts_as_revisable
https://github.com/rich/acts_as_revisable/blob/32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf/generators/revisable_migration/revisable_migration_generator.rb
generators/revisable_migration/revisable_migration_generator.rb
class RevisableMigrationGenerator < Rails::Generator::NamedBase def manifest record do |m| revisable_columns = [ ["revisable_original_id", "integer"], ["revisable_branched_from_id", "integer"], ["revisable_number", "integer", 0], ["revisable_name", ...
ruby
MIT
32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf
2026-01-04T17:44:21.594614Z
false
rich/acts_as_revisable
https://github.com/rich/acts_as_revisable/blob/32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf/generators/revisable_migration/templates/migration.rb
generators/revisable_migration/templates/migration.rb
<% table_name = class_name.underscore.pluralize -%> class Make<%= class_name.underscore.pluralize.camelize %>Revisable < ActiveRecord::Migration def self.up <% cols.each do |column_name,column_type,default| -%> add_column :<%= table_name %>, :<%= column_name %>, :<%= column_type %><%= ", :default => #{default...
ruby
MIT
32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf
2026-01-04T17:44:21.594614Z
false
rich/acts_as_revisable
https://github.com/rich/acts_as_revisable/blob/32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf/spec/deletable_spec.rb
spec/deletable_spec.rb
require File.dirname(__FILE__) + '/spec_helper.rb' describe WithoutScope::ActsAsRevisable::Deletable do after(:each) do cleanup_db end before(:each) do @person = Person.create(:name => "Rich", :notes => "a note") @person.update_attribute(:name, "Sam") end it "should store a revision on ...
ruby
MIT
32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf
2026-01-04T17:44:21.594614Z
false
rich/acts_as_revisable
https://github.com/rich/acts_as_revisable/blob/32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf/spec/revert_spec.rb
spec/revert_spec.rb
require File.dirname(__FILE__) + '/spec_helper.rb' describe WithoutScope::ActsAsRevisable, "with reverting" do after(:each) do cleanup_db end before(:each) do @project = Project.create(:name => "Rich", :notes => "a note") @project.update_attribute(:name, "Sam") end it "should let you reve...
ruby
MIT
32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf
2026-01-04T17:44:21.594614Z
false
rich/acts_as_revisable
https://github.com/rich/acts_as_revisable/blob/32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf/spec/general_spec.rb
spec/general_spec.rb
require File.dirname(__FILE__) + '/spec_helper.rb' describe WithoutScope::ActsAsRevisable do after(:each) do cleanup_db end before(:each) do @project = Project.create(:name => "Rich", :notes => "this plugin's author") @post = Post.create(:name => 'a name') end describe "with auto-detect...
ruby
MIT
32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf
2026-01-04T17:44:21.594614Z
false
rich/acts_as_revisable
https://github.com/rich/acts_as_revisable/blob/32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf/spec/quoted_columns_spec.rb
spec/quoted_columns_spec.rb
require File.dirname(__FILE__) + '/spec_helper.rb' describe "the quoted_columns extension" do after(:each) do cleanup_db end it "should quote symbols matching column names as columns" do Project.send(:quote_bound_value, :name).should == %q{"projects"."name"} end it "should not quote symbo...
ruby
MIT
32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf
2026-01-04T17:44:21.594614Z
false
rich/acts_as_revisable
https://github.com/rich/acts_as_revisable/blob/32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf/spec/validations_spec.rb
spec/validations_spec.rb
require File.dirname(__FILE__) + '/spec_helper.rb' describe WithoutScope::ActsAsRevisable, "with validations" do after(:each) do cleanup_db end before(:each) do @post = Post.create(:name => 'a post') @foo = Foo.create(:name => 'a foo') end describe "unique fields" do it "should a...
ruby
MIT
32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf
2026-01-04T17:44:21.594614Z
false
rich/acts_as_revisable
https://github.com/rich/acts_as_revisable/blob/32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf/spec/sti_spec.rb
spec/sti_spec.rb
require File.dirname(__FILE__) + '/spec_helper.rb' describe WithoutScope::ActsAsRevisable, "with single table inheritance" do after(:each) do cleanup_db end before(:each) do @article = Article.create(:name => 'an article') @post = Post.create(:name => 'a post') end describe "after a revis...
ruby
MIT
32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf
2026-01-04T17:44:21.594614Z
false
rich/acts_as_revisable
https://github.com/rich/acts_as_revisable/blob/32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf/spec/find_spec.rb
spec/find_spec.rb
require File.dirname(__FILE__) + '/spec_helper.rb' describe WithoutScope::ActsAsRevisable do after(:each) do cleanup_db end describe "with a single revision" do before(:each) do @project1 = Project.create(:name => "Rich", :notes => "a note") @project1.update_attribute(:name, "Sam") ...
ruby
MIT
32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf
2026-01-04T17:44:21.594614Z
false
rich/acts_as_revisable
https://github.com/rich/acts_as_revisable/blob/32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf/spec/associations_spec.rb
spec/associations_spec.rb
require File.dirname(__FILE__) + '/spec_helper.rb' describe WithoutScope::ActsAsRevisable do after(:each) do cleanup_db end before(:each) do @project = Project.create(:name => "Rich", :notes => "this plugin's author") @project.update_attribute(:name, "one") @project.update_attribute(:name,...
ruby
MIT
32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf
2026-01-04T17:44:21.594614Z
false
rich/acts_as_revisable
https://github.com/rich/acts_as_revisable/blob/32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf/spec/spec_helper.rb
spec/spec_helper.rb
begin require 'spec' rescue LoadError require 'rubygems' gem 'rspec' require 'spec' end if ENV['EDGE_RAILS_PATH'] edge_path = File.expand_path(ENV['EDGE_RAILS_PATH']) require File.join(edge_path, 'activesupport', 'lib', 'active_support') require File.join(edge_path, 'activerecord', 'lib', 'active_record'...
ruby
MIT
32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf
2026-01-04T17:44:21.594614Z
false
rich/acts_as_revisable
https://github.com/rich/acts_as_revisable/blob/32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf/spec/branch_spec.rb
spec/branch_spec.rb
require File.dirname(__FILE__) + '/spec_helper.rb' class Project validates_presence_of :name end describe WithoutScope::ActsAsRevisable, "with branching" do after(:each) do cleanup_db end before(:each) do @project = Project.create(:name => "Rich", :notes => "a note") @project.update_attribu...
ruby
MIT
32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf
2026-01-04T17:44:21.594614Z
false
rich/acts_as_revisable
https://github.com/rich/acts_as_revisable/blob/32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf/spec/options_spec.rb
spec/options_spec.rb
require File.dirname(__FILE__) + '/spec_helper.rb' shared_examples_for "common Options usage" do it "should return a set value" do @options.one.should == 1 end it "should return nil for an unset value" do @options.two.should be_nil end it "should return false for unset query option" do @opt...
ruby
MIT
32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf
2026-01-04T17:44:21.594614Z
false
rich/acts_as_revisable
https://github.com/rich/acts_as_revisable/blob/32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf/lib/acts_as_revisable.rb
lib/acts_as_revisable.rb
$:.unshift(File.dirname(__FILE__)) unless $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__))) require 'activesupport' unless defined? ActiveSupport require 'activerecord' unless defined? ActiveRecord require 'acts_as_revisable/version.rb' require 'acts_as_revisable/base' Ac...
ruby
MIT
32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf
2026-01-04T17:44:21.594614Z
false
rich/acts_as_revisable
https://github.com/rich/acts_as_revisable/blob/32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf/lib/acts_as_revisable/version.rb
lib/acts_as_revisable/version.rb
module WithoutScope #:nodoc: module ActsAsRevisable module VERSION #:nodoc: MAJOR = 1 MINOR = 1 TINY = 1 STRING = [MAJOR, MINOR, TINY].join('.') end end end
ruby
MIT
32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf
2026-01-04T17:44:21.594614Z
false
rich/acts_as_revisable
https://github.com/rich/acts_as_revisable/blob/32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf/lib/acts_as_revisable/gem_spec_options.rb
lib/acts_as_revisable/gem_spec_options.rb
module WithoutScope #:nodoc: module ActsAsRevisable class GemSpecOptions HASH = { :name => "rich-acts_as_revisable", :version => WithoutScope::ActsAsRevisable::VERSION::STRING, :summary => "acts_as_revisable enables revision tracking, querying, reverting and branching of ActiveRecord...
ruby
MIT
32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf
2026-01-04T17:44:21.594614Z
false
rich/acts_as_revisable
https://github.com/rich/acts_as_revisable/blob/32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf/lib/acts_as_revisable/options.rb
lib/acts_as_revisable/options.rb
module WithoutScope module ActsAsRevisable # This class provides for a flexible method of setting # options and querying them. This is especially useful # for giving users flexibility when using your plugin. class Options def initialize(*options, &block) @options = options.extract_option...
ruby
MIT
32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf
2026-01-04T17:44:21.594614Z
false
rich/acts_as_revisable
https://github.com/rich/acts_as_revisable/blob/32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf/lib/acts_as_revisable/validations.rb
lib/acts_as_revisable/validations.rb
module WithoutScope module ActsAsRevisable module Validations def validates_uniqueness_of(*args) options = args.extract_options! (options[:scope] ||= []) << :revisable_is_current super(*(args << options)) end end end end
ruby
MIT
32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf
2026-01-04T17:44:21.594614Z
false
rich/acts_as_revisable
https://github.com/rich/acts_as_revisable/blob/32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf/lib/acts_as_revisable/base.rb
lib/acts_as_revisable/base.rb
require 'acts_as_revisable/options' require 'acts_as_revisable/quoted_columns' require 'acts_as_revisable/validations' require 'acts_as_revisable/acts/common' require 'acts_as_revisable/acts/revision' require 'acts_as_revisable/acts/revisable' require 'acts_as_revisable/acts/deletable' module WithoutScope # define t...
ruby
MIT
32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf
2026-01-04T17:44:21.594614Z
false
rich/acts_as_revisable
https://github.com/rich/acts_as_revisable/blob/32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf/lib/acts_as_revisable/quoted_columns.rb
lib/acts_as_revisable/quoted_columns.rb
# This module is more about the pretty than anything else. This allows # you to use symbols for column names in a conditions hash. # # User.find(:all, :conditions => ["? = ?", :name, "sam"]) # # Would generate: # # select * from users where "users"."name" = 'sam' # # This is consistent with Rails and Ruby where ...
ruby
MIT
32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf
2026-01-04T17:44:21.594614Z
false
rich/acts_as_revisable
https://github.com/rich/acts_as_revisable/blob/32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf/lib/acts_as_revisable/acts/common.rb
lib/acts_as_revisable/acts/common.rb
module WithoutScope module ActsAsRevisable # This module is mixed into the revision and revisable classes. # # ==== Callbacks # # * +before_branch+ is called on the +Revisable+ or +Revision+ that is # being branched # * +after_branch+ is called on the +Revisable+ or +Revision+ that is...
ruby
MIT
32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf
2026-01-04T17:44:21.594614Z
false
rich/acts_as_revisable
https://github.com/rich/acts_as_revisable/blob/32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf/lib/acts_as_revisable/acts/revision.rb
lib/acts_as_revisable/acts/revision.rb
module WithoutScope module ActsAsRevisable # This module is mixed into the revision classes. # # ==== Callbacks # # * +before_restore+ is called on the revision class before it is # restored as the current record. # * +after_restore+ is called on the revision class after it is # ...
ruby
MIT
32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf
2026-01-04T17:44:21.594614Z
false
rich/acts_as_revisable
https://github.com/rich/acts_as_revisable/blob/32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf/lib/acts_as_revisable/acts/deletable.rb
lib/acts_as_revisable/acts/deletable.rb
module WithoutScope module ActsAsRevisable module Deletable def self.included(base) base.instance_eval do define_callbacks :before_revise_on_destroy, :after_revise_on_destroy end end def destroy now = Time.current prev = self.revi...
ruby
MIT
32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf
2026-01-04T17:44:21.594614Z
false
rich/acts_as_revisable
https://github.com/rich/acts_as_revisable/blob/32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf/lib/acts_as_revisable/acts/revisable.rb
lib/acts_as_revisable/acts/revisable.rb
module WithoutScope module ActsAsRevisable # This module is mixed into the revision classes. # # ==== Callbacks # # * +before_revise+ is called before the record is revised. # * +after_revise+ is called after the record is revised. # * +before_revert+ is called before the record is ...
ruby
MIT
32b7d3d5f198a3ba81a5bba3a94ad04b69d9c1bf
2026-01-04T17:44:21.594614Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/app/helpers/application_helper.rb
app/helpers/application_helper.rb
# Methods added to this helper will be available to all templates in the application. module ApplicationHelper def github_url_for_sha1(sha1) "https://github.com/rails/rails/commit/#{sha1}" end def github_url_for_tag(tag) "https://github.com/rails/rails/tree/#{tag}" end def link_to_commit_in_github(c...
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/app/controllers/contributors_controller.rb
app/controllers/contributors_controller.rb
class ContributorsController < ApplicationController caches_page :index, :in_time_window, :in_edge def index @contributors = if params[:release_id].present? set_release Contributor.all_with_ncommits_by_release(@release) else Contributor.all_with_ncommits end end def in_time_windo...
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/app/controllers/faqs_controller.rb
app/controllers/faqs_controller.rb
class FaqsController < ApplicationController caches_page :show def show end end
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/app/controllers/commits_controller.rb
app/controllers/commits_controller.rb
class CommitsController < ApplicationController caches_page :index, :in_time_window, :in_release, :in_edge before_action :set_target, only: %w(index in_release) before_action :set_contributor, only: %w(in_edge in_time_window) before_action :set_time_constraints, only: 'in_time_window' def index @commits...
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/app/controllers/releases_controller.rb
app/controllers/releases_controller.rb
class ReleasesController < ApplicationController caches_page :index def index @releases = Release.all_with_ncommits_and_ncontributors end end
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/app/controllers/application_controller.rb
app/controllers/application_controller.rb
class ApplicationController < ActionController::Base before_action :trace_user_agent private def set_contributor @contributor = Contributor.find_by_param(params[:contributor_id]) head :not_found unless @contributor end def set_release @release = Release.find_by_param(params[:release_id]) head ...
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/app/models/repo_update.rb
app/models/repo_update.rb
class RepoUpdate < ApplicationRecord end
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/app/models/release.rb
app/models/release.rb
class Release < ApplicationRecord include Comparable has_many :commits, :dependent => :nullify has_many :contributors, :through => :commits scope :sorted, -> { order('releases.major DESC, releases.minor DESC, releases.tiny DESC, releases.patch DESC') } validates :tag, presence: true, uniqueness: true...
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/app/models/contribution.rb
app/models/contribution.rb
class Contribution < ApplicationRecord belongs_to :contributor belongs_to :commit end
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/app/models/contributor.rb
app/models/contributor.rb
class Contributor < ApplicationRecord has_many :contributions, dependent: :destroy has_many :commits, through: :contributions validates :name, presence: true, uniqueness: true validates :url_id, presence: true, uniqueness: true nfc :name scope :with_no_commits, -> { left_joins(:contributions).where...
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/app/models/time_constraints.rb
app/models/time_constraints.rb
module TimeConstraints ALL = { 'all-time' => 'All time', 'today' => 'Today', 'this-week' => 'This week', 'this-month' => 'This month', 'this-year' => 'This year', } DATE_RANGE = /\A(\d+)(?:-(\d+))?\z/ def self.all ALL end def self.label_for(key) ALL[key] || 'Date Rang...
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/app/models/application_record.rb
app/models/application_record.rb
class ApplicationRecord < ActiveRecord::Base self.abstract_class = true end
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/app/models/names_manager.rb
app/models/names_manager.rb
require 'set' module NamesManager extend HardCodedAuthors extend FalsePositives extend CanonicalNames # Determines whether any heuristic has been updated since +ts+. def self.updated_since?(ts) [__FILE__, *Dir.glob("#{__dir__}/names_manager/*.rb")].any? do |filename| File.mtime(filename) > ts ...
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/app/models/repo.rb
app/models/repo.rb
require 'application_utils' class Repo attr_reader :logger, :path, :heads, :tags, :repo, :rebuild_all # Clone with --mirror: # # git clone --mirror git://github.com/rails/rails.git # PATH = "#{Rails.root}/rails.git" HEADS = %r{\Arefs/heads/(main|[\d\-]+(-stable)?)\z} TAGS = %r{\Arefs/tags/v[\d.]+\...
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/app/models/commit.rb
app/models/commit.rb
# frozen-string-literal: true class Commit < ApplicationRecord has_many :contributions, dependent: :destroy has_many :contributors, through: :contributions belongs_to :release, optional: true scope :with_no_contributors, -> { select('commits.*'). # otherwise we get read-only records left_joins(:contri...
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/app/models/names_manager/false_positives.rb
app/models/names_manager/false_positives.rb
module NamesManager module FalsePositives CONNECTORS_REGEXP = %r{(?:[,/&+]|\band\b)} # Returns +nil+ if +name+ is known *not* to correspond to an author, the # author name(s) if special handling applies, like multiple authors separated # by a connector. If nothing applies, returns +name+ back. # ...
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/app/models/names_manager/canonical_names.rb
app/models/names_manager/canonical_names.rb
module NamesManager module CanonicalNames # Returns the canonical name for +name+. # # Email addresses are removed, leading/trailing whitespace and # surrounding Markdown *s are deleted. If no equivalence is known # the canonical name is the resulting sanitized string by definition. def canoni...
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
true
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/app/models/names_manager/hard_coded_authors.rb
app/models/names_manager/hard_coded_authors.rb
module NamesManager module HardCodedAuthors # Sometimes the information to give credit for some commits is just not # present in the repository, or is present in a way the application does # not understand. This method has a hard-coded list of contributor names # for those commits. # # See the...
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/db/seeds.rb
db/seeds.rb
# This file should contain all the record creation needed to seed the database with its default values. # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). # # Examples: # # cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }]) # Mayor.create(:name =>...
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/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
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/db/migrate/20160512095609_rename_nmupdated.rb
db/migrate/20160512095609_rename_nmupdated.rb
class RenameNmupdated < ActiveRecord::Migration[4.2] def change rename_column :repo_updates, :nmupdated, :rebuild_all end end
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/db/migrate/20150326181907_add_first_contribution_at_to_contributors.rb
db/migrate/20150326181907_add_first_contribution_at_to_contributors.rb
class AddFirstContributionAtToContributors < ActiveRecord::Migration[4.2] def up add_column :contributors, :first_contribution_at, :datetime Contributor.try(:fill_missing_first_contribution_timestamps) end def down remove_column :contributors, :first_contribution_at end end
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/db/migrate/20141101094005_initial_schema.rb
db/migrate/20141101094005_initial_schema.rb
class InitialSchema < ActiveRecord::Migration[4.2] def up create_table :commits do |t| t.string :sha1, null: false t.string :author_email, null: false t.string :author_name, null: false t.datetime :author_date, null: false t.string :committer_email, null...
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/test/application_system_test_case.rb
test/application_system_test_case.rb
require "test_helper" class ApplicationSystemTestCase < ActionDispatch::SystemTestCase driven_by :selenium, using: :chrome, screen_size: [1400, 1400] end
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/test/test_helper.rb
test/test_helper.rb
require File.expand_path('../../config/environment', __FILE__) require 'rails/test_help' require_relative 'support/assert_contributor_names' class ActiveSupport::TestCase TODAY = Time.zone.parse('2012-12-26') fixtures :all def time_travel(&block) travel_to(TODAY, &block) end def read_fixture(name) ...
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/test/credits/wanted_aliases_test.rb
test/credits/wanted_aliases_test.rb
require 'test_helper' # These are aliases the application should not map to real names because # authors requested it. This suite prevents future passes resolving aliases # from forgetting this commitment. module Credits class WantedAliasesTest < ActiveSupport::TestCase include AssertContributorNames test '...
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/test/credits/cleanup_test.rb
test/credits/cleanup_test.rb
require 'test_helper' module Credits class CleanupTest < ActiveSupport::TestCase include AssertContributorNames # CHANGELOG has "[François Beausoleil <...>, Blair Zajac <...>]". test 'names get email addresses stripped' do assert_contributor_names 'dfda57a', 'François Beausoleil', 'Blair Zajac' ...
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/test/credits/hard_coded_authors_test.rb
test/credits/hard_coded_authors_test.rb
require 'test_helper' module Credits class SpecialCasedCommitsTest < ActiveSupport::TestCase include AssertContributorNames test 'special-cased commits' do assert_contributor_names '1382f4d', 'David Burger', 'Dana Jones' assert_contributor_names '882dd4e', 'David Calavera' assert_contribut...
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/test/credits/false_positives_test.rb
test/credits/false_positives_test.rb
require 'test_helper' # Heuristics sometimes yield contributor names we know are false positives. # # For example, "[DHH]" in a commit message means David should be credited, # but "[Sean Griffin & ysbaddaden]" or "[ci skip]" need special handling. module Credits class FalsePositivesTest < ActiveSupport::TestCase ...
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/test/credits/heuristics_test.rb
test/credits/heuristics_test.rb
require 'test_helper' module Credits class HeuristicsTest < ActiveSupport::TestCase include AssertContributorNames # Example from 1c47d04: # # Added Object#presence that returns the object if it's #present? otherwise returns nil [DHH/Colin Kelley] # test 'captures credit at the end of the ...
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/test/credits/disambiguation_test.rb
test/credits/disambiguation_test.rb
require 'test_helper' # Some commits need disambiguation to be credited correctly. module Credits class DisambiguationTest < ActiveSupport::TestCase include AssertContributorNames test 'disambiguates abhishek' do assert_contributor_names '21f0c580', 'Abhishek Jain' assert_contributor_names '00e3...
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/test/credits/canonical_names_test.rb
test/credits/canonical_names_test.rb
require 'test_helper' module Credits class CanonicalNamesTest < ActiveSupport::TestCase include AssertContributorNames test 'タコ焼き仮面' do assert_contributor_names '84403ae', 'Takoyaki Kamen' end test '松田 明' do assert_contributor_names 'bb33432', 'Akira Matsuda' end test '簡煒航' do ...
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
true
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/test/support/assert_contributor_names.rb
test/support/assert_contributor_names.rb
require 'set' module AssertContributorNames REPO = Repo.new def assert_contributor_names(sha1, *contributor_names, **options) begin commit = Commit.new_from_rugged_commit(REPO.repo.lookup(sha1)) rescue Rugged::OdbError raise "#{sha1} was not found, please make sure the local Rails checkout is ...
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/test/integration/bot_killer_test.rb
test/integration/bot_killer_test.rb
require 'test_helper' class BotKillerTest < ActionDispatch::IntegrationTest test 'MauiBot is blacklisted' do get '/', headers: { 'User-Agent' => 'MauiBot (crawler.feedback+wc@gmail.com)' } assert_response :not_found end test 'FAST Enterprise is blacklisted' do get '/', headers: { 'User-Agent' => 'FA...
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/test/helpers/application_helper_test.rb
test/helpers/application_helper_test.rb
require 'test_helper' class ApplicationHelperTest < ActionView::TestCase include ApplicationHelper def test_github_url_for_sha1 sha1 = 'd4ab03a8f3c1ea8913ed76bb8653dd9bef6a894f' assert_equal "https://github.com/rails/rails/commit/#{sha1}", github_url_for_sha1(sha1) end def test_github_url_for_tag ...
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/test/controllers/commits_controller_test.rb
test/controllers/commits_controller_test.rb
require 'test_helper' class CommitsControllerTest < ActionController::TestCase def test_index_for_releases cases = [ [releases(:v3_2_0), Array(commits(:commit_6c65676, :commit_5b90635))], [releases(:v2_3_2), []], [releases(:v0_14_4), Array(commits(:commit_e0ef631))], ] cases.each do ...
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/test/controllers/releases_controller_test.rb
test/controllers/releases_controller_test.rb
require 'test_helper' class ReleasesControllerTest < ActionController::TestCase def test_index get :index assert_response :success assert_select 'span.listing-total', 'Showing 5 releases' expected = %w( v3_2_0 v2_3_2_1 v2_3_2 v1_0_0 v0_14_4 ).map {|_| releases(_)} ...
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/test/controllers/contributors_controller_test.rb
test/controllers/contributors_controller_test.rb
require 'test_helper' class ContributorsControllerTest < ActionController::TestCase def test_index_main_listing # Order by ncommits DESC, url_id ASC. expected = [[:jeremy, 3], [:david, 2], [:jose, 1], [:vijay, 1], [:xavier, 1]] get :index assert_response :success actual = assigns(:contributors...
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/test/models/time_constraints_test.rb
test/models/time_constraints_test.rb
require 'test_helper' class TimeConstraintsTest < ActiveSupport::TestCase def assert_time_window(actual, since = nil, upto = nil) [[since, :since], [upto, :upto]].each do |expected, key| # Written this way because assert_equal(nil, nil) fails in MT6. if expected.nil? assert_nil actual[key] ...
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/test/models/names_manager_test.rb
test/models/names_manager_test.rb
# The names manager has no unit tests. # # In general, the application does not care about the exact methods used to # give credit to contributors. Rather, we want to make sure a selected number # of commits get their credit right. # # Please check the test/credits directory for integration coverage.
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/test/models/contributor_test.rb
test/models/contributor_test.rb
require 'test_helper' require 'set' class ContributorTest < ActiveSupport::TestCase def test_the_name_writer_sets_url_id c = Contributor.new(name: 'Jeremy Daer') assert_equal 'jeremy-daer', c.url_id end def test_to_param_returns_the_url_id c = contributors(:jeremy) assert_equal c.url_id, c.to_pa...
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/test/models/parameterize_test.rb
test/models/parameterize_test.rb
# encoding: utf-8 require 'test_helper' class ParameterizeTest < ActiveSupport::TestCase test "normalizes special cases" do assert_equal 'sorensen', 'Sørensen'.parameterize assert_equal 'weierstrass', 'Weierstraß'.parameterize end test "delegates normalization of accented letters and friends" do as...
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/test/models/repo_test.rb
test/models/repo_test.rb
require 'test_helper' class RepoTest < ActiveSupport::TestCase test '#sync_ranks' do Repo.new.send(:sync_ranks) {jeremy: 1, david: 2, jose: 3, xavier: 3, vijay: 3}.each do |c, r| assert_equal r, contributors(c).rank end end test '#sync_first_contributed_timestamps' do Contributor.update_a...
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/test/models/release_test.rb
test/models/release_test.rb
require 'test_helper' require 'set' class ReleaseTest < ActiveSupport::TestCase def check_version_split(tag, major=0, minor=0, tiny=0, patch=0) r = Release.new(tag: tag) assert_equal major, r.major assert_equal minor, r.minor assert_equal tiny, r.tiny assert_equal patch, r.patch end def orde...
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/test/models/nfc_attribute_normalizer_test.rb
test/models/nfc_attribute_normalizer_test.rb
require 'test_helper' class NFCAttributeNormalizerTest < ActiveSupport::TestCase A_GRAVE_NFC = "\u00c0" A_GRAVE_NON_NFC = "\u0041\u0300" NON_VALID = "\xa9" NORMALIZER = Class.new do extend NFCAttributeNormalizer nfc :title, :body def initialize @values = {} end def write...
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/test/models/commit_test.rb
test/models/commit_test.rb
# frozen-string-literal: true require 'test_helper' require 'ostruct' class CommitTest < ActiveSupport::TestCase def extract_contributor_names_from_text(commit, text) commit.send(:extract_contributor_names_from_text, text) end def extract_changelog(commit) commit.send(:extract_changelog) end def o...
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/lib/bot_killer.rb
lib/bot_killer.rb
class BotKiller BLACKLISTED_BOTS = %r{ FAST | MauiBot }xi def initialize(app) @app = app end def call(env) request = Rack::Request.new(env) if request.user_agent =~ BLACKLISTED_BOTS [404, {}, ["Not found"]] else @app.call(env) end end end
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/lib/application_utils.rb
lib/application_utils.rb
require 'fileutils' module ApplicationUtils def self.acquiring_lock_file(basename) abs_name = File.join(tmpdir, basename) lock_file = File.open(abs_name, File::CREAT | File::EXCL | File::WRONLY) Rails.logger.info("acquired lock file #{basename}") lock_file.write("#{$$}\n") begin yield e...
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false
rails/rails-contributors
https://github.com/rails/rails-contributors/blob/dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9/lib/nfc_attribute_normalizer.rb
lib/nfc_attribute_normalizer.rb
# Not very clever, but will do for what we need. module NFCAttributeNormalizer def nfc(*attribute_names) include Module.new { attribute_names.each do |name| module_eval <<-EOS def #{name}=(value) value = value.to_s.scrub.nfc unless value.nil? write_attribute(#{name....
ruby
MIT
dc10cffec6a3e3680e704bf0ddfed5c54cb3cdc9
2026-01-04T17:44:10.559232Z
false