Skip to content

Commit

Permalink
Make FileFinder.each_file a module function
Browse files Browse the repository at this point in the history
  • Loading branch information
pocke committed Apr 17, 2023
1 parent 9d9dcf2 commit b80de2e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/rbs/environment_loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ def initialize(lib:)
end
end

include FileFinder

Library = _ = Struct.new(:name, :version, keyword_init: true)

attr_reader :core_root
Expand Down
2 changes: 2 additions & 0 deletions lib/rbs/file_finder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

module RBS
module FileFinder
module_function

def self.each_file(path, immediate:, skip_hidden:, &block)
case
when path.file?
Expand Down
2 changes: 1 addition & 1 deletion sig/file_finder.rbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module RBS
module FileFinder
def self.each_file: (Pathname path, immediate: boolish, skip_hidden: boolish) { (Pathname) -> void } -> void
def self?.each_file: (Pathname path, immediate: boolish, skip_hidden: boolish) { (Pathname) -> void } -> void
end
end

0 comments on commit b80de2e

Please sign in to comment.