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 |
|---|---|---|---|---|---|---|---|---|
ruby/rake | https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/lib/rake/clean.rb | lib/rake/clean.rb | # frozen_string_literal: true
# The 'rake/clean' file defines two file lists (CLEAN and CLOBBER) and
# two rake tasks (:clean and :clobber).
#
# [:clean] Clean up the project by deleting scratch files and backup
# files. Add files to the CLEAN file list to have the :clean
# target handle them.
#
# [:... | ruby | MIT | 34c6b3e9b807e3574c66f38337b47c2cfd7ace48 | 2026-01-04T15:55:38.335769Z | false |
ruby/rake | https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/lib/rake/rule_recursion_overflow_error.rb | lib/rake/rule_recursion_overflow_error.rb | # frozen_string_literal: true
module Rake
# Error indicating a recursion overflow error in task selection.
class RuleRecursionOverflowError < StandardError
def initialize(*args)
super
@targets = []
end
def add_target(target)
@targets << target
end
def message
super + "... | ruby | MIT | 34c6b3e9b807e3574c66f38337b47c2cfd7ace48 | 2026-01-04T15:55:38.335769Z | false |
ruby/rake | https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/lib/rake/version.rb | lib/rake/version.rb | # frozen_string_literal: true
module Rake
VERSION = "13.3.1"
module Version # :nodoc: all
MAJOR, MINOR, BUILD, *OTHER = Rake::VERSION.split "."
NUMBERS = [MAJOR, MINOR, BUILD, *OTHER]
end
end
| ruby | MIT | 34c6b3e9b807e3574c66f38337b47c2cfd7ace48 | 2026-01-04T15:55:38.335769Z | false |
ruby/rake | https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/lib/rake/dsl_definition.rb | lib/rake/dsl_definition.rb | # frozen_string_literal: true
# Rake DSL functions.
require_relative "file_utils_ext"
module Rake
##
# DSL is a module that provides #task, #desc, #namespace, etc. Use this
# when you'd like to use rake outside the top level scope.
#
# For a Rakefile you run from the command line this module is automatical... | ruby | MIT | 34c6b3e9b807e3574c66f38337b47c2cfd7ace48 | 2026-01-04T15:55:38.335769Z | false |
ruby/rake | https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/lib/rake/default_loader.rb | lib/rake/default_loader.rb | # frozen_string_literal: true
module Rake
# Default Rakefile loader used by +import+.
class DefaultLoader
##
# Loads a rakefile into the current application from +fn+
def load(fn)
Rake.load_rakefile(File.expand_path(fn))
end
end
end
| ruby | MIT | 34c6b3e9b807e3574c66f38337b47c2cfd7ace48 | 2026-01-04T15:55:38.335769Z | false |
ruby/rake | https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/lib/rake/application.rb | lib/rake/application.rb | # frozen_string_literal: true
require "optparse"
require_relative "task_manager"
require_relative "file_list"
require_relative "thread_pool"
require_relative "thread_history_display"
require_relative "trace_output"
require_relative "win32"
module Rake
CommandLineOptionError = Class.new(StandardError)
##
# Rak... | ruby | MIT | 34c6b3e9b807e3574c66f38337b47c2cfd7ace48 | 2026-01-04T15:55:38.335769Z | false |
ruby/rake | https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/lib/rake/pseudo_status.rb | lib/rake/pseudo_status.rb | # frozen_string_literal: true
module Rake
##
# Exit status class for times the system just gives us a nil.
class PseudoStatus # :nodoc: all
attr_reader :exitstatus
def initialize(code=0)
@exitstatus = code
end
def to_i
@exitstatus << 8
end
def >>(n)
to_i >> n
end
... | ruby | MIT | 34c6b3e9b807e3574c66f38337b47c2cfd7ace48 | 2026-01-04T15:55:38.335769Z | false |
ruby/rake | https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/lib/rake/private_reader.rb | lib/rake/private_reader.rb | # frozen_string_literal: true
module Rake
# Include PrivateReader to use +private_reader+.
module PrivateReader # :nodoc: all
def self.included(base)
base.extend(ClassMethods)
end
module ClassMethods
# Declare a list of private accessors
def private_reader(*names)
... | ruby | MIT | 34c6b3e9b807e3574c66f38337b47c2cfd7ace48 | 2026-01-04T15:55:38.335769Z | false |
ruby/rake | https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/lib/rake/file_utils.rb | lib/rake/file_utils.rb | # frozen_string_literal: true
require "rbconfig"
require "fileutils"
#--
# This a FileUtils extension that defines several additional commands to be
# added to the FileUtils utility functions.
module FileUtils
# Path to the currently running Ruby program
RUBY = ENV["RUBY"] || File.join(
RbConfig::CONFIG["bindi... | ruby | MIT | 34c6b3e9b807e3574c66f38337b47c2cfd7ace48 | 2026-01-04T15:55:38.335769Z | false |
ruby/rake | https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/lib/rake/late_time.rb | lib/rake/late_time.rb | # frozen_string_literal: true
module Rake
# LateTime is a fake timestamp that occurs _after_ any other time value.
class LateTime
include Comparable
include Singleton
def <=>(other)
1
end
def to_s
"<LATE TIME>"
end
end
LATE = LateTime.instance
end
| ruby | MIT | 34c6b3e9b807e3574c66f38337b47c2cfd7ace48 | 2026-01-04T15:55:38.335769Z | false |
ruby/rake | https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/lib/rake/file_utils_ext.rb | lib/rake/file_utils_ext.rb | # frozen_string_literal: true
require_relative "file_utils"
module Rake
#
# FileUtilsExt provides a custom version of the FileUtils methods
# that respond to the <tt>verbose</tt> and <tt>nowrite</tt>
# commands.
#
module FileUtilsExt
include FileUtils
class << self
attr_accessor :verbose_fla... | ruby | MIT | 34c6b3e9b807e3574c66f38337b47c2cfd7ace48 | 2026-01-04T15:55:38.335769Z | false |
ruby/rake | https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/lib/rake/testtask.rb | lib/rake/testtask.rb | # frozen_string_literal: true
require_relative "../rake"
require_relative "tasklib"
module Rake
# Create a task that runs a set of tests.
#
# Example:
# require "rake/testtask"
#
# Rake::TestTask.new do |t|
# t.libs << "test"
# t.test_files = FileList['test/test*.rb']
# t.verbose = t... | ruby | MIT | 34c6b3e9b807e3574c66f38337b47c2cfd7ace48 | 2026-01-04T15:55:38.335769Z | false |
ruby/rake | https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/lib/rake/task_arguments.rb | lib/rake/task_arguments.rb | # frozen_string_literal: true
module Rake
##
# TaskArguments manage the arguments passed to a task.
#
class TaskArguments
include Enumerable
# Argument names
attr_reader :names
# Create a TaskArgument object with a list of argument +names+ and a set
# of associated +values+. +parent+ is ... | ruby | MIT | 34c6b3e9b807e3574c66f38337b47c2cfd7ace48 | 2026-01-04T15:55:38.335769Z | false |
ruby/rake | https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/lib/rake/file_task.rb | lib/rake/file_task.rb | # frozen_string_literal: true
require_relative "task"
require_relative "early_time"
module Rake
# A FileTask is a task that includes time based dependencies. If any of a
# FileTask's prerequisites have a timestamp that is later than the file
# represented by this task, then the file must be rebuilt (using the
... | ruby | MIT | 34c6b3e9b807e3574c66f38337b47c2cfd7ace48 | 2026-01-04T15:55:38.335769Z | false |
ruby/rake | https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/lib/rake/cloneable.rb | lib/rake/cloneable.rb | # frozen_string_literal: true
module Rake
##
# Mixin for creating easily cloned objects.
module Cloneable # :nodoc:
# The hook that is invoked by 'clone' and 'dup' methods.
def initialize_copy(source)
super
source.instance_variables.each do |var|
src_value = source.instance_variable_... | ruby | MIT | 34c6b3e9b807e3574c66f38337b47c2cfd7ace48 | 2026-01-04T15:55:38.335769Z | false |
ruby/rake | https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/lib/rake/cpu_counter.rb | lib/rake/cpu_counter.rb | # frozen_string_literal: true
module Rake
# Based on a script at:
# http://stackoverflow.com/questions/891537/ruby-detect-number-of-cpus-installed
class CpuCounter # :nodoc: all
def self.count
new.count_with_default
end
def count_with_default(default=4)
count || default
rescue Stan... | ruby | MIT | 34c6b3e9b807e3574c66f38337b47c2cfd7ace48 | 2026-01-04T15:55:38.335769Z | false |
ruby/rake | https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/lib/rake/backtrace.rb | lib/rake/backtrace.rb | # frozen_string_literal: true
module Rake
module Backtrace # :nodoc: all
SYS_KEYS = RbConfig::CONFIG.keys.grep(/(?:[a-z]prefix|libdir)\z/)
SYS_PATHS = RbConfig::CONFIG.values_at(*SYS_KEYS).uniq +
[ File.join(File.dirname(__FILE__), "..") ]
SUPPRESSED_PATHS = SYS_PATHS.
map { |s| s.tr("\\", "... | ruby | MIT | 34c6b3e9b807e3574c66f38337b47c2cfd7ace48 | 2026-01-04T15:55:38.335769Z | false |
ruby/rake | https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/lib/rake/linked_list.rb | lib/rake/linked_list.rb | # frozen_string_literal: true
module Rake
# Polylithic linked list structure used to implement several data
# structures in Rake.
class LinkedList
include Enumerable
attr_reader :head, :tail
# Polymorphically add a new element to the head of a list. The
# type of head node will be the same list ... | ruby | MIT | 34c6b3e9b807e3574c66f38337b47c2cfd7ace48 | 2026-01-04T15:55:38.335769Z | false |
ruby/rake | https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/lib/rake/packagetask.rb | lib/rake/packagetask.rb | # frozen_string_literal: true
# Define a package task library to aid in the definition of
# redistributable package files.
require_relative "../rake"
require_relative "tasklib"
module Rake
# Create a packaging task that will package the project into
# distributable files (e.g zip archive or tar files).
#
# T... | ruby | MIT | 34c6b3e9b807e3574c66f38337b47c2cfd7ace48 | 2026-01-04T15:55:38.335769Z | false |
ruby/rake | https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/lib/rake/tasklib.rb | lib/rake/tasklib.rb | # frozen_string_literal: true
require_relative "../rake"
module Rake
# Base class for Task Libraries.
class TaskLib
include Cloneable
include Rake::DSL
end
end
| ruby | MIT | 34c6b3e9b807e3574c66f38337b47c2cfd7ace48 | 2026-01-04T15:55:38.335769Z | false |
ruby/rake | https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/lib/rake/early_time.rb | lib/rake/early_time.rb | # frozen_string_literal: true
module Rake
# EarlyTime is a fake timestamp that occurs _before_ any other time value.
class EarlyTime
include Comparable
include Singleton
##
# The EarlyTime always comes before +other+!
def <=>(other)
-1
end
def to_s # :nodoc:
"<EARLY TIME>... | ruby | MIT | 34c6b3e9b807e3574c66f38337b47c2cfd7ace48 | 2026-01-04T15:55:38.335769Z | false |
ruby/rake | https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/lib/rake/task_argument_error.rb | lib/rake/task_argument_error.rb | # frozen_string_literal: true
module Rake
# Error indicating an ill-formed task declaration.
class TaskArgumentError < ArgumentError
end
end
| ruby | MIT | 34c6b3e9b807e3574c66f38337b47c2cfd7ace48 | 2026-01-04T15:55:38.335769Z | false |
ruby/rake | https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/lib/rake/scope.rb | lib/rake/scope.rb | # frozen_string_literal: true
module Rake
class Scope < LinkedList # :nodoc: all
# Path for the scope.
def path
map(&:to_s).reverse.join(":")
end
# Path for the scope + the named path.
def path_with_task_name(task_name)
"#{path}:#{task_name}"
end
# Trim +n+ innermost scope l... | ruby | MIT | 34c6b3e9b807e3574c66f38337b47c2cfd7ace48 | 2026-01-04T15:55:38.335769Z | false |
ruby/rake | https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/lib/rake/thread_pool.rb | lib/rake/thread_pool.rb | # frozen_string_literal: true
require_relative "promise"
require "set"
module Rake
class ThreadPool # :nodoc: all
# Creates a ThreadPool object. The +thread_count+ parameter is the size
# of the pool.
def initialize(thread_count)
@max_active_threads = [thread_count, 0].max
@threads = Set.... | ruby | MIT | 34c6b3e9b807e3574c66f38337b47c2cfd7ace48 | 2026-01-04T15:55:38.335769Z | false |
ruby/rake | https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/lib/rake/name_space.rb | lib/rake/name_space.rb | # frozen_string_literal: true
##
# The NameSpace class will lookup task names in the scope defined by a
# +namespace+ command.
class Rake::NameSpace
##
# Create a namespace lookup object using the given task manager
# and the list of scopes.
def initialize(task_manager, scope_list)
@task_manager = task_m... | ruby | MIT | 34c6b3e9b807e3574c66f38337b47c2cfd7ace48 | 2026-01-04T15:55:38.335769Z | false |
ruby/rake | https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/lib/rake/trace_output.rb | lib/rake/trace_output.rb | # frozen_string_literal: true
module Rake
module TraceOutput # :nodoc: all
# Write trace output to output stream +out+.
#
# The write is done as a single IO call (to print) to lessen the
# chance that the trace output is interrupted by other tasks also
# producing output.
def trace_on(out, *s... | ruby | MIT | 34c6b3e9b807e3574c66f38337b47c2cfd7ace48 | 2026-01-04T15:55:38.335769Z | false |
ruby/rake | https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/lib/rake/invocation_chain.rb | lib/rake/invocation_chain.rb | # frozen_string_literal: true
module Rake
# InvocationChain tracks the chain of task invocations to detect
# circular dependencies.
class InvocationChain < LinkedList
# Is the invocation already in the chain?
def member?(invocation)
head == invocation || tail.member?(invocation)
end
# App... | ruby | MIT | 34c6b3e9b807e3574c66f38337b47c2cfd7ace48 | 2026-01-04T15:55:38.335769Z | false |
ruby/rake | https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/lib/rake/rake_module.rb | lib/rake/rake_module.rb | # frozen_string_literal: true
require "rake/application"
module Rake
class << self
# Current Rake Application
def application
@application ||= Rake::Application.new
end
# Set the current Rake application object.
def application=(app)
@application = app
end
def suggested_thr... | ruby | MIT | 34c6b3e9b807e3574c66f38337b47c2cfd7ace48 | 2026-01-04T15:55:38.335769Z | false |
ruby/rake | https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/lib/rake/multi_task.rb | lib/rake/multi_task.rb | # frozen_string_literal: true
module Rake
# Same as a regular task, but the immediate prerequisites are done in
# parallel using Ruby threads.
#
class MultiTask < Task
private
def invoke_prerequisites(task_args, invocation_chain) # :nodoc:
invoke_prerequisites_concurrently(task_args, invocation_... | ruby | MIT | 34c6b3e9b807e3574c66f38337b47c2cfd7ace48 | 2026-01-04T15:55:38.335769Z | false |
ruby/rake | https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/lib/rake/file_list.rb | lib/rake/file_list.rb | # frozen_string_literal: true
require_relative "cloneable"
require_relative "file_utils_ext"
require_relative "ext/string"
module Rake
##
# A FileList is essentially an array with a few helper methods defined to
# make file manipulation a bit easier.
#
# FileLists are lazy. When given a list of glob patter... | ruby | MIT | 34c6b3e9b807e3574c66f38337b47c2cfd7ace48 | 2026-01-04T15:55:38.335769Z | false |
ruby/rake | https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/lib/rake/invocation_exception_mixin.rb | lib/rake/invocation_exception_mixin.rb | # frozen_string_literal: true
module Rake
module InvocationExceptionMixin
# Return the invocation chain (list of Rake tasks) that were in
# effect when this exception was detected by rake. May be null if
# no tasks were active.
def chain
@rake_invocation_chain ||= nil
end
# Set the inv... | ruby | MIT | 34c6b3e9b807e3574c66f38337b47c2cfd7ace48 | 2026-01-04T15:55:38.335769Z | false |
ruby/rake | https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/lib/rake/promise.rb | lib/rake/promise.rb | # frozen_string_literal: true
module Rake
# A Promise object represents a promise to do work (a chore) in the
# future. The promise is created with a block and a list of
# arguments for the block. Calling value will return the value of
# the promised chore.
#
# Used by ThreadPool.
#
class Promise ... | ruby | MIT | 34c6b3e9b807e3574c66f38337b47c2cfd7ace48 | 2026-01-04T15:55:38.335769Z | false |
ruby/rake | https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/lib/rake/file_creation_task.rb | lib/rake/file_creation_task.rb | # frozen_string_literal: true
require_relative "file_task"
require_relative "early_time"
module Rake
# A FileCreationTask is a file task that when used as a dependency will be
# needed if and only if the file has not been created. Once created, it is
# not re-triggered if any of its dependencies are newer, nor... | ruby | MIT | 34c6b3e9b807e3574c66f38337b47c2cfd7ace48 | 2026-01-04T15:55:38.335769Z | false |
ruby/rake | https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/lib/rake/thread_history_display.rb | lib/rake/thread_history_display.rb | # frozen_string_literal: true
require_relative "private_reader"
module Rake
class ThreadHistoryDisplay # :nodoc: all
include Rake::PrivateReader
private_reader :stats, :items, :threads
def initialize(stats)
@stats = stats
@items = { _seq_: 1 }
@threads = { _seq_: "A" }
en... | ruby | MIT | 34c6b3e9b807e3574c66f38337b47c2cfd7ace48 | 2026-01-04T15:55:38.335769Z | false |
ruby/rake | https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/lib/rake/task_manager.rb | lib/rake/task_manager.rb | # frozen_string_literal: true
module Rake
# The TaskManager module is a mixin for managing tasks.
module TaskManager
# Track the last comment made in the Rakefile.
attr_accessor :last_description
def initialize # :nodoc:
super
@tasks = Hash.new
@rules = Array.new
@scope = Scope... | ruby | MIT | 34c6b3e9b807e3574c66f38337b47c2cfd7ace48 | 2026-01-04T15:55:38.335769Z | false |
ruby/rake | https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/lib/rake/phony.rb | lib/rake/phony.rb | # frozen_string_literal: true
# Defines a :phony task that you can use as a dependency. This allows
# file-based tasks to use non-file-based tasks as prerequisites
# without forcing them to rebuild.
#
# See FileTask#out_of_date? and Task#timestamp for more info.
require_relative "../rake"
task :phony
Rake::Task[:pho... | ruby | MIT | 34c6b3e9b807e3574c66f38337b47c2cfd7ace48 | 2026-01-04T15:55:38.335769Z | false |
ruby/rake | https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/lib/rake/rake_test_loader.rb | lib/rake/rake_test_loader.rb | # frozen_string_literal: true
require_relative "file_list"
# Load the test files from the command line.
argv = ARGV.select do |argument|
case argument
when /^-/ then
argument
when /\*/ then
Rake::FileList[argument].to_a.each do |file|
require File.expand_path file
end
false
else
pat... | ruby | MIT | 34c6b3e9b807e3574c66f38337b47c2cfd7ace48 | 2026-01-04T15:55:38.335769Z | false |
ruby/rake | https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/lib/rake/ext/core.rb | lib/rake/ext/core.rb | # frozen_string_literal: true
class Module
# Check for an existing method in the current class before extending. If
# the method already exists, then a warning is printed and the extension is
# not added. Otherwise the block is yielded and any definitions in the
# block will take effect.
#
# Usage:
#
... | ruby | MIT | 34c6b3e9b807e3574c66f38337b47c2cfd7ace48 | 2026-01-04T15:55:38.335769Z | false |
ruby/rake | https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/lib/rake/ext/string.rb | lib/rake/ext/string.rb | # frozen_string_literal: true
require_relative "core"
class String
rake_extension("ext") do
# Replace the file extension with +newext+. If there is no extension on
# the string, append the new extension to the end. If the new extension
# is not given, or is the empty string, remove any existing extens... | ruby | MIT | 34c6b3e9b807e3574c66f38337b47c2cfd7ace48 | 2026-01-04T15:55:38.335769Z | false |
ruby/rake | https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/lib/rake/loaders/makefile.rb | lib/rake/loaders/makefile.rb | # frozen_string_literal: true
module Rake
# Makefile loader to be used with the import file loader. Use this to
# import dependencies from make dependency tools:
#
# require 'rake/loaders/makefile'
#
# file ".depends.mf" => [SRC_LIST] do |t|
# sh "makedepend -f- -- #{CFLAGS} -- #{t.prerequisites... | ruby | MIT | 34c6b3e9b807e3574c66f38337b47c2cfd7ace48 | 2026-01-04T15:55:38.335769Z | false |
ruby/rake | https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/doc/jamis.rb | doc/jamis.rb | # frozen_string_literal: true
module RDoc
module Page
FONTS = "\"Bitstream Vera Sans\", Verdana, Arial, Helvetica, sans-serif"
STYLE = <<CSS
a {
color: #00F;
text-decoration: none;
}
a:hover {
color: #77F;
text-decoration: underline;
}
body, td, p {
font-family: %fonts%;
background: #FFF;
color: #000;... | ruby | MIT | 34c6b3e9b807e3574c66f38337b47c2cfd7ace48 | 2026-01-04T15:55:38.335769Z | false |
collectiveidea/awesome_nested_set | https://github.com/collectiveidea/awesome_nested_set/blob/21961841836e31943ee3b3ad40ecaef0a6034087/spec/awesome_nested_set_spec.rb | spec/awesome_nested_set_spec.rb | require 'spec_helper'
describe "AwesomeNestedSet" do
before(:all) do
self.class.fixtures :categories, :departments, :notes, :things, :brokens, :users, :default_scoped_models
end
describe "defaults" do
it "should have left_column_default" do
expect(Default.acts_as_nested_set_options[:left_column]).... | ruby | MIT | 21961841836e31943ee3b3ad40ecaef0a6034087 | 2026-01-04T15:55:43.724157Z | true |
collectiveidea/awesome_nested_set | https://github.com/collectiveidea/awesome_nested_set/blob/21961841836e31943ee3b3ad40ecaef0a6034087/spec/spec_helper.rb | spec/spec_helper.rb | plugin_test_dir = File.dirname(__FILE__)
require 'rubygems'
require 'bundler/setup'
require 'logger'
require 'active_record'
ActiveRecord::Base.logger = Logger.new(plugin_test_dir + "/debug.log")
require 'yaml'
require 'erb'
db_config = YAML::load(ERB.new(IO.read(plugin_test_dir + "/db/database.yml")).result)
Active... | ruby | MIT | 21961841836e31943ee3b3ad40ecaef0a6034087 | 2026-01-04T15:55:43.724157Z | false |
collectiveidea/awesome_nested_set | https://github.com/collectiveidea/awesome_nested_set/blob/21961841836e31943ee3b3ad40ecaef0a6034087/spec/awesome_nested_set/helper_spec.rb | spec/awesome_nested_set/helper_spec.rb | require 'spec_helper'
require 'awesome_nested_set/helper'
describe "Helper" do
include CollectiveIdea::Acts::NestedSet::Helper
before(:all) do
self.class.fixtures :categories
end
describe "nested_set_options" do
it "test_nested_set_options" do
expected = [
[" Top Level", 1],
["-... | ruby | MIT | 21961841836e31943ee3b3ad40ecaef0a6034087 | 2026-01-04T15:55:43.724157Z | false |
collectiveidea/awesome_nested_set | https://github.com/collectiveidea/awesome_nested_set/blob/21961841836e31943ee3b3ad40ecaef0a6034087/spec/awesome_nested_set/model/transactable_spec.rb | spec/awesome_nested_set/model/transactable_spec.rb | require 'spec_helper'
RSpec.configure do |config|
config.use_transactional_fixtures = false
end
describe "AwesomeNestedSet" do
describe "transactions" do
it "should retry with sleep on deadlocks or lock wait timeouts" do
i = 0
# eg. like a move, where a lock is found
# in_tenacious_transac... | ruby | MIT | 21961841836e31943ee3b3ad40ecaef0a6034087 | 2026-01-04T15:55:43.724157Z | false |
collectiveidea/awesome_nested_set | https://github.com/collectiveidea/awesome_nested_set/blob/21961841836e31943ee3b3ad40ecaef0a6034087/spec/support/models.rb | spec/support/models.rb | class Note < ActiveRecord::Base
acts_as_nested_set :scope => [:notable_id, :notable_type]
belongs_to :user, inverse_of: :notes
end
class DefaultScopedModel < ActiveRecord::Base
acts_as_nested_set
end
class Default < ActiveRecord::Base
self.table_name = 'categories'
acts_as_nested_set
end
class ScopedCateg... | ruby | MIT | 21961841836e31943ee3b3ad40ecaef0a6034087 | 2026-01-04T15:55:43.724157Z | false |
collectiveidea/awesome_nested_set | https://github.com/collectiveidea/awesome_nested_set/blob/21961841836e31943ee3b3ad40ecaef0a6034087/spec/db/schema.rb | spec/db/schema.rb | ActiveRecord::Schema.define(:version => 0) do
create_table :default_scoped_models, :force => true do |t|
t.column :name, :string
t.column :parent_id, :integer
t.column :lft, :integer
t.column :rgt, :integer
t.column :depth, :integer
t.column :draft, :boolean, default: false
end
create_ta... | ruby | MIT | 21961841836e31943ee3b3ad40ecaef0a6034087 | 2026-01-04T15:55:43.724157Z | false |
collectiveidea/awesome_nested_set | https://github.com/collectiveidea/awesome_nested_set/blob/21961841836e31943ee3b3ad40ecaef0a6034087/spec/models/users_spec.rb | spec/models/users_spec.rb | require 'spec_helper'
describe "User", :type => :model do
before(:all) do
self.class.fixtures :categories, :departments, :notes, :things, :brokens, :users
end
describe "hierarchical structure" do
it "roots_class_method" do
found_by_us = User.where(:parent_uuid => nil).to_a
found_by_roots = U... | ruby | MIT | 21961841836e31943ee3b3ad40ecaef0a6034087 | 2026-01-04T15:55:43.724157Z | false |
collectiveidea/awesome_nested_set | https://github.com/collectiveidea/awesome_nested_set/blob/21961841836e31943ee3b3ad40ecaef0a6034087/lib/awesome_nested_set.rb | lib/awesome_nested_set.rb | require 'active_support/lazy_load_hooks'
require 'awesome_nested_set/awesome_nested_set'
ActiveSupport.on_load(:active_record) do
ActiveRecord::Base.send :extend, CollectiveIdea::Acts::NestedSet
end
ActiveSupport.on_load(:action_view) do
require 'awesome_nested_set/helper'
ActionView::Base.send :include, Collec... | ruby | MIT | 21961841836e31943ee3b3ad40ecaef0a6034087 | 2026-01-04T15:55:43.724157Z | false |
collectiveidea/awesome_nested_set | https://github.com/collectiveidea/awesome_nested_set/blob/21961841836e31943ee3b3ad40ecaef0a6034087/lib/awesome_nested_set/move.rb | lib/awesome_nested_set/move.rb | module CollectiveIdea #:nodoc:
module Acts #:nodoc:
module NestedSet #:nodoc:
class Move
attr_reader :target, :position, :instance
def initialize(target, position, instance)
@target = target
@position = position
@instance = instance
end
def mov... | ruby | MIT | 21961841836e31943ee3b3ad40ecaef0a6034087 | 2026-01-04T15:55:43.724157Z | false |
collectiveidea/awesome_nested_set | https://github.com/collectiveidea/awesome_nested_set/blob/21961841836e31943ee3b3ad40ecaef0a6034087/lib/awesome_nested_set/version.rb | lib/awesome_nested_set/version.rb | # frozen_string_literal: true
module AwesomeNestedSet
VERSION = '3.9.0' unless defined?(::AwesomeNestedSet::VERSION)
end
| ruby | MIT | 21961841836e31943ee3b3ad40ecaef0a6034087 | 2026-01-04T15:55:43.724157Z | false |
collectiveidea/awesome_nested_set | https://github.com/collectiveidea/awesome_nested_set/blob/21961841836e31943ee3b3ad40ecaef0a6034087/lib/awesome_nested_set/set_validator.rb | lib/awesome_nested_set/set_validator.rb | module CollectiveIdea #:nodoc:
module Acts #:nodoc:
module NestedSet #:nodoc:
class SetValidator
def initialize(model)
@model = model
@scope = model.all
@parent = arel_table.alias('parent')
end
def valid?
query.count == 0
end
... | ruby | MIT | 21961841836e31943ee3b3ad40ecaef0a6034087 | 2026-01-04T15:55:43.724157Z | false |
collectiveidea/awesome_nested_set | https://github.com/collectiveidea/awesome_nested_set/blob/21961841836e31943ee3b3ad40ecaef0a6034087/lib/awesome_nested_set/columns.rb | lib/awesome_nested_set/columns.rb | # Mixed into both classes and instances to provide easy access to the column names
module CollectiveIdea #:nodoc:
module Acts #:nodoc:
module NestedSet #:nodoc:
module Columns
def left_column_name
acts_as_nested_set_options[:left_column]
end
def right_column_name
... | ruby | MIT | 21961841836e31943ee3b3ad40ecaef0a6034087 | 2026-01-04T15:55:43.724157Z | false |
collectiveidea/awesome_nested_set | https://github.com/collectiveidea/awesome_nested_set/blob/21961841836e31943ee3b3ad40ecaef0a6034087/lib/awesome_nested_set/tree.rb | lib/awesome_nested_set/tree.rb | module CollectiveIdea #:nodoc:
module Acts #:nodoc:
module NestedSet #:nodoc:
class Tree
attr_reader :model, :validate_nodes
attr_accessor :indices
delegate :left_column_name, :right_column_name, :quoted_parent_column_full_name,
:order_for_rebuild, :scope_for_rebuil... | ruby | MIT | 21961841836e31943ee3b3ad40ecaef0a6034087 | 2026-01-04T15:55:43.724157Z | false |
collectiveidea/awesome_nested_set | https://github.com/collectiveidea/awesome_nested_set/blob/21961841836e31943ee3b3ad40ecaef0a6034087/lib/awesome_nested_set/iterator.rb | lib/awesome_nested_set/iterator.rb | module CollectiveIdea #:nodoc:
module Acts #:nodoc:
module NestedSet #:nodoc:
class Iterator
attr_reader :objects
def initialize(objects)
@objects = objects
end
def each_with_level
path = [nil]
objects.each do |o|
if o.parent_id != ... | ruby | MIT | 21961841836e31943ee3b3ad40ecaef0a6034087 | 2026-01-04T15:55:43.724157Z | false |
collectiveidea/awesome_nested_set | https://github.com/collectiveidea/awesome_nested_set/blob/21961841836e31943ee3b3ad40ecaef0a6034087/lib/awesome_nested_set/helper.rb | lib/awesome_nested_set/helper.rb | # -*- coding: utf-8 -*-
module CollectiveIdea #:nodoc:
module Acts #:nodoc:
module NestedSet #:nodoc:
# This module provides some helpers for the model classes using acts_as_nested_set.
# It is included by default in all views.
#
module Helper
# Returns options for select.
... | ruby | MIT | 21961841836e31943ee3b3ad40ecaef0a6034087 | 2026-01-04T15:55:43.724157Z | false |
collectiveidea/awesome_nested_set | https://github.com/collectiveidea/awesome_nested_set/blob/21961841836e31943ee3b3ad40ecaef0a6034087/lib/awesome_nested_set/model.rb | lib/awesome_nested_set/model.rb | require 'awesome_nested_set/model/prunable'
require 'awesome_nested_set/model/movable'
require 'awesome_nested_set/model/transactable'
require 'awesome_nested_set/model/relatable'
require 'awesome_nested_set/model/rebuildable'
require 'awesome_nested_set/model/validatable'
require 'awesome_nested_set/iterator'
module ... | ruby | MIT | 21961841836e31943ee3b3ad40ecaef0a6034087 | 2026-01-04T15:55:43.724157Z | false |
collectiveidea/awesome_nested_set | https://github.com/collectiveidea/awesome_nested_set/blob/21961841836e31943ee3b3ad40ecaef0a6034087/lib/awesome_nested_set/awesome_nested_set.rb | lib/awesome_nested_set/awesome_nested_set.rb | require 'awesome_nested_set/columns'
require 'awesome_nested_set/model'
module CollectiveIdea #:nodoc:
module Acts #:nodoc:
module NestedSet #:nodoc:
# This provides Nested Set functionality. Nested Set is a smart way to implement
# an _ordered_ tree, with the added feature that you can select the c... | ruby | MIT | 21961841836e31943ee3b3ad40ecaef0a6034087 | 2026-01-04T15:55:43.724157Z | false |
collectiveidea/awesome_nested_set | https://github.com/collectiveidea/awesome_nested_set/blob/21961841836e31943ee3b3ad40ecaef0a6034087/lib/awesome_nested_set/model/transactable.rb | lib/awesome_nested_set/model/transactable.rb | module CollectiveIdea #:nodoc:
module Acts #:nodoc:
module NestedSet #:nodoc:
module Model
module Transactable
class OpenTransactionsIsNotZero < ActiveRecord::StatementInvalid
end
class DeadlockDetected < ActiveRecord::StatementInvalid
end
protecte... | ruby | MIT | 21961841836e31943ee3b3ad40ecaef0a6034087 | 2026-01-04T15:55:43.724157Z | false |
collectiveidea/awesome_nested_set | https://github.com/collectiveidea/awesome_nested_set/blob/21961841836e31943ee3b3ad40ecaef0a6034087/lib/awesome_nested_set/model/validatable.rb | lib/awesome_nested_set/model/validatable.rb | require 'awesome_nested_set/set_validator'
module CollectiveIdea
module Acts
module NestedSet
module Model
module Validatable
def valid?
left_and_rights_valid? && no_duplicates_for_columns? && all_roots_valid?
end
def left_and_rights_valid?
Se... | ruby | MIT | 21961841836e31943ee3b3ad40ecaef0a6034087 | 2026-01-04T15:55:43.724157Z | false |
collectiveidea/awesome_nested_set | https://github.com/collectiveidea/awesome_nested_set/blob/21961841836e31943ee3b3ad40ecaef0a6034087/lib/awesome_nested_set/model/prunable.rb | lib/awesome_nested_set/model/prunable.rb | module CollectiveIdea #:nodoc:
module Acts #:nodoc:
module NestedSet #:nodoc:
module Model
module Prunable
# Prunes a branch off of the tree, shifting all of the elements on the right
# back to the left so the counts still work.
def destroy_descendants
retu... | ruby | MIT | 21961841836e31943ee3b3ad40ecaef0a6034087 | 2026-01-04T15:55:43.724157Z | false |
collectiveidea/awesome_nested_set | https://github.com/collectiveidea/awesome_nested_set/blob/21961841836e31943ee3b3ad40ecaef0a6034087/lib/awesome_nested_set/model/rebuildable.rb | lib/awesome_nested_set/model/rebuildable.rb | require 'awesome_nested_set/tree'
module CollectiveIdea
module Acts
module NestedSet
module Model
module Rebuildable
# Rebuilds the left & rights if unset or invalid.
# Also very useful for converting from acts_as_tree.
def rebuild!(validate_nodes = true)
... | ruby | MIT | 21961841836e31943ee3b3ad40ecaef0a6034087 | 2026-01-04T15:55:43.724157Z | false |
collectiveidea/awesome_nested_set | https://github.com/collectiveidea/awesome_nested_set/blob/21961841836e31943ee3b3ad40ecaef0a6034087/lib/awesome_nested_set/model/relatable.rb | lib/awesome_nested_set/model/relatable.rb | module CollectiveIdea
module Acts
module NestedSet
module Model
module Relatable
# Returns an collection of all parents
def ancestors
without_self self_and_ancestors
end
# Returns the collection of all parents and self
def self_and_ance... | ruby | MIT | 21961841836e31943ee3b3ad40ecaef0a6034087 | 2026-01-04T15:55:43.724157Z | false |
collectiveidea/awesome_nested_set | https://github.com/collectiveidea/awesome_nested_set/blob/21961841836e31943ee3b3ad40ecaef0a6034087/lib/awesome_nested_set/model/movable.rb | lib/awesome_nested_set/model/movable.rb | require 'awesome_nested_set/move'
module CollectiveIdea #:nodoc:
module Acts #:nodoc:
module NestedSet #:nodoc:
module Model
module Movable
def move_possible?(target)
self != target && # Can't target self
same_scope?(target) && # can't be in different scopes
... | ruby | MIT | 21961841836e31943ee3b3ad40ecaef0a6034087 | 2026-01-04T15:55:43.724157Z | false |
rubygems/bundler | https://github.com/rubygems/bundler/blob/35be6d9a603084f719fec4f4028c18860def07f6/spec/quality_spec.rb | spec/quality_spec.rb | # frozen_string_literal: true
require "set"
RSpec.describe "The library itself" do
def check_for_debugging_mechanisms(filename)
debugging_mechanisms_regex = /
(binding\.pry)|
(debugger)|
(sleep\s*\(?\d+)|
(fit\s*\(?("|\w))
/x
failing_lines = []
each_line(filename) do |line, ... | ruby | MIT | 35be6d9a603084f719fec4f4028c18860def07f6 | 2026-01-04T15:44:52.942591Z | false |
rubygems/bundler | https://github.com/rubygems/bundler/blob/35be6d9a603084f719fec4f4028c18860def07f6/spec/quality_es_spec.rb | spec/quality_es_spec.rb | # frozen_string_literal: true
RSpec.describe "La biblioteca si misma" do
def check_for_expendable_words(filename)
failing_line_message = []
useless_words = %w[
básicamente
claramente
sólo
solamente
obvio
obviamente
fácil
fácilmente
sencillamente
sim... | ruby | MIT | 35be6d9a603084f719fec4f4028c18860def07f6 | 2026-01-04T15:44:52.942591Z | false |
rubygems/bundler | https://github.com/rubygems/bundler/blob/35be6d9a603084f719fec4f4028c18860def07f6/spec/spec_helper.rb | spec/spec_helper.rb | # frozen_string_literal: true
require_relative "support/path"
$:.unshift Spec::Path.lib_dir.to_s
require "bundler/psyched_yaml"
require "bundler/vendored_fileutils"
require "bundler/vendored_uri"
require "digest"
if File.expand_path(__FILE__) =~ %r{([^\w/\.:\-])}
abort "The bundler specs cannot be run from a path... | ruby | MIT | 35be6d9a603084f719fec4f4028c18860def07f6 | 2026-01-04T15:44:52.942591Z | false |
rubygems/bundler | https://github.com/rubygems/bundler/blob/35be6d9a603084f719fec4f4028c18860def07f6/spec/support/silent_logger.rb | spec/support/silent_logger.rb | # frozen_string_literal: true
require "logger"
module Spec
class SilentLogger
(::Logger.instance_methods - Object.instance_methods).each do |logger_instance_method|
define_method(logger_instance_method) {|*args, &blk| }
end
end
end
| ruby | MIT | 35be6d9a603084f719fec4f4028c18860def07f6 | 2026-01-04T15:44:52.942591Z | false |
rubygems/bundler | https://github.com/rubygems/bundler/blob/35be6d9a603084f719fec4f4028c18860def07f6/spec/support/path.rb | spec/support/path.rb | # frozen_string_literal: true
require "pathname"
require "rbconfig"
module Spec
module Path
def root
@root ||= Pathname.new(ruby_core? ? "../../../.." : "../../..").expand_path(__FILE__)
end
def gemspec
@gemspec ||= root.join(ruby_core? ? "lib/bundler/bundler.gemspec" : "bundler.gemspec")
... | ruby | MIT | 35be6d9a603084f719fec4f4028c18860def07f6 | 2026-01-04T15:44:52.942591Z | false |
rubygems/bundler | https://github.com/rubygems/bundler/blob/35be6d9a603084f719fec4f4028c18860def07f6/spec/support/matchers.rb | spec/support/matchers.rb | # frozen_string_literal: true
require "forwardable"
require_relative "the_bundle"
module Spec
module Matchers
extend RSpec::Matchers
class Precondition
include RSpec::Matchers::Composable
extend Forwardable
def_delegators :failing_matcher,
:failure_message,
:actual,
... | ruby | MIT | 35be6d9a603084f719fec4f4028c18860def07f6 | 2026-01-04T15:44:52.942591Z | false |
rubygems/bundler | https://github.com/rubygems/bundler/blob/35be6d9a603084f719fec4f4028c18860def07f6/spec/support/builders.rb | spec/support/builders.rb | # frozen_string_literal: true
require "bundler/shared_helpers"
require "shellwords"
module Spec
module Builders
def self.constantize(name)
name.delete("-").upcase
end
def v(version)
Gem::Version.new(version)
end
def pl(platform)
Gem::Platform.new(platform)
end
def bu... | ruby | MIT | 35be6d9a603084f719fec4f4028c18860def07f6 | 2026-01-04T15:44:52.942591Z | false |
rubygems/bundler | https://github.com/rubygems/bundler/blob/35be6d9a603084f719fec4f4028c18860def07f6/spec/support/hax.rb | spec/support/hax.rb | # frozen_string_literal: true
module Gem
def self.ruby=(ruby)
@ruby = ruby
end
if ENV["RUBY"]
Gem.ruby = ENV["RUBY"]
end
if version = ENV["BUNDLER_SPEC_RUBYGEMS_VERSION"]
remove_const(:VERSION) if const_defined?(:VERSION)
VERSION = version
end
class Platform
@local = new(ENV["BUNDL... | ruby | MIT | 35be6d9a603084f719fec4f4028c18860def07f6 | 2026-01-04T15:44:52.942591Z | false |
rubygems/bundler | https://github.com/rubygems/bundler/blob/35be6d9a603084f719fec4f4028c18860def07f6/spec/support/sudo.rb | spec/support/sudo.rb | # frozen_string_literal: true
module Spec
module Sudo
def self.present?
@which_sudo ||= Bundler.which("sudo")
end
def sudo(cmd)
raise "sudo not present" unless Sudo.present?
sys_exec("sudo #{cmd}")
end
def chown_system_gems_to_root
sudo "chown -R root #{system_gem_path}"... | ruby | MIT | 35be6d9a603084f719fec4f4028c18860def07f6 | 2026-01-04T15:44:52.942591Z | false |
rubygems/bundler | https://github.com/rubygems/bundler/blob/35be6d9a603084f719fec4f4028c18860def07f6/spec/support/helpers.rb | spec/support/helpers.rb | # frozen_string_literal: true
require_relative "command_execution"
require_relative "the_bundle"
module Spec
module Helpers
def reset!
Dir.glob("#{tmp}/{gems/*,*}", File::FNM_DOTMATCH).each do |dir|
next if %w[base remote1 gems rubygems . ..].include?(File.basename(dir))
if ENV["BUNDLER_SU... | ruby | MIT | 35be6d9a603084f719fec4f4028c18860def07f6 | 2026-01-04T15:44:52.942591Z | false |
rubygems/bundler | https://github.com/rubygems/bundler/blob/35be6d9a603084f719fec4f4028c18860def07f6/spec/support/the_bundle.rb | spec/support/the_bundle.rb | # frozen_string_literal: true
require_relative "path"
module Spec
class TheBundle
include Spec::Path
attr_accessor :bundle_dir
def initialize(opts = {})
opts = opts.dup
@bundle_dir = Pathname.new(opts.delete(:bundle_dir) { bundled_app })
raise "Too many options! #{opts}" unless opts.... | ruby | MIT | 35be6d9a603084f719fec4f4028c18860def07f6 | 2026-01-04T15:44:52.942591Z | false |
rubygems/bundler | https://github.com/rubygems/bundler/blob/35be6d9a603084f719fec4f4028c18860def07f6/spec/support/sometimes.rb | spec/support/sometimes.rb | # frozen_string_literal: true
module Sometimes
def run_with_retries(example_to_run, retries)
example = RSpec.current_example
example.metadata[:retries] ||= retries
retries.times do |t|
example.metadata[:retried] = t + 1
example.instance_variable_set(:@exception, nil)
example_to_run.run... | ruby | MIT | 35be6d9a603084f719fec4f4028c18860def07f6 | 2026-01-04T15:44:52.942591Z | false |
rubygems/bundler | https://github.com/rubygems/bundler/blob/35be6d9a603084f719fec4f4028c18860def07f6/spec/support/streams.rb | spec/support/streams.rb | # frozen_string_literal: true
require "stringio"
def capture(*args)
opts = args.pop if args.last.is_a?(Hash)
opts ||= {}
args.map!(&:to_s)
begin
result = StringIO.new
result.close if opts[:closed]
args.each {|stream| eval "$#{stream} = result" }
yield
ensure
args.each {|stream| eval("$#... | ruby | MIT | 35be6d9a603084f719fec4f4028c18860def07f6 | 2026-01-04T15:44:52.942591Z | false |
rubygems/bundler | https://github.com/rubygems/bundler/blob/35be6d9a603084f719fec4f4028c18860def07f6/spec/support/rubygems_version_manager.rb | spec/support/rubygems_version_manager.rb | # frozen_string_literal: true
require "pathname"
require_relative "helpers"
require_relative "path"
class RubygemsVersionManager
include Spec::Helpers
include Spec::Path
def initialize(source)
@source = source
end
def switch
return if use_system?
switch_local_copy_if_needed
reexec_if_nee... | ruby | MIT | 35be6d9a603084f719fec4f4028c18860def07f6 | 2026-01-04T15:44:52.942591Z | false |
rubygems/bundler | https://github.com/rubygems/bundler/blob/35be6d9a603084f719fec4f4028c18860def07f6/spec/support/platforms.rb | spec/support/platforms.rb | # frozen_string_literal: true
module Spec
module Platforms
include Bundler::GemHelpers
def rb
Gem::Platform::RUBY
end
def mac
Gem::Platform.new("x86-darwin-10")
end
def x64_mac
Gem::Platform.new("x86_64-darwin-15")
end
def java
Gem::Platform.new([nil, "java... | ruby | MIT | 35be6d9a603084f719fec4f4028c18860def07f6 | 2026-01-04T15:44:52.942591Z | false |
rubygems/bundler | https://github.com/rubygems/bundler/blob/35be6d9a603084f719fec4f4028c18860def07f6/spec/support/permissions.rb | spec/support/permissions.rb | # frozen_string_literal: true
module Spec
module Permissions
def with_umask(new_umask)
old_umask = File.umask(new_umask)
yield if block_given?
ensure
File.umask(old_umask)
end
end
end
| ruby | MIT | 35be6d9a603084f719fec4f4028c18860def07f6 | 2026-01-04T15:44:52.942591Z | false |
rubygems/bundler | https://github.com/rubygems/bundler/blob/35be6d9a603084f719fec4f4028c18860def07f6/spec/support/filters.rb | spec/support/filters.rb | # frozen_string_literal: true
require_relative "sudo"
class RequirementChecker < Proc
def self.against(present)
provided = Gem::Version.new(present)
new do |required|
!Gem::Requirement.new(required).satisfied_by?(provided)
end.tap do |checker|
checker.provided = provided
end
end
at... | ruby | MIT | 35be6d9a603084f719fec4f4028c18860def07f6 | 2026-01-04T15:44:52.942591Z | false |
rubygems/bundler | https://github.com/rubygems/bundler/blob/35be6d9a603084f719fec4f4028c18860def07f6/spec/support/rubygems_ext.rb | spec/support/rubygems_ext.rb | # frozen_string_literal: true
require_relative "path"
module Spec
module Rubygems
DEV_DEPS = { # rubocop:disable Style/MutableConstant
"automatiek" => "~> 0.3.0",
"parallel_tests" => "~> 2.29",
"ronn" => "~> 0.7.3",
"rspec" => "~> 3.8",
"rubocop" => "= 0.77.0",
"rubocop-perfo... | ruby | MIT | 35be6d9a603084f719fec4f4028c18860def07f6 | 2026-01-04T15:44:52.942591Z | false |
rubygems/bundler | https://github.com/rubygems/bundler/blob/35be6d9a603084f719fec4f4028c18860def07f6/spec/support/indexes.rb | spec/support/indexes.rb | # frozen_string_literal: true
module Spec
module Indexes
def dep(name, reqs = nil)
@deps ||= []
@deps << Bundler::Dependency.new(name, reqs)
end
def platform(*args)
@platforms ||= []
@platforms.concat args.map {|p| Gem::Platform.new(p) }
end
alias_method :platforms, :pla... | ruby | MIT | 35be6d9a603084f719fec4f4028c18860def07f6 | 2026-01-04T15:44:52.942591Z | false |
rubygems/bundler | https://github.com/rubygems/bundler/blob/35be6d9a603084f719fec4f4028c18860def07f6/spec/support/parallel.rb | spec/support/parallel.rb | # frozen_string_literal: true
RSpec.configure do |config|
config.silence_filter_announcements = true
end
| ruby | MIT | 35be6d9a603084f719fec4f4028c18860def07f6 | 2026-01-04T15:44:52.942591Z | false |
rubygems/bundler | https://github.com/rubygems/bundler/blob/35be6d9a603084f719fec4f4028c18860def07f6/spec/support/command_execution.rb | spec/support/command_execution.rb | # frozen_string_literal: true
module Spec
CommandExecution = Struct.new(:command, :working_directory, :exitstatus, :stdout, :stderr) do
def to_s
"$ #{command}"
end
alias_method :inspect, :to_s
def stdboth
@stdboth ||= [stderr, stdout].join("\n").strip
end
def to_s_verbose
... | ruby | MIT | 35be6d9a603084f719fec4f4028c18860def07f6 | 2026-01-04T15:44:52.942591Z | false |
rubygems/bundler | https://github.com/rubygems/bundler/blob/35be6d9a603084f719fec4f4028c18860def07f6/spec/support/artifice/endpoint_mirror_source.rb | spec/support/artifice/endpoint_mirror_source.rb | # frozen_string_literal: true
require_relative "endpoint"
class EndpointMirrorSource < Endpoint
get "/gems/:id" do
if request.env["HTTP_X_GEMFILE_SOURCE"] == "https://server.example.org/"
File.read("#{gem_repo1}/gems/#{params[:id]}")
else
halt 500
end
end
end
Artifice.activate_with(Endpoi... | ruby | MIT | 35be6d9a603084f719fec4f4028c18860def07f6 | 2026-01-04T15:44:52.942591Z | false |
rubygems/bundler | https://github.com/rubygems/bundler/blob/35be6d9a603084f719fec4f4028c18860def07f6/spec/support/artifice/compact_index_redirects.rb | spec/support/artifice/compact_index_redirects.rb | # frozen_string_literal: true
require_relative "compact_index"
Artifice.deactivate
class CompactIndexRedirect < CompactIndexAPI
get "/fetch/actual/gem/:id" do
redirect "/fetch/actual/gem/#{params[:id]}"
end
get "/versions" do
status 404
end
get "/api/v1/dependencies" do
status 404
end
end
... | ruby | MIT | 35be6d9a603084f719fec4f4028c18860def07f6 | 2026-01-04T15:44:52.942591Z | false |
rubygems/bundler | https://github.com/rubygems/bundler/blob/35be6d9a603084f719fec4f4028c18860def07f6/spec/support/artifice/compact_index_forbidden.rb | spec/support/artifice/compact_index_forbidden.rb | # frozen_string_literal: true
require_relative "compact_index"
Artifice.deactivate
class CompactIndexForbidden < CompactIndexAPI
get "/versions" do
halt 403
end
end
Artifice.activate_with(CompactIndexForbidden)
| ruby | MIT | 35be6d9a603084f719fec4f4028c18860def07f6 | 2026-01-04T15:44:52.942591Z | false |
rubygems/bundler | https://github.com/rubygems/bundler/blob/35be6d9a603084f719fec4f4028c18860def07f6/spec/support/artifice/compact_index_wrong_dependencies.rb | spec/support/artifice/compact_index_wrong_dependencies.rb | # frozen_string_literal: true
require_relative "compact_index"
Artifice.deactivate
class CompactIndexWrongDependencies < CompactIndexAPI
get "/info/:name" do
etag_response do
gem = gems.find {|g| g.name == params[:name] }
gem.versions.each {|gv| gv.dependencies.clear } if gem
CompactIndex.inf... | ruby | MIT | 35be6d9a603084f719fec4f4028c18860def07f6 | 2026-01-04T15:44:52.942591Z | false |
rubygems/bundler | https://github.com/rubygems/bundler/blob/35be6d9a603084f719fec4f4028c18860def07f6/spec/support/artifice/endpoint_extra_missing.rb | spec/support/artifice/endpoint_extra_missing.rb | # frozen_string_literal: true
require_relative "endpoint_extra"
Artifice.deactivate
class EndpointExtraMissing < EndpointExtra
get "/extra/fetch/actual/gem/:id" do
if params[:id] == "missing-1.0.gemspec.rz"
halt 404
else
File.binread("#{gem_repo2}/quick/Marshal.4.8/#{params[:id]}")
end
en... | ruby | MIT | 35be6d9a603084f719fec4f4028c18860def07f6 | 2026-01-04T15:44:52.942591Z | false |
rubygems/bundler | https://github.com/rubygems/bundler/blob/35be6d9a603084f719fec4f4028c18860def07f6/spec/support/artifice/endpoint_strict_basic_authentication.rb | spec/support/artifice/endpoint_strict_basic_authentication.rb | # frozen_string_literal: true
require_relative "endpoint"
Artifice.deactivate
class EndpointStrictBasicAuthentication < Endpoint
before do
unless env["HTTP_AUTHORIZATION"]
halt 401, "Authentication info not supplied"
end
# Only accepts password == "password"
unless env["HTTP_AUTHORIZATION"] ... | ruby | MIT | 35be6d9a603084f719fec4f4028c18860def07f6 | 2026-01-04T15:44:52.942591Z | false |
rubygems/bundler | https://github.com/rubygems/bundler/blob/35be6d9a603084f719fec4f4028c18860def07f6/spec/support/artifice/vcr.rb | spec/support/artifice/vcr.rb | # frozen_string_literal: true
require "net/http"
require_relative "../path"
CASSETTE_PATH = "#{Spec::Path.spec_dir}/support/artifice/vcr_cassettes"
CASSETTE_NAME = ENV.fetch("BUNDLER_SPEC_VCR_CASSETTE_NAME") { "realworld" }
class BundlerVCRHTTP < Net::HTTP
class RequestHandler
attr_reader :http, :request, :bod... | ruby | MIT | 35be6d9a603084f719fec4f4028c18860def07f6 | 2026-01-04T15:44:52.942591Z | false |
rubygems/bundler | https://github.com/rubygems/bundler/blob/35be6d9a603084f719fec4f4028c18860def07f6/spec/support/artifice/endpoint_extra.rb | spec/support/artifice/endpoint_extra.rb | # frozen_string_literal: true
require_relative "endpoint"
Artifice.deactivate
class EndpointExtra < Endpoint
get "/extra/api/v1/dependencies" do
halt 404
end
get "/extra/specs.4.8.gz" do
File.read("#{gem_repo2}/specs.4.8.gz")
end
get "/extra/prerelease_specs.4.8.gz" do
File.read("#{gem_repo2}... | ruby | MIT | 35be6d9a603084f719fec4f4028c18860def07f6 | 2026-01-04T15:44:52.942591Z | false |
rubygems/bundler | https://github.com/rubygems/bundler/blob/35be6d9a603084f719fec4f4028c18860def07f6/spec/support/artifice/compact_index_range_not_satisfiable.rb | spec/support/artifice/compact_index_range_not_satisfiable.rb | # frozen_string_literal: true
require_relative "compact_index"
Artifice.deactivate
class CompactIndexRangeNotSatisfiable < CompactIndexAPI
get "/versions" do
if env["HTTP_RANGE"]
status 416
else
etag_response do
file = tmp("versions.list")
file.delete if file.file?
file ... | ruby | MIT | 35be6d9a603084f719fec4f4028c18860def07f6 | 2026-01-04T15:44:52.942591Z | false |
rubygems/bundler | https://github.com/rubygems/bundler/blob/35be6d9a603084f719fec4f4028c18860def07f6/spec/support/artifice/compact_index_wrong_gem_checksum.rb | spec/support/artifice/compact_index_wrong_gem_checksum.rb | # frozen_string_literal: true
require_relative "compact_index"
Artifice.deactivate
class CompactIndexWrongGemChecksum < CompactIndexAPI
get "/info/:name" do
etag_response do
name = params[:name]
gem = gems.find {|g| g.name == name }
checksum = ENV.fetch("BUNDLER_SPEC_#{name.upcase}_CHECKSUM")... | ruby | MIT | 35be6d9a603084f719fec4f4028c18860def07f6 | 2026-01-04T15:44:52.942591Z | false |
rubygems/bundler | https://github.com/rubygems/bundler/blob/35be6d9a603084f719fec4f4028c18860def07f6/spec/support/artifice/compact_index_extra_api_missing.rb | spec/support/artifice/compact_index_extra_api_missing.rb | # frozen_string_literal: true
require_relative "compact_index_extra_api"
Artifice.deactivate
class CompactIndexExtraAPIMissing < CompactIndexExtraApi
get "/extra/fetch/actual/gem/:id" do
if params[:id] == "missing-1.0.gemspec.rz"
halt 404
else
File.binread("#{gem_repo2}/quick/Marshal.4.8/#{para... | ruby | MIT | 35be6d9a603084f719fec4f4028c18860def07f6 | 2026-01-04T15:44:52.942591Z | false |
rubygems/bundler | https://github.com/rubygems/bundler/blob/35be6d9a603084f719fec4f4028c18860def07f6/spec/support/artifice/endpoint_500.rb | spec/support/artifice/endpoint_500.rb | # frozen_string_literal: true
require_relative "../path"
include Spec::Path
$LOAD_PATH.unshift(*Dir[Spec::Path.base_system_gems.join("gems/{artifice,mustermann,rack,tilt,sinatra,ruby2_keywords}-*/lib")].map(&:to_s))
require "artifice"
require "sinatra/base"
Artifice.deactivate
class Endpoint500 < Sinatra::Base
b... | ruby | MIT | 35be6d9a603084f719fec4f4028c18860def07f6 | 2026-01-04T15:44:52.942591Z | false |
rubygems/bundler | https://github.com/rubygems/bundler/blob/35be6d9a603084f719fec4f4028c18860def07f6/spec/support/artifice/endpoint_redirect.rb | spec/support/artifice/endpoint_redirect.rb | # frozen_string_literal: true
require_relative "endpoint"
Artifice.deactivate
class EndpointRedirect < Endpoint
get "/fetch/actual/gem/:id" do
redirect "/fetch/actual/gem/#{params[:id]}"
end
get "/api/v1/dependencies" do
status 404
end
end
Artifice.activate_with(EndpointRedirect)
| ruby | MIT | 35be6d9a603084f719fec4f4028c18860def07f6 | 2026-01-04T15:44:52.942591Z | false |
rubygems/bundler | https://github.com/rubygems/bundler/blob/35be6d9a603084f719fec4f4028c18860def07f6/spec/support/artifice/compact_index_creds_diff_host.rb | spec/support/artifice/compact_index_creds_diff_host.rb | # frozen_string_literal: true
require_relative "compact_index"
Artifice.deactivate
class CompactIndexCredsDiffHost < CompactIndexAPI
helpers do
def auth
@auth ||= Rack::Auth::Basic::Request.new(request.env)
end
def authorized?
auth.provided? && auth.basic? && auth.credentials && auth.crede... | ruby | MIT | 35be6d9a603084f719fec4f4028c18860def07f6 | 2026-01-04T15:44:52.942591Z | false |
rubygems/bundler | https://github.com/rubygems/bundler/blob/35be6d9a603084f719fec4f4028c18860def07f6/spec/support/artifice/compact_index_extra_missing.rb | spec/support/artifice/compact_index_extra_missing.rb | # frozen_string_literal: true
require_relative "compact_index_extra"
Artifice.deactivate
class CompactIndexExtraMissing < CompactIndexExtra
get "/extra/fetch/actual/gem/:id" do
if params[:id] == "missing-1.0.gemspec.rz"
halt 404
else
File.binread("#{gem_repo2}/quick/Marshal.4.8/#{params[:id]}")... | ruby | MIT | 35be6d9a603084f719fec4f4028c18860def07f6 | 2026-01-04T15:44:52.942591Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.