Merge pull request #1847 from pry/pry-rails-fixes
Backport certain methods for smother transition
This commit is contained in:
commit
165a16eae6
|
@ -87,17 +87,33 @@ class Pry
|
|||
exec_hook(:when_started, target, options, self)
|
||||
end
|
||||
|
||||
@input_array_warn = false
|
||||
# @deprecated Use {#input_ring} instead.
|
||||
def input_array
|
||||
warn "[DEPRECATED] '#{self.class.name}##{__method__}' is deprecated. " \
|
||||
"Use '#{self.class.name}#input_ring' instead."
|
||||
unless @input_array_warn
|
||||
loc = caller_locations(1..1).first
|
||||
warn(
|
||||
"#{loc.path}:#{loc.lineno}: warning: method #{self.class}##{__method__} " \
|
||||
"is deprecated. Use #{self.class}#input_ring instead"
|
||||
)
|
||||
@input_array_warn = true
|
||||
end
|
||||
|
||||
@input_ring
|
||||
end
|
||||
|
||||
@output_array_warn = false
|
||||
# @deprecated Use {#output_ring} instead.
|
||||
def output_array
|
||||
warn "[DEPRECATED] '#{self.class.name}##{__method__}' is deprecated. " \
|
||||
"Use '#{self.class.name}#output_ring' instead"
|
||||
unless @output_array_warn
|
||||
loc = caller_locations(1..1).first
|
||||
warn(
|
||||
"#{loc.path}:#{loc.lineno}: warning: method #{self.class}##{__method__} " \
|
||||
"is deprecated. Use #{self.class}#output_ring instead"
|
||||
)
|
||||
@output_array_warn = true
|
||||
end
|
||||
|
||||
@output_ring
|
||||
end
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@ class Pry
|
|||
# @return [Integer] how many objects were added during the lifetime of the
|
||||
# ring
|
||||
attr_reader :count
|
||||
alias size count
|
||||
|
||||
# @param [Integer] max_size Maximum buffer size. The buffer will start
|
||||
# overwriting elements once its reaches its maximum capacity
|
||||
|
|
Loading…
Reference in New Issue