Skip to content

Commit

Permalink
Merge pull request #1602 from ksss/diff-manifest-yaml
Browse files Browse the repository at this point in the history
[rbs diff] Load dependencies from manifest.yaml
  • Loading branch information
soutaro authored Nov 9, 2023
2 parents 41e3902 + b4634fa commit cc9e876
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/rbs/diff.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,18 @@ def build_methods(path)
def build_env(path)
loader = @library_options.loader()
path&.each do |dir|
loader.add(path: Pathname(dir))
dir_pathname = Pathname(dir)
loader.add(path: dir_pathname)

manifest_pathname = dir_pathname / 'manifest.yaml'
if manifest_pathname.exist?
manifest = YAML.safe_load(manifest_pathname.read)
if manifest['dependencies']
manifest['dependencies'].each do |dependency|
loader.add(library: dependency['name'], version: nil)
end
end
end
end
Environment.from_loader(loader)
end
Expand Down

0 comments on commit cc9e876

Please sign in to comment.