CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/test/hooks/string_idx.rb
Views: 1904
1
class String
2
@@idx_reported = {}
3
def [](*args)
4
if args.length == 1 && args[0].class == ::Integer && !@@idx_reported[caller[0].to_s]
5
$stderr.puts "HOOK: String[idx] #{caller.join("\t")}\n\n"
6
@@idx_reported[caller[0].to_s] = true
7
end
8
slice(*args)
9
end
10
end
11
12