From 86049a98754507a480e657274b4d38b07c46e6ea Mon Sep 17 00:00:00 2001 From: Seong Yong-ju Date: Wed, 4 Mar 2026 18:13:56 +0900 Subject: [PATCH 1/2] [ruby/prism] feat: add `start_line`, `end_line`, `start_column`, `end_column`, and `chop` methods for `Location` https://github.com/ruby/prism/commit/4258b2ad7e Co-Authored-By: Kevin Newton --- prism/util/pm_line_offset_list.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prism/util/pm_line_offset_list.h b/prism/util/pm_line_offset_list.h index fe16e0b03442e1..968eeae52d91fb 100644 --- a/prism/util/pm_line_offset_list.h +++ b/prism/util/pm_line_offset_list.h @@ -96,7 +96,7 @@ int32_t pm_line_offset_list_line(const pm_line_offset_list_t *list, uint32_t cur * @param start_line The line to start counting from. * @return The line and column of the given offset. */ -pm_line_column_t pm_line_offset_list_line_column(const pm_line_offset_list_t *list, uint32_t cursor, int32_t start_line); +PRISM_EXPORTED_FUNCTION pm_line_column_t pm_line_offset_list_line_column(const pm_line_offset_list_t *list, uint32_t cursor, int32_t start_line); /** * Free the internal memory allocated for the list. From 79f7ce740002cfb2a0d70b69a96d346f1c6f2bfe Mon Sep 17 00:00:00 2001 From: Burdette Lamar Date: Fri, 13 Mar 2026 18:54:06 -0500 Subject: [PATCH 2/2] [DOC] Pathname glob doc --- pathname_builtin.rb | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/pathname_builtin.rb b/pathname_builtin.rb index 939c47cb977475..1139e41981a8fc 100644 --- a/pathname_builtin.rb +++ b/pathname_builtin.rb @@ -1132,7 +1132,46 @@ def zero?() FileTest.zero?(@path) end class Pathname # * Dir * - # See Dir.glob. Returns or yields Pathname objects. + # call-seq: + # glob(patterns, **kwargs) → array_of_pathnames + # glob(patterns, **kwargs) {|pathname| ... } → nil + # + # Calls Dir.glob(patterns, **kwargs), which yields or returns entry names; + # see Dir.glob. + # + # Required argument +patterns+ is a string pattern or an array of string patterns; + # note that these patterns are not regexps. + # + # Keyword arguments **kwargs are passed through to Dir.glob; + # see the documentation there. + # + # With no block given, returns an array of \Pathname objects; + # each is Pathname.new(entry_name) for an entry name returned by Dir.glob. + # + # Pathname.glob('*').take(3) + # # => [#, #, #] + # Pathname.glob(['o*', 'a*']).take(3) + # # => [#, #, #] + # + # With a block given, calls the block with each pathname + # Pathname.new(entry_name), + # where each +entry_name+ is a \Pathname object created by the value yielded by Dir.glob. + # + # a = [] + # Pathname.glob(['o*', 'a*']) {|pathname| a << pathname } + # a.take(3) + # # => [#, #, #] + # + # Optional keyword argument +base+ is of particular interest. + # When it is given, its value specifies the base directory for the pathnames; + # each pattern string specifies entries relative to the base directory: + # + # Pathname.glob('*', base: 'lib').take(2) + # # => [#, #] + # Pathname.glob('*', base: 'lib/bundler').take(2) + # # => [#, #] + # + # Note that the base directory is not prepended to the entry names in the result. def Pathname.glob(*args, **kwargs) # :yield: pathname if block_given? Dir.glob(*args, **kwargs) {|f| yield self.new(f) }