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
refile/refile
https://github.com/refile/refile/blob/c4ac577c6fdad92bc079a62a0e82888319daedc8/lib/refile/image_processing.rb
lib/refile/image_processing.rb
raise "[Refile] image processing has been extracted into a separate gem, see https://github.com/refile/refile-mini_magick"
ruby
MIT
c4ac577c6fdad92bc079a62a0e82888319daedc8
2026-01-04T15:55:25.004390Z
false
refile/refile
https://github.com/refile/refile/blob/c4ac577c6fdad92bc079a62a0e82888319daedc8/lib/refile/custom_logger.rb
lib/refile/custom_logger.rb
require "rack/body_proxy" module Refile # @api private class CustomLogger LOG_FORMAT = %(%s: [%s] %s "%s%s" %d %0.1fms\n) def initialize(app, prefix, logger_proc) @app = app @prefix = prefix @logger_proc = logger_proc end def call(env) began_at = Time.now status, hea...
ruby
MIT
c4ac577c6fdad92bc079a62a0e82888319daedc8
2026-01-04T15:55:25.004390Z
false
refile/refile
https://github.com/refile/refile/blob/c4ac577c6fdad92bc079a62a0e82888319daedc8/lib/refile/attachment/active_record.rb
lib/refile/attachment/active_record.rb
module Refile module ActiveRecord module Attachment include Refile::Attachment # Attachment method which hooks into ActiveRecord models # # @param [true, false] destroy Whether to remove the stored file if its model is destroyed # @return [void] # @see Refile::Attachment#atta...
ruby
MIT
c4ac577c6fdad92bc079a62a0e82888319daedc8
2026-01-04T15:55:25.004390Z
false
refile/refile
https://github.com/refile/refile/blob/c4ac577c6fdad92bc079a62a0e82888319daedc8/lib/refile/attachment/multiple_attachments.rb
lib/refile/attachment/multiple_attachments.rb
module Refile module Attachment # Builds a module to be used by "accepts_attachments_for" # # @api private module MultipleAttachments def self.new(collection_name, collection_class:, name:, attachment:, append:, &block) Module.new do define_method :"#{name}_attachment_definitio...
ruby
MIT
c4ac577c6fdad92bc079a62a0e82888319daedc8
2026-01-04T15:55:25.004390Z
false
refile/refile
https://github.com/refile/refile/blob/c4ac577c6fdad92bc079a62a0e82888319daedc8/lib/refile/rails/attachment_helper.rb
lib/refile/rails/attachment_helper.rb
module Refile # Rails view helpers which aid in using Refile from views. module AttachmentHelper # Form builder extension module FormBuilder # @see AttachmentHelper#attachment_field def attachment_field(method, options = {}) self.multipart = true @template.attachment_field(@objec...
ruby
MIT
c4ac577c6fdad92bc079a62a0e82888319daedc8
2026-01-04T15:55:25.004390Z
false
refile/refile
https://github.com/refile/refile/blob/c4ac577c6fdad92bc079a62a0e82888319daedc8/lib/refile/backend/s3.rb
lib/refile/backend/s3.rb
raise "[Refile] the S3 backend has been extracted into a separate gem, see https://github.com/refile/refile-s3"
ruby
MIT
c4ac577c6fdad92bc079a62a0e82888319daedc8
2026-01-04T15:55:25.004390Z
false
refile/refile
https://github.com/refile/refile/blob/c4ac577c6fdad92bc079a62a0e82888319daedc8/lib/refile/backend/file_system.rb
lib/refile/backend/file_system.rb
module Refile module Backend # A backend which stores uploaded files in the local filesystem # # @example # backend = Refile::Backend::FileSystem.new("some/path") # file = backend.upload(StringIO.new("hello")) # backend.read(file.id) # => "hello" class FileSystem extend Refile:...
ruby
MIT
c4ac577c6fdad92bc079a62a0e82888319daedc8
2026-01-04T15:55:25.004390Z
false
refile/refile
https://github.com/refile/refile/blob/c4ac577c6fdad92bc079a62a0e82888319daedc8/config/routes.rb
config/routes.rb
if Refile.automount Rails.application.routes.draw do mount Refile.app, at: Refile.mount_point, as: :refile_app end end
ruby
MIT
c4ac577c6fdad92bc079a62a0e82888319daedc8
2026-01-04T15:55:25.004390Z
false
jmettraux/rufus-scheduler
https://github.com/jmettraux/rufus-scheduler/blob/4a73a058c9415ea2c60df68f14274cb7f05bae42/misc/six_field_cronline_test.rb
misc/six_field_cronline_test.rb
#!/usr/bin/env ruby # # six_field_cronline_test.rb # # Demonstrates an odd behavior with six-field cronlines. We compare # two schedules which ought to be identical: # # each: 10s # cron: */10 * * * * * # # When we run this with rufus-scheduler 3.1.3, we get something like: # # $ misc/six_field_cronline_test.rb ...
ruby
MIT
4a73a058c9415ea2c60df68f14274cb7f05bae42
2026-01-04T15:55:38.165936Z
false
jmettraux/rufus-scheduler
https://github.com/jmettraux/rufus-scheduler/blob/4a73a058c9415ea2c60df68f14274cb7f05bae42/misc/cronline_next_time_cost.rb
misc/cronline_next_time_cost.rb
$:.unshift('lib') require 'rufus/scheduler' loop do print "> " s = gets cl = Rufus::Scheduler::CronLine.new(s) t = Time.now puts cl.next_time puts "took #{Time.now - t} secs" t = Time.now p cl.frequency puts "took #{Time.now - t} secs" end
ruby
MIT
4a73a058c9415ea2c60df68f14274cb7f05bae42
2026-01-04T15:55:38.165936Z
false
jmettraux/rufus-scheduler
https://github.com/jmettraux/rufus-scheduler/blob/4a73a058c9415ea2c60df68f14274cb7f05bae42/misc/kssminus_38k_jobs.rb
misc/kssminus_38k_jobs.rb
require 'rufus-scheduler' p [ RUBY_VERSION, RUBY_PLATFORM ] crons = [ '* * * * *', '*/5 * * * *', '*/10 * * * *', '10 4 * * *', '35 */3 * * *', '* */3 * * *', '16 */4 * * *', '30 14 * * *', '26 */2 * * *' ] total = 38_000 / crons.length crons.each do |cron| s = Rufus::Scheduler.new t0 = Time....
ruby
MIT
4a73a058c9415ea2c60df68f14274cb7f05bae42
2026-01-04T15:55:38.165936Z
false
jmettraux/rufus-scheduler
https://github.com/jmettraux/rufus-scheduler/blob/4a73a058c9415ea2c60df68f14274cb7f05bae42/misc/gacha_test.rb
misc/gacha_test.rb
# # from @gacha # # in https://github.com/jmettraux/rufus-scheduler/issues/84 # # # Linux 3.2.0-4-amd64 #1 SMP Debian 3.2.46-1+deb7u1 x86_64 GNU/Linux # # # * max work threads default to 28 (was 35) # # ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux] # dies ("Killed") after reaching 22 work threads # # ruby...
ruby
MIT
4a73a058c9415ea2c60df68f14274cb7f05bae42
2026-01-04T15:55:38.165936Z
false
jmettraux/rufus-scheduler
https://github.com/jmettraux/rufus-scheduler/blob/4a73a058c9415ea2c60df68f14274cb7f05bae42/misc/tz_all.rb
misc/tz_all.rb
require 'tzinfo' # if tzinfo-data is installed, tzinfo picks it up # automatically #TZInfo::Timezone.all.each { |tz| puts tz.name } tzs = TZInfo::Timezone.all.sort_by { |tz| tz.name.length } puts "TIMEZONES = %[" l = 0 tzs.each do |tz| if l + tz.name.length > 79 puts; l = 0 elsif l > 0 print ' '; l += 1 ...
ruby
MIT
4a73a058c9415ea2c60df68f14274cb7f05bae42
2026-01-04T15:55:38.165936Z
false
jmettraux/rufus-scheduler
https://github.com/jmettraux/rufus-scheduler/blob/4a73a058c9415ea2c60df68f14274cb7f05bae42/misc/freq.rb
misc/freq.rb
require 'benchmark' $:.unshift('lib') require 'rufus/scheduler' N = 10 puts puts "Ruby: #{RUBY_PLATFORM} #{RUBY_VERSION}" puts "N is #{N}" puts Benchmark.benchmark(Benchmark::Tms::CAPTION, 31) do |b| cl = Rufus::Scheduler::CronLine.new('*/2 * * * *') b.report('.next_time') do N.times { cl.next_time } e...
ruby
MIT
4a73a058c9415ea2c60df68f14274cb7f05bae42
2026-01-04T15:55:38.165936Z
false
jmettraux/rufus-scheduler
https://github.com/jmettraux/rufus-scheduler/blob/4a73a058c9415ea2c60df68f14274cb7f05bae42/misc/kssminus_38k_jobs_rprof.rb
misc/kssminus_38k_jobs_rprof.rb
require 'ruby-prof' require 'rufus-scheduler' p [ RUBY_VERSION, RUBY_PLATFORM ] s = Rufus::Scheduler.new t = Time.now profile = RubyProf.profile do 10.times do s.cron('*/5 * * * *') {} end end p Time.now - t #printer = RubyProf::GraphPrinter.new(profile) #printer = RubyProf::GraphHtmlPrinter.new(profile) #...
ruby
MIT
4a73a058c9415ea2c60df68f14274cb7f05bae42
2026-01-04T15:55:38.165936Z
false
jmettraux/rufus-scheduler
https://github.com/jmettraux/rufus-scheduler/blob/4a73a058c9415ea2c60df68f14274cb7f05bae42/spec/parse_spec.rb
spec/parse_spec.rb
# # Specifying rufus-scheduler # # Wed Apr 17 06:00:59 JST 2013 # require 'spec_helper' describe Rufus::Scheduler do describe '.parse' do def pa(s, opts={}); Rufus::Scheduler.parse(s, opts); end def paus(s); Rufus::Scheduler.parse(s).getutc.strftime('%c'); end it 'parses duration strings' do ...
ruby
MIT
4a73a058c9415ea2c60df68f14274cb7f05bae42
2026-01-04T15:55:38.165936Z
false
jmettraux/rufus-scheduler
https://github.com/jmettraux/rufus-scheduler/blob/4a73a058c9415ea2c60df68f14274cb7f05bae42/spec/schedule_interval_spec.rb
spec/schedule_interval_spec.rb
# # Specifying rufus-scheduler # # Wed Aug 7 06:20:55 JST 2013 # require 'spec_helper' describe Rufus::Scheduler do before :each do @scheduler = Rufus::Scheduler.new end after :each do @scheduler.shutdown end describe '#interval' do it 'adds a job' do @scheduler.interval(10) do ...
ruby
MIT
4a73a058c9415ea2c60df68f14274cb7f05bae42
2026-01-04T15:55:38.165936Z
false
jmettraux/rufus-scheduler
https://github.com/jmettraux/rufus-scheduler/blob/4a73a058c9415ea2c60df68f14274cb7f05bae42/spec/lock_spec.rb
spec/lock_spec.rb
# # Specifying rufus-scheduler # # Sat Aug 16 05:42:11 JST 2014 # added by @ecin # require 'spec_helper' describe Rufus::Scheduler do context "when running multiple schedulers side-by-side" do class AlwaysLock def lock; true; end def unlock; true; end def locked?; true; end end cl...
ruby
MIT
4a73a058c9415ea2c60df68f14274cb7f05bae42
2026-01-04T15:55:38.165936Z
false
jmettraux/rufus-scheduler
https://github.com/jmettraux/rufus-scheduler/blob/4a73a058c9415ea2c60df68f14274cb7f05bae42/spec/schedule_in_spec.rb
spec/schedule_in_spec.rb
# # Specifying rufus-scheduler # # Wed Apr 17 06:00:59 JST 2013 # require 'spec_helper' describe Rufus::Scheduler do before :each do @scheduler = Rufus::Scheduler.new end after :each do @scheduler.shutdown end describe '#in' do it 'adds a job' do @scheduler.in(3600) do end ...
ruby
MIT
4a73a058c9415ea2c60df68f14274cb7f05bae42
2026-01-04T15:55:38.165936Z
false
jmettraux/rufus-scheduler
https://github.com/jmettraux/rufus-scheduler/blob/4a73a058c9415ea2c60df68f14274cb7f05bae42/spec/job_every_spec.rb
spec/job_every_spec.rb
# # Specifying rufus-scheduler # # Wed Apr 17 06:00:59 JST 2013 # require 'spec_helper' describe Rufus::Scheduler::EveryJob do before :each do @scheduler = Rufus::Scheduler.new end after :each do @scheduler.shutdown end it 'triggers as expected' do counter = 0 @scheduler.every '1s' do ...
ruby
MIT
4a73a058c9415ea2c60df68f14274cb7f05bae42
2026-01-04T15:55:38.165936Z
false
jmettraux/rufus-scheduler
https://github.com/jmettraux/rufus-scheduler/blob/4a73a058c9415ea2c60df68f14274cb7f05bae42/spec/schedule_spec.rb
spec/schedule_spec.rb
# # Specifying rufus-scheduler # # Sat Aug 13 21:00:31 JST 2016 # require 'spec_helper' describe Rufus::Scheduler do before :each do @scheduler = Rufus::Scheduler.new end after :each do @scheduler.shutdown end describe '#schedule' do it 'leaves the schedule option hash untouched (2 args)' d...
ruby
MIT
4a73a058c9415ea2c60df68f14274cb7f05bae42
2026-01-04T15:55:38.165936Z
false
jmettraux/rufus-scheduler
https://github.com/jmettraux/rufus-scheduler/blob/4a73a058c9415ea2c60df68f14274cb7f05bae42/spec/job_array_spec.rb
spec/job_array_spec.rb
# # Specifying rufus-scheduler # # Wed Apr 17 06:00:59 JST 2013 # require 'spec_helper' describe Rufus::Scheduler::JobArray do class DummyJob < Struct.new(:id, :next_time); end before(:each) do @array = Rufus::Scheduler::JobArray.new end describe '#push' do it 'pushes jobs' do @array.push...
ruby
MIT
4a73a058c9415ea2c60df68f14274cb7f05bae42
2026-01-04T15:55:38.165936Z
false
jmettraux/rufus-scheduler
https://github.com/jmettraux/rufus-scheduler/blob/4a73a058c9415ea2c60df68f14274cb7f05bae42/spec/schedule_cron_spec.rb
spec/schedule_cron_spec.rb
# # Specifying rufus-scheduler # # Sat Jul 13 04:52:08 JST 2013 # # In the train between Bern and Fribourg, riding back # from the @ruvetia drinkup # require 'spec_helper' describe Rufus::Scheduler do before :each do @scheduler = Rufus::Scheduler.new end after :each do @scheduler.shutdown end de...
ruby
MIT
4a73a058c9415ea2c60df68f14274cb7f05bae42
2026-01-04T15:55:38.165936Z
false
jmettraux/rufus-scheduler
https://github.com/jmettraux/rufus-scheduler/blob/4a73a058c9415ea2c60df68f14274cb7f05bae42/spec/basics_spec.rb
spec/basics_spec.rb
# # Specifying rufus-scheduler # # Sun Jun 1 05:52:24 JST 2014 # require 'spec_helper' describe 'basics' do def tts(time) #time.strftime('%Y-%m-%d %H:%M:%S %z') + (time.dst? ? ' dst' : '') [ time.strftime('%Y-%m-%d %H:%M:%S'), time.utc_offset.to_s, time.dst? ? 'dst' : '' ].select ...
ruby
MIT
4a73a058c9415ea2c60df68f14274cb7f05bae42
2026-01-04T15:55:38.165936Z
false
jmettraux/rufus-scheduler
https://github.com/jmettraux/rufus-scheduler/blob/4a73a058c9415ea2c60df68f14274cb7f05bae42/spec/threads_spec.rb
spec/threads_spec.rb
# # Specifying rufus-scheduler # # Thu Jul 25 05:53:51 JST 2013 # require 'spec_helper' describe Rufus::Scheduler do before :each do @scheduler = Rufus::Scheduler.new end after :each do @scheduler.shutdown end context 'thread pool' do it 'starts with an empty thread pool' do expect(@...
ruby
MIT
4a73a058c9415ea2c60df68f14274cb7f05bae42
2026-01-04T15:55:38.165936Z
false
jmettraux/rufus-scheduler
https://github.com/jmettraux/rufus-scheduler/blob/4a73a058c9415ea2c60df68f14274cb7f05bae42/spec/schedule_every_spec.rb
spec/schedule_every_spec.rb
# # Specifying rufus-scheduler # # Wed Apr 17 06:00:59 JST 2013 # require 'spec_helper' describe Rufus::Scheduler do before :each do @scheduler = Rufus::Scheduler.new end after :each do @scheduler.shutdown end describe '#every' do it 'adds a job' do @scheduler.every(10) do end ...
ruby
MIT
4a73a058c9415ea2c60df68f14274cb7f05bae42
2026-01-04T15:55:38.165936Z
false
jmettraux/rufus-scheduler
https://github.com/jmettraux/rufus-scheduler/blob/4a73a058c9415ea2c60df68f14274cb7f05bae42/spec/lock_custom_spec.rb
spec/lock_custom_spec.rb
# # Specifying rufus-scheduler # # Fri Nov 1 05:56:03 JST 2013 # # Ishinomaki # require 'spec_helper' describe Rufus::Scheduler do class LosingLockScheduler < Rufus::Scheduler attr_reader :counter def initialize super @counter = 0 end def confirm_lock @counter = @counter + 1...
ruby
MIT
4a73a058c9415ea2c60df68f14274cb7f05bae42
2026-01-04T15:55:38.165936Z
false
jmettraux/rufus-scheduler
https://github.com/jmettraux/rufus-scheduler/blob/4a73a058c9415ea2c60df68f14274cb7f05bae42/spec/job_at_spec.rb
spec/job_at_spec.rb
# # Specifying rufus-scheduler # # Wed Apr 17 06:00:59 JST 2013 # require 'spec_helper' describe Rufus::Scheduler::AtJob do before :each do @scheduler = Rufus::Scheduler.new end after :each do @scheduler.shutdown end describe '#unschedule' do it 'unschedules the job' do job = @schedu...
ruby
MIT
4a73a058c9415ea2c60df68f14274cb7f05bae42
2026-01-04T15:55:38.165936Z
false
jmettraux/rufus-scheduler
https://github.com/jmettraux/rufus-scheduler/blob/4a73a058c9415ea2c60df68f14274cb7f05bae42/spec/job_interval_spec.rb
spec/job_interval_spec.rb
# # Specifying rufus-scheduler # # Wed Apr 17 06:00:59 JST 2013 # require 'spec_helper' describe Rufus::Scheduler::IntervalJob do before :each do @scheduler = Rufus::Scheduler.new end after :each do @scheduler.shutdown end describe '#interval' do it 'returns the scheduled interval' do ...
ruby
MIT
4a73a058c9415ea2c60df68f14274cb7f05bae42
2026-01-04T15:55:38.165936Z
false
jmettraux/rufus-scheduler
https://github.com/jmettraux/rufus-scheduler/blob/4a73a058c9415ea2c60df68f14274cb7f05bae42/spec/lock_lockfile_spec.rb
spec/lock_lockfile_spec.rb
# # Specifying rufus-scheduler # # Tue Aug 13 05:58:48 JST 2013 # require 'spec_helper' describe Rufus::Scheduler do after :each do FileUtils.rm_f('.rufus-scheduler.lock') FileUtils.rm_f('lock.txt') end context ':lockfile => ".rufus-scheduler.lock"' do it 'writes down a .rufus-scheduler.lock f...
ruby
MIT
4a73a058c9415ea2c60df68f14274cb7f05bae42
2026-01-04T15:55:38.165936Z
false
jmettraux/rufus-scheduler
https://github.com/jmettraux/rufus-scheduler/blob/4a73a058c9415ea2c60df68f14274cb7f05bae42/spec/job_repeat_spec.rb
spec/job_repeat_spec.rb
# # Specifying rufus-scheduler # # Wed Apr 17 06:00:59 JST 2013 # require 'spec_helper' describe Rufus::Scheduler::RepeatJob do before :each do @scheduler = Rufus::Scheduler.new end after :each do @scheduler.shutdown end describe '#pause' do it 'pauses the job' do counter = 0 ...
ruby
MIT
4a73a058c9415ea2c60df68f14274cb7f05bae42
2026-01-04T15:55:38.165936Z
false
jmettraux/rufus-scheduler
https://github.com/jmettraux/rufus-scheduler/blob/4a73a058c9415ea2c60df68f14274cb7f05bae42/spec/lock_flock_spec.rb
spec/lock_flock_spec.rb
# # Specifying rufus-scheduler # # Sat Aug 16 05:43:06 JST 2014 # added by @ecin # require 'spec_helper' describe Rufus::Scheduler::FileLock do before :each do @lock_path = '.rufus-scheduler.lock' @lock = Rufus::Scheduler::FileLock.new(@lock_path) end after :each do FileUtils.rm_f(@lock_path) ...
ruby
MIT
4a73a058c9415ea2c60df68f14274cb7f05bae42
2026-01-04T15:55:38.165936Z
false
jmettraux/rufus-scheduler
https://github.com/jmettraux/rufus-scheduler/blob/4a73a058c9415ea2c60df68f14274cb7f05bae42/spec/job_in_spec.rb
spec/job_in_spec.rb
# # Specifying rufus-scheduler # # Wed Apr 17 06:00:59 JST 2013 # require 'spec_helper' describe Rufus::Scheduler::InJob do before :each do @scheduler = Rufus::Scheduler.new end after :each do @scheduler.shutdown end describe '#next_times' do it 'returns the next n times' do job = @s...
ruby
MIT
4a73a058c9415ea2c60df68f14274cb7f05bae42
2026-01-04T15:55:38.165936Z
false
jmettraux/rufus-scheduler
https://github.com/jmettraux/rufus-scheduler/blob/4a73a058c9415ea2c60df68f14274cb7f05bae42/spec/scheduler_spec.rb
spec/scheduler_spec.rb
# # Specifying rufus-scheduler # # Wed Apr 17 06:00:59 JST 2013 # require 'spec_helper' describe Rufus::Scheduler do describe '#initialize' do it 'starts the scheduler thread' do scheduler = Rufus::Scheduler.new t = Thread.list.find { |t| t[:name] == "rufus_scheduler_#{scheduler.object...
ruby
MIT
4a73a058c9415ea2c60df68f14274cb7f05bae42
2026-01-04T15:55:38.165936Z
false
jmettraux/rufus-scheduler
https://github.com/jmettraux/rufus-scheduler/blob/4a73a058c9415ea2c60df68f14274cb7f05bae42/spec/job_cron_spec.rb
spec/job_cron_spec.rb
# # Specifying rufus-scheduler # # Wed Apr 17 06:00:59 JST 2013 # require 'spec_helper' describe Rufus::Scheduler::CronJob do before :each do @scheduler = Rufus::Scheduler.new end after :each do @scheduler.shutdown end context 'normal' do it 'triggers near the zero second' do job = @...
ruby
MIT
4a73a058c9415ea2c60df68f14274cb7f05bae42
2026-01-04T15:55:38.165936Z
false
jmettraux/rufus-scheduler
https://github.com/jmettraux/rufus-scheduler/blob/4a73a058c9415ea2c60df68f14274cb7f05bae42/spec/schedule_at_spec.rb
spec/schedule_at_spec.rb
# # Specifying rufus-scheduler # # Wed Apr 17 06:00:59 JST 2013 # require 'spec_helper' describe Rufus::Scheduler do before :each do @scheduler = Rufus::Scheduler.new end after :each do @scheduler.shutdown end describe '#at' do it 'raises if the block to schedule is missing' do expec...
ruby
MIT
4a73a058c9415ea2c60df68f14274cb7f05bae42
2026-01-04T15:55:38.165936Z
false
jmettraux/rufus-scheduler
https://github.com/jmettraux/rufus-scheduler/blob/4a73a058c9415ea2c60df68f14274cb7f05bae42/spec/job_spec.rb
spec/job_spec.rb
# # Specifying rufus-scheduler # # Wed Apr 17 06:00:59 JST 2013 # require 'spec_helper' describe Rufus::Scheduler::Job do # specify behaviours common to all job classes before :each do @taoe = Thread.abort_on_exception Thread.abort_on_exception = false @ose = $stderr $stderr = StringIO.new ...
ruby
MIT
4a73a058c9415ea2c60df68f14274cb7f05bae42
2026-01-04T15:55:38.165936Z
false
jmettraux/rufus-scheduler
https://github.com/jmettraux/rufus-scheduler/blob/4a73a058c9415ea2c60df68f14274cb7f05bae42/spec/error_spec.rb
spec/error_spec.rb
# # Specifying rufus-scheduler # # Fri Aug 9 07:10:18 JST 2013 # require 'spec_helper' describe Rufus::Scheduler do before :each do @taoe = Thread.abort_on_exception Thread.abort_on_exception = false @ose = $stderr $stderr = StringIO.new @scheduler = Rufus::Scheduler.new end after :e...
ruby
MIT
4a73a058c9415ea2c60df68f14274cb7f05bae42
2026-01-04T15:55:38.165936Z
false
jmettraux/rufus-scheduler
https://github.com/jmettraux/rufus-scheduler/blob/4a73a058c9415ea2c60df68f14274cb7f05bae42/spec/spec_helper.rb
spec/spec_helper.rb
# # Specifying rufus-scheduler # # Wed Apr 17 06:00:59 JST 2013 # require 'pp' Thread.abort_on_exception = true require 'stringio' require 'rufus-scheduler' puts puts __FILE__ puts puts "RUBY_VERSION => #{RUBY_VERSION.inspect}" puts "RUBY_PLATFORM => #{RUBY_PLATFORM.inspect}" puts def dump_zones puts "*" * ...
ruby
MIT
4a73a058c9415ea2c60df68f14274cb7f05bae42
2026-01-04T15:55:38.165936Z
false
jmettraux/rufus-scheduler
https://github.com/jmettraux/rufus-scheduler/blob/4a73a058c9415ea2c60df68f14274cb7f05bae42/lib/rufus-scheduler.rb
lib/rufus-scheduler.rb
require 'rufus/scheduler'
ruby
MIT
4a73a058c9415ea2c60df68f14274cb7f05bae42
2026-01-04T15:55:38.165936Z
false
jmettraux/rufus-scheduler
https://github.com/jmettraux/rufus-scheduler/blob/4a73a058c9415ea2c60df68f14274cb7f05bae42/lib/rufus/scheduler.rb
lib/rufus/scheduler.rb
require 'date' if RUBY_VERSION < '1.9.0' require 'thread' require 'fugit' module Rufus; end class Rufus::Scheduler VERSION = '3.9.2' EoTime = ::EtOrbi::EoTime require 'rufus/scheduler/util' require 'rufus/scheduler/jobs_core' require 'rufus/scheduler/jobs_one_time' require 'rufus/scheduler/jobs_repe...
ruby
MIT
4a73a058c9415ea2c60df68f14274cb7f05bae42
2026-01-04T15:55:38.165936Z
false
jmettraux/rufus-scheduler
https://github.com/jmettraux/rufus-scheduler/blob/4a73a058c9415ea2c60df68f14274cb7f05bae42/lib/rufus/scheduler/jobs_core.rb
lib/rufus/scheduler/jobs_core.rb
class Rufus::Scheduler::Job EoTime = ::EtOrbi::EoTime # # Used by Job#kill # class KillSignal < StandardError; end attr_reader :id attr_reader :opts attr_reader :original attr_reader :scheduled_at attr_reader :last_time attr_reader :unscheduled_at attr_reader :tags attr_reader :locals at...
ruby
MIT
4a73a058c9415ea2c60df68f14274cb7f05bae42
2026-01-04T15:55:38.165936Z
false
jmettraux/rufus-scheduler
https://github.com/jmettraux/rufus-scheduler/blob/4a73a058c9415ea2c60df68f14274cb7f05bae42/lib/rufus/scheduler/job_array.rb
lib/rufus/scheduler/job_array.rb
# # The array rufus-scheduler uses to keep jobs in order (next to trigger # first). # class Rufus::Scheduler::JobArray def initialize @mutex = Mutex.new @array = [] end def push(job) @mutex.synchronize { @array << job unless @array.index(job) } self end def size @array.size end ...
ruby
MIT
4a73a058c9415ea2c60df68f14274cb7f05bae42
2026-01-04T15:55:38.165936Z
false
jmettraux/rufus-scheduler
https://github.com/jmettraux/rufus-scheduler/blob/4a73a058c9415ea2c60df68f14274cb7f05bae42/lib/rufus/scheduler/locks.rb
lib/rufus/scheduler/locks.rb
require 'fileutils' # # A lock that can always be acquired # class Rufus::Scheduler::NullLock # Locking is always successful. # def lock; true; end def locked?; true; end def unlock; true; end end # # The standard flock mechanism, with its own class thanks to @ecin # class Rufus::Scheduler::FileLock ...
ruby
MIT
4a73a058c9415ea2c60df68f14274cb7f05bae42
2026-01-04T15:55:38.165936Z
false
jmettraux/rufus-scheduler
https://github.com/jmettraux/rufus-scheduler/blob/4a73a058c9415ea2c60df68f14274cb7f05bae42/lib/rufus/scheduler/jobs_one_time.rb
lib/rufus/scheduler/jobs_one_time.rb
class Rufus::Scheduler::OneTimeJob < Rufus::Scheduler::Job alias time next_time def occurrences(time0, time1) (time >= time0 && time <= time1) ? [ time ] : [] end # Used when discard_past? is set to true or :fail at scheduler or job level... # def past? @next_time && @next_time < Time.now ...
ruby
MIT
4a73a058c9415ea2c60df68f14274cb7f05bae42
2026-01-04T15:55:38.165936Z
false
jmettraux/rufus-scheduler
https://github.com/jmettraux/rufus-scheduler/blob/4a73a058c9415ea2c60df68f14274cb7f05bae42/lib/rufus/scheduler/util.rb
lib/rufus/scheduler/util.rb
class Rufus::Scheduler class << self #-- # time and string methods #++ def parse(o, opts={}) opts[:no_error] = true parse_cron(o, opts) || parse_in(o, opts) || # covers 'every' schedule strings parse_at(o, opts) || fail(ArgumentError.new("couldn't parse #{o.inspect}...
ruby
MIT
4a73a058c9415ea2c60df68f14274cb7f05bae42
2026-01-04T15:55:38.165936Z
false
jmettraux/rufus-scheduler
https://github.com/jmettraux/rufus-scheduler/blob/4a73a058c9415ea2c60df68f14274cb7f05bae42/lib/rufus/scheduler/jobs_repeat.rb
lib/rufus/scheduler/jobs_repeat.rb
class Rufus::Scheduler::RepeatJob < Rufus::Scheduler::Job attr_reader :paused_at attr_reader :first_at attr_reader :last_at attr_accessor :times def initialize(scheduler, duration, opts, block) super @paused_at = nil @times = opts[:times] @first_at_no_error = opts[:first_at_no_error] |...
ruby
MIT
4a73a058c9415ea2c60df68f14274cb7f05bae42
2026-01-04T15:55:38.165936Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_rake_functional.rb
test/test_rake_functional.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestRakeFunctional < Rake::TestCase # :nodoc: include RubyRunner def setup super if @verbose puts puts puts "-" * 80 puts @__name__ puts "-" * 80 end end def test_rake_default ra...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_rake_backtrace.rb
test/test_rake_backtrace.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestBacktraceSuppression < Rake::TestCase # :nodoc: def test_bin_rake_suppressed paths = ["something/bin/rake:12"] actual = Rake::Backtrace.collapse(paths) assert_equal [], actual end def test_system_dir_suppressed...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_trace_output.rb
test/test_trace_output.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestTraceOutput < Rake::TestCase # :nodoc: include Rake::TraceOutput class PrintSpy # :nodoc: attr_reader :result, :calls def initialize @result = "".dup @calls = 0 end def print(string) @result...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_rake_dsl.rb
test/test_rake_dsl.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestRakeDsl < Rake::TestCase # :nodoc: def setup super Rake::Task.clear end def test_namespace_command namespace "n" do task "t" end refute_nil Rake::Task["n:t"] end def test_namespace_command_wit...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_rake_file_utils.rb
test/test_rake_file_utils.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) require "fileutils" class TestRakeFileUtils < Rake::TestCase # :nodoc: def setup super @rake_test_sh = ENV["RAKE_TEST_SH"] end def teardown FileUtils::LN_SUPPORTED[0] = true RakeFileUtils.verbose_flag = Rake::FileUtils...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_rake_path_map_explode.rb
test/test_rake_path_map_explode.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestRakePathMapExplode < Rake::TestCase # :nodoc: def setup super String.class_eval { public :pathmap_explode } end def teardown String.class_eval { protected :pathmap_explode } super end def test_explode ...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_rake_late_time.rb
test/test_rake_late_time.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestRakeLateTime < Rake::TestCase # :nodoc: def test_late_time_comparisons late = Rake::LATE assert_equal late, late assert late >= Time.now assert late > Time.now assert late != Time.now assert Time.now < lat...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_thread_history_display.rb
test/test_thread_history_display.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) require "rake/thread_history_display" class TestThreadHistoryDisplay < Rake::TestCase # :nodoc: def setup super @time = 1_000_000 @stats = [] @display = Rake::ThreadHistoryDisplay.new(@stats) end def test_banner o...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_rake_makefile_loader.rb
test/test_rake_makefile_loader.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) require "rake/loaders/makefile" class TestRakeMakefileLoader < Rake::TestCase # :nodoc: include Rake def test_parse Dir.chdir @tempdir File.write "sample.mf", <<~'SAMPLE_MF' # Comments a: a1 a2 a3 a4 b: b1 b2...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_rake_file_creation_task.rb
test/test_rake_file_creation_task.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) require "fileutils" class TestRakeFileCreationTask < Rake::TestCase # :nodoc: include Rake DUMMY_DIR = "dummy_dir" def setup super Task.clear end def test_file_needed create_dir DUMMY_DIR fc_task = Task[DUMMY_DI...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_rake_clean.rb
test/test_rake_clean.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) require "rake/clean" class TestRakeClean < Rake::TestCase # :nodoc: def test_clean if RUBY_ENGINE == "truffleruby" and RUBY_ENGINE_VERSION.start_with?("19.3.") load "rake/clean.rb" # TruffleRuby 19.3 does not set self correctly w...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_rake_task_argument_parsing.rb
test/test_rake_task_argument_parsing.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestRakeTaskArgumentParsing < Rake::TestCase # :nodoc: def setup super @app = Rake::Application.new end def test_name_only name, args = @app.parse_task_string("name") assert_equal "name", name assert_equal [...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_rake_rake_test_loader.rb
test/test_rake_rake_test_loader.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestRakeRakeTestLoader < Rake::TestCase # :nodoc: def setup super @loader = File.join @rake_lib, "rake/rake_test_loader.rb" end def test_pattern orig_loaded_features = $:.dup FileUtils.touch "foo.rb" FileUt...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_rake_application_options.rb
test/test_rake_application_options.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) TESTING_REQUIRE = [] class TestRakeApplicationOptions < Rake::TestCase # :nodoc: def setup super @testkey = ENV["TESTKEY"] Rake::FileUtilsExt.verbose_flag = false Rake::FileUtilsExt.nowrite_flag = false TESTING_REQUI...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_rake_scope.rb
test/test_rake_scope.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestRakeScope < Rake::TestCase # :nodoc: include Rake def test_path_against_empty_scope scope = Scope.make assert_equal scope, Scope::EMPTY assert_equal scope.path, "" end def test_path_against_one_element sco...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_rake_invocation_chain.rb
test/test_rake_invocation_chain.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestRakeInvocationChain < Rake::TestCase # :nodoc: include Rake def setup super @empty = InvocationChain.empty @first_member = "A" @second_member = "B" @one = @empty.append(@first_member) @two = @one.appe...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_rake_task_with_arguments.rb
test/test_rake_task_with_arguments.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestRakeTaskWithArguments < Rake::TestCase # :nodoc: include Rake def setup super Task.clear Rake::TaskManager.record_task_metadata = true end def teardown Rake::TaskManager.record_task_metadata = false R...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_rake_package_task.rb
test/test_rake_package_task.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) require "rake/packagetask" class TestRakePackageTask < Rake::TestCase # :nodoc: def test_initialize touch "install.rb" touch "a.c" touch "b.c" mkdir "CVS" touch "a.rb~" pkg = Rake::PackageTask.new("pkgr", "1.2.3")...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_rake_pseudo_status.rb
test/test_rake_pseudo_status.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestRakePseudoStatus < Rake::TestCase # :nodoc: def test_with_zero_exit_status s = Rake::PseudoStatus.new assert_equal 0, s.exitstatus assert_equal 0, s.to_i assert_equal 0, s >> 8 refute s.stopped? assert s.e...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_rake_rules.rb
test/test_rake_rules.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) require "fileutils" class TestRakeRules < Rake::TestCase # :nodoc: include Rake SRCFILE = "abc.c" SRCFILE2 = "xyz.c" FTNFILE = "abc.f" OBJFILE = "abc.o" FOOFILE = "foo" DOTFOOFILE = ".foo" MINFILE = "abc.min...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_rake_definitions.rb
test/test_rake_definitions.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) require "fileutils" class TestRakeDefinitions < Rake::TestCase # :nodoc: include Rake EXISTINGFILE = "existing" def setup super Task.clear end def test_task done = false task one: [:two] do done = true end t...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_rake_name_space.rb
test/test_rake_name_space.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestRakeNameSpace < Rake::TestCase # :nodoc: class TM # :nodoc: include Rake::TaskManager end def test_namespace_creation mgr = TM.new ns = Rake::NameSpace.new(mgr, []) refute_nil ns end def test_namespace_...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_rake_task_arguments.rb
test/test_rake_task_arguments.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestRakeTaskArguments < Rake::TestCase # :nodoc: def teardown ENV.delete("rev") ENV.delete("VER") super end def test_empty_arg_list_is_empty ta = Rake::TaskArguments.new([], []) assert_equal({}, ta.to_hash) ...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_rake_file_list.rb
test/test_rake_file_list.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) require "pathname" class TestRakeFileList < Rake::TestCase # :nodoc: FileList = Rake::FileList # :nodoc: def setup super FileUtils.mkdir "CVS" rescue nil FileUtils.mkdir ".svn" rescue nil @cdir = "cfiles" FileUtils....
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_rake_task_manager.rb
test/test_rake_task_manager.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestRakeTaskManager < Rake::TestCase # :nodoc: def setup super @tm = Rake::TestCase::TaskManager.new end def test_create_task_manager refute_nil @tm assert_equal [], @tm.tasks end def test_define_task ...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_rake_multi_task.rb
test/test_rake_multi_task.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) require "thread" class TestRakeMultiTask < Rake::TestCase # :nodoc: include Rake def setup super Task.clear @runs = Array.new @mutex = Mutex.new end def teardown Rake.application.thread_pool.join super e...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_rake_thread_pool.rb
test/test_rake_thread_pool.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) require "rake/thread_pool" class TestRakeTestThreadPool < Rake::TestCase # :nodoc: include Rake def test_pool_executes_in_current_thread_for_zero_threads pool = ThreadPool.new(0) f = pool.future { Thread.current } pool.join ...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_rake_extension.rb
test/test_rake_extension.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) require "stringio" class TestRakeExtension < Rake::TestCase # :nodoc: module Redirect # :nodoc: def error_redirect old_err = $stderr result = StringIO.new $stderr = result yield result ensure $s...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_rake_path_map_partial.rb
test/test_rake_path_map_partial.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestRakePathMapPartial < Rake::TestCase # :nodoc: def test_pathmap_partial @path = "1/2/file".dup def @path.call(n) pathmap_partial(n) end assert_equal("1", @path.call(1)) assert_equal("1/2", @path.call(2)) ...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_rake_early_time.rb
test/test_rake_early_time.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestRakeEarlyTime < Rake::TestCase # :nodoc: def test_create early = Rake::EarlyTime.instance assert early <= Time.now assert early < Time.now assert early != Time.now assert Time.now > early assert Time.now >...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_rake.rb
test/test_rake.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestRake < Rake::TestCase # :nodoc: def test_each_dir_parent assert_equal ["a"], alldirs("a") assert_equal ["a/b", "a"], alldirs("a/b") assert_equal ["/a/b", "/a", "/"], alldirs("/a/b") if File.dirname("c:/foo") == "c...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_rake_directory_task.rb
test/test_rake_directory_task.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) require "fileutils" require "pathname" class TestRakeDirectoryTask < Rake::TestCase # :nodoc: include Rake def test_directory desc "DESC" directory "a/b/c" assert_equal FileCreationTask, Task["a"].class assert_equal Fi...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_rake_application.rb
test/test_rake_application.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestRakeApplication < Rake::TestCase # :nodoc: def setup super @app = Rake.application @app.options.rakelib = [] end def test_class_with_application orig_app = Rake.application return_app = Rake.with_appli...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_rake_test_task.rb
test/test_rake_test_task.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) require "rake/testtask" class TestRakeTestTask < Rake::TestCase # :nodoc: include Rake def test_initialize tt = Rake::TestTask.new do |t| end refute_nil tt assert_equal :test, tt.name assert_equal ["lib"], tt.libs as...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_rake_file_task.rb
test/test_rake_file_task.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) require "fileutils" require "pathname" class TestRakeFileTask < Rake::TestCase # :nodoc: include Rake def setup super Task.clear @runs = Array.new FileUtils.rm_f NEWFILE FileUtils.rm_f OLDFILE end def test_file...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_rake_task_manager_argument_resolution.rb
test/test_rake_task_manager_argument_resolution.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestRakeTaskManagerArgumentResolution < Rake::TestCase # :nodoc: def test_good_arg_patterns assert_equal [:t, [], [], nil], task(:t) assert_equal [:t, [], [:x], nil], task(t: :x) assert_equal [:t, [], [:x, :y],...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/helper.rb
test/helper.rb
# frozen_string_literal: true lib = File.expand_path("../../lib", __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) begin if ENV["COVERALLS"] gem "coveralls" require "coveralls" Coveralls.wear! end rescue Gem::LoadError end require "test/unit" require "rake" require "tmpdir" require_...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_rake_cpu_counter.rb
test/test_rake_cpu_counter.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestRakeCpuCounter < Rake::TestCase # :nodoc: def setup super @cpu_counter = Rake::CpuCounter.new end def test_count num = @cpu_counter.count omit "cannot count CPU" if num == nil assert_kind_of Numeric, nu...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_rake_task.rb
test/test_rake_task.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) require "fileutils" class TestRakeTask < Rake::TestCase # :nodoc: include Rake def setup super Task.clear Rake::TaskManager.record_task_metadata = true end def teardown Rake::TaskManager.record_task_metadata = fals...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_rake_win32.rb
test/test_rake_win32.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestRakeWin32 < Rake::TestCase # :nodoc: Win32 = Rake::Win32 # :nodoc: def test_win32_system_dir_uses_home_if_defined ENV["HOME"] = 'C:\\HP' assert_equal "C:/HP/Rake", Win32.win32_system_dir end def test_win32_syste...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_private_reader.rb
test/test_private_reader.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) require "rake/private_reader" class TestPrivateAttrs < Rake::TestCase # :nodoc: class Sample # :nodoc: include Rake::PrivateReader private_reader :reader, :a def initialize @reader = :RVALUE end def get_reader...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_rake_linked_list.rb
test/test_rake_linked_list.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestLinkedList < Rake::TestCase # :nodoc: include Rake def test_empty_list empty = LinkedList::EMPTY assert empty.empty?, "should be empty" end def test_list_with_one_item list = LinkedList.make(:one) assert !...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_rake_reduce_compat.rb
test/test_rake_reduce_compat.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestRakeReduceCompat < Rake::TestCase # :nodoc: include RubyRunner def invoke_normal(task_name) rake task_name.to_s @out end def test_no_deprecated_dsl rakefile %q{ task :check_task do Module.new { p...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_rake_path_map.rb
test/test_rake_path_map.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestRakePathMap < Rake::TestCase # :nodoc: def test_returns_self_with_no_args assert_equal "abc.rb", "abc.rb".pathmap end def test_s_returns_file_separator sep = File::ALT_SEPARATOR || File::SEPARATOR assert_equal ...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_rake_file_list_path_map.rb
test/test_rake_file_list_path_map.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestRakeFileListPathMap < Rake::TestCase # :nodoc: def test_file_list_supports_pathmap assert_equal ["a", "b"], FileList["dir/a.rb", "dir/b.rb"].pathmap("%n") end def test_file_list_supports_pathmap_with_a_block mapped =...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_rake_top_level_functions.rb
test/test_rake_top_level_functions.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestRakeTopLevelFunctions < Rake::TestCase # :nodoc: def setup super @app = Object.new def @app.called @called end def @app.method_missing(*a, &b) @called ||= [] @called << [a, b] nil ...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/test_rake_require.rb
test/test_rake_require.rb
# frozen_string_literal: true require File.expand_path("../helper", __FILE__) class TestRakeRequire < Rake::TestCase # :nodoc: def setup super $LOAD_PATH.unshift "." if jruby17? end def test_can_load_rake_library rakefile_rakelib app = Rake::Application.new assert app.instance_eval { ...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/support/rakefile_definitions.rb
test/support/rakefile_definitions.rb
# frozen_string_literal: true module RakefileDefinitions include FileUtils def rakefile_access rakefile <<~ACCESS TOP_LEVEL_CONSTANT = 0 def a_top_level_function end task :default => [:work, :obj, :const] task :work do begin a_top_level_function puts...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/support/ruby_runner.rb
test/support/ruby_runner.rb
# frozen_string_literal: true require "open3" require "fileutils" module RubyRunner include FileUtils # Run a shell Ruby command with command line options (using the # default test options). Output is captured in @out and @err def ruby(*option_list) run_ruby(@ruby_options + option_list) end # Run a ...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/test/support/file_creation.rb
test/support/file_creation.rb
# frozen_string_literal: true module FileCreation OLDFILE = "old" NEWFILE = "new" def create_timed_files(oldfile, *newfiles) return if (File.exist?(oldfile) && newfiles.all? { |newfile| File.exist?(newfile) && File.stat(newfile).mtime > File.stat(oldfile).mtime }) now = Time.now ...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/lib/rake.rb
lib/rake.rb
# frozen_string_literal: true #-- # Copyright 2003-2010 by Jim Weirich (jim.weirich@gmail.com) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitat...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/lib/rake/task.rb
lib/rake/task.rb
# frozen_string_literal: true require_relative "invocation_exception_mixin" module Rake ## # A Task is the basic unit of work in a Rakefile. Tasks have associated # actions (possibly more than one) and a list of prerequisites. When # invoked, a task will first ensure that all of its prerequisites have an ...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false
ruby/rake
https://github.com/ruby/rake/blob/34c6b3e9b807e3574c66f38337b47c2cfd7ace48/lib/rake/win32.rb
lib/rake/win32.rb
# frozen_string_literal: true require "rbconfig" module Rake # Win 32 interface methods for Rake. Windows specific functionality # will be placed here to collect that knowledge in one spot. module Win32 # :nodoc: all # Error indicating a problem in locating the home directory on a # Win32 system. cl...
ruby
MIT
34c6b3e9b807e3574c66f38337b47c2cfd7ace48
2026-01-04T15:55:38.335769Z
false