2017-01-06 03:11:45 +00:00
|
|
|
class Binding
|
2018-10-26 17:08:30 +00:00
|
|
|
# :nodoc:
|
2025-03-18 02:19:43 +09:00
|
|
|
def irb(...)
|
2024-11-13 16:56:11 +09:00
|
|
|
begin
|
|
|
|
require 'irb'
|
|
|
|
rescue LoadError, Gem::LoadError
|
|
|
|
Gem::BUNDLED_GEMS.force_activate 'irb'
|
2025-04-10 17:50:32 +09:00
|
|
|
require 'irb'
|
2024-11-13 16:56:11 +09:00
|
|
|
end
|
2025-03-18 02:19:43 +09:00
|
|
|
irb(...)
|
2017-01-06 03:11:45 +00:00
|
|
|
end
|
2017-12-01 03:54:49 +00:00
|
|
|
|
|
|
|
# suppress redefinition warning
|
|
|
|
alias irb irb # :nodoc:
|
2017-01-06 03:11:45 +00:00
|
|
|
end
|
2017-11-30 01:31:00 +00:00
|
|
|
|
|
|
|
module Kernel
|
|
|
|
def pp(*objs)
|
|
|
|
require 'pp'
|
2017-11-30 02:12:42 +00:00
|
|
|
pp(*objs)
|
2017-11-30 01:31:00 +00:00
|
|
|
end
|
2017-12-01 03:54:49 +00:00
|
|
|
|
|
|
|
# suppress redefinition warning
|
|
|
|
alias pp pp # :nodoc:
|
2018-10-11 01:03:05 +00:00
|
|
|
|
|
|
|
private :pp
|
2017-11-30 01:31:00 +00:00
|
|
|
end
|
2022-02-17 18:02:42 +09:00
|
|
|
|
|
|
|
module Enumerable
|
|
|
|
# Makes a set from the enumerable object with given arguments.
|
2025-05-30 18:25:58 -07:00
|
|
|
# Passing arguments to this method is deprecated.
|
|
|
|
def to_set(*args, &block)
|
|
|
|
klass = if args.empty?
|
|
|
|
Set
|
|
|
|
else
|
|
|
|
warn "passing arguments to Enumerable#to_set is deprecated", uplevel: 1
|
|
|
|
args.shift
|
|
|
|
end
|
2022-02-17 18:02:42 +09:00
|
|
|
klass.new(self, *args, &block)
|
2025-02-13 15:59:16 +09:00
|
|
|
end
|
2022-02-17 18:02:42 +09:00
|
|
|
end
|