Project

General

Profile

Bug #13605 » patch-for-2508d68e.patch

wanabe (_ wanabe), 05/30/2017 01:03 AM

View differences:

.travis.yml
- 2.1
- 2.2
- 2.3.1
- 2.4
- ruby-head
- rbx-2
- jruby
Gemfile
source 'https://rubygems.org'
gemspec
gem 'rake', '~> 10.0'
#gem 'rake', '~> 10.0'
# For Guard
group :development do
gem 'gist'
gem 'yard'
gem 'rb-inotify', :require => false
gem 'rb-fsevent', :require => false
end
group :test do
gem 'rspec', '~> 3.4.0'
end
group :development, :test do
gem 'simplecov', '~> 0.8.0'
end
platform :rbx do
gem 'rubysl-singleton'
gem 'rubysl-prettyprint'
gem 'rb-readline'
end
# gem 'simplecov', '~> 0.8.0'
a.rb
require 'bundler/setup'
Bundler.require :default, :test
require 'rspec/core'
require 'coverage'
Coverage.start
#at_exit { Coverage.result }
require 'pry/test/helper'
require_relative 'spec/spec_helpers/mock_pry'
require_relative 'spec/spec_helpers/repl_tester'
load File.dirname(__FILE__) + "/spec/helper.rb"
load File.dirname(__FILE__) + "/spec/fixtures/show_source_doc_examples.rb"
require "pry/input_completer"
load File.dirname(__FILE__) + "/spec/color_printer_spec.rb"
load File.dirname(__FILE__) + "/spec/commands/show_doc_spec.rb"
proc do
proc do
proc do
proc do
load File.dirname(__FILE__) + "/spec/completion_spec.rb"
end.call
end.call
end.call
end.call
RSpec::Core::Runner.invoke
lib/pry/code.rb
undef =~
# Check whether String responds to missing methods.
def respond_to_missing?(name, include_all = false)
def respond_to_missing?(name, include_all=false)
''.respond_to?(name, include_all)
end
lib/pry/config/behavior.rb
end
end
def respond_to_missing?(key, include_private=false)
key?(key) or @default.respond_to?(key) or super(key, include_private)
def respond_to_missing?(key, include_all=false)
key?(key) or @default.respond_to?(key) or super(key, include_all)
end
private
lib/pry/last_exception.rb
end
end
def respond_to_missing?(name, include_private = false)
@e.respond_to?(name)
def respond_to_missing?(name, include_all=false)
@e.respond_to?(name, include_all)
end
#
lib/pry/method.rb
# @param [String, Symbol] method_name
# @return [Boolean]
def respond_to?(method_name)
super or @method.respond_to?(method_name)
def respond_to?(method_name, include_all=false)
super or @method.respond_to?(method_name, include_all)
end
# Delegate any unknown calls to the wrapped method.
lib/pry/output.rb
@boxed_io.__send__(name, *args, &block)
end
def respond_to_missing?(*a)
@boxed_io.respond_to?(*a)
def respond_to_missing?(m, include_all=false)
@boxed_io.respond_to?(m, include_all)
end
def decolorize_maybe(str)
lib/pry/slop.rb
# Override this method so we can check if an option? method exists.
#
# Returns true if this option key exists in our list of options.
def respond_to_missing?(method_name, include_private = false)
def respond_to_missing?(method_name, include_all=false)
options.any? { |o| o.key == method_name.to_s.chop } || super
end
lib/pry/wrapped_module.rb
wrapped.send(method_name, *args, &block)
end
def respond_to?(method_name)
super || wrapped.respond_to?(method_name)
def respond_to?(method_name, include_all=false)
super || wrapped.respond_to?(method_name, include_all)
end
# Retrieve the source location of a module. Return value is in same
spec/color_printer_spec.rb
require 'helper'
describe Pry::ColorPrinter do
include Pry::Helpers::Text
let(:io) { StringIO.new }
......
describe 'Object subclass' do
before do
GC.start
class ObjectF < Object
def inspect
'foo'
......
after do
Object.send :remove_const, :ObjectF
Object.send :remove_const, :ObjectG
GC.start
end
it 'prints a string' do
......
describe 'BasicObject subclass' do
before do
GC.start
class BasicF < BasicObject
def inspect
'foo'
......
after do
Object.__send__ :remove_const, :BasicF
Object.__send__ :remove_const, :BasicG
GC.start
end
it 'prints a string' do
spec/commands/show_doc_spec.rb
require_relative '../helper'
require "fixtures/show_source_doc_examples"
proc do
proc do
Object.module_eval <<'EOS', __FILE__, __LINE__ + 1
proc do
proc do
describe "show-doc" do
before do
......
end
end
end
end.call
end.call
EOS
end.call
end.call
spec/completion_spec.rb
require_relative 'helper'
require "readline" unless defined?(Readline)
require "pry/input_completer"
proc do
proc do
Object.module_eval <<'EOS', __FILE__, __LINE__ + 1
proc do
proc do
def completer_test(bind, pry=nil, assert_flag=true)
test = proc {|symbol|
......
end
end
end
end.call
end.call
EOS
end.call
end.call
spec/helper.rb
require 'bundler/setup'
require 'pry/test/helper'
Bundler.require :default, :test
require_relative 'spec_helpers/mock_pry'
require_relative 'spec_helpers/repl_tester'
if ENV["COVERAGE"]
require "simplecov"
SimpleCov.start
end
class Module
public :remove_const
public :remove_method
......
include Pry::Config::Behavior
end.new(nil)
# to help with tracking down bugs that cause an infinite loop in the test suite
if ENV["SET_TRACE_FUNC"]
require 'set_trace' if Pry::Helpers::BaseHelpers.rbx?
set_trace_func proc { |event, file, line, id, binding, classname|
STDERR.printf "%8s %s:%-2d %10s %8s\n", event, file, line, id, classname
}
end
puts "Ruby v#{RUBY_VERSION} (#{defined?(RUBY_ENGINE) ? RUBY_ENGINE : "ruby"}), Pry v#{Pry::VERSION}, method_source v#{MethodSource::VERSION}, CodeRay v#{CodeRay::VERSION}, Pry::Slop v#{Pry::Slop::VERSION}"
RSpec.configure do |config|
config.expect_with :rspec do |c|
c.syntax = [:should, :expect]
(2-2/3)