Skip to content

Commit

Permalink
Merge pull request #1010 from ksss/validate-auto-dep
Browse files Browse the repository at this point in the history
Use manifest.yaml instead of manually for validate task
  • Loading branch information
soutaro committed Jun 20, 2022
2 parents 2fadc3c + 1b681eb commit 7350567
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 38 deletions.
44 changes: 6 additions & 38 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,48 +54,16 @@ task :test_doc do
end

task :validate => :compile do
require 'yaml'

sh "#{ruby} #{rbs} validate --silent"

FileList["stdlib/*"].each do |path|
lib = [File.basename(path).to_s]

if lib == ["bigdecimal-math"]
lib << "bigdecimal"
end

if lib == ["yaml"]
lib << "dbm"
lib << "pstore"
end

if lib == ["logger"]
lib << "monitor"
end

if lib == ["cgi"]
lib << "tempfile"
end

if lib == ["csv"]
lib << "forwardable"
end

if lib == ["prime"]
lib << "singleton"
end

if lib == ["net-http"]
lib << "uri"
lib << "timeout"
end

if lib == ["resolv"]
lib << "socket"
lib << "timeout"
end

if lib == ["openssl"]
lib << "socket"
if File.exist?("#{path}/0/manifest.yaml")
YAML.load_file("#{path}/0/manifest.yaml")["dependencies"].each do |dep|
lib << dep["name"]
end
end

sh "#{ruby} #{rbs} #{lib.map {|l| "-r #{l}"}.join(" ")} validate --silent"
Expand Down
2 changes: 2 additions & 0 deletions stdlib/cgi/0/manifest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dependencies:
- name: tempfile

0 comments on commit 7350567

Please sign in to comment.