Skip to content

Commit c0d9155

Browse files
committed
Ruby: Improve Ruby Prism vendor lookup
1 parent 12c6be0 commit c0d9155

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎lib/herb/bootstrap.rb‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,17 @@ def self.find_prism_as_bundler_sibling
7070
bundler_gems_dir = File.expand_path("..", ROOT_PATH)
7171
candidates = Dir.glob(File.join(bundler_gems_dir, "prism-*"))
7272

73-
candidates.find { |path| File.directory?(File.join(path, "src")) }
73+
candidates.find { |path| prism_source?(path) }
74+
end
75+
76+
def self.prism_source?(path)
77+
File.directory?(File.join(path, "src")) && File.exist?(File.join(path, "config.yml"))
7478
end
7579

7680
def self.find_prism_from_gem_spec
7781
Gem::Specification.find_all_by_name("prism")
7882
.map(&:full_gem_path)
79-
.find { |path| File.directory?(File.join(path, "src")) }
83+
.find { |path| prism_source?(path) }
8084
end
8185
end
8286
end

0 commit comments

Comments
 (0)