我正在使用“调试器”gem 来处理一些 Ruby 代码。通过 My Code 中的第 2 行后,调试器会跳到一帧又一帧的 Ruby 函数和方法中。这里发生了什么事。我已经通过调试器执行了大约 50 次,但它还没有跳回我的代码。
我的代码
[-3, 6] in C:/RUBY/prep-work-master/coding-test-2/practice-problems/spec/00_neare
1 require '00_nearest_larger'
=> 2 require 'rspec'
3
4 # Write a function, `nearest_larger(arr, i)` which takes an array and an
5 # index. The function should return another index, `j`: this should
6 # satisfy:
(rdb:1) n
调试器跳到这里:这是哪里? C:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/rubygems.rb:982 规范 = @path_to_default_spec_map["#{path}#{suffix}"]
[977, 986] in C:/RailsInstaller/Ruby2.0.0/lib/ruby/2.0.0/rubygems.rb
977 ##
978 # Find a Gem::Specification of default gem from +path+
979
980 def find_unresolved_default_spec(path)
981 Gem.suffixes.each do |suffix|
=> 982 spec = @path_to_default_spec_map["#{path}#{suffix}"]
983 return spec if spec
984 end
985 nil
986 end
(rdb:1)