summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKevin Newton <kddnewton@gmail.com>2023-08-02 13:17:31 -0400
committerTakashi Kokubun <takashikkbn@gmail.com>2023-08-16 17:47:32 -0700
commit820a58c228b8dbd29915065f8e5f18a61442bb88 (patch)
tree0fe2c60f23ccfe150f624e0728a515890018c642 /lib
parent1ea9e444ecbd089b8216eff3cd5d05e34912736b (diff)
[ruby/yarp] Hide debug methods
https://github.com/ruby/yarp/commit/aa0dc2f301
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/8226
Diffstat (limited to 'lib')
-rw-r--r--lib/yarp.rb13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/yarp.rb b/lib/yarp.rb
index 39ff7e3269..79a0aaad5b 100644
--- a/lib/yarp.rb
+++ b/lib/yarp.rb
@@ -230,9 +230,18 @@ module YARP
Serialize.load(source, serialized)
end
- def self.newlines(source)
- YARP.parse(source).source.offsets
+ # This module is used for testing and debugging and is not meant to be used by
+ # consumers of this library.
+ module Debug
+ def self.newlines(source)
+ YARP.parse(source).source.offsets
+ end
end
+
+ # Marking this as private so that consumers don't see it. It makes it a little
+ # annoying for testing since you have to const_get it to access the methods,
+ # but at least this way it's clear it's not meant for consumers.
+ private_constant :Debug
end
require_relative "yarp/lex_compat"