Class: YAVDB::API
- Inherits:
-
Object
- Object
- YAVDB::API
- Defined in:
- lib/yavdb.rb
Class Method Summary collapse
-
.download_database(force_update = false, yavdb_path = YAVDB::Constants::DEFAULT_YAVDB_PATH, yavdb_url = YAVDB::Constants::YAVDB_DB_URL, yavdb_branch = YAVDB::Constants::YAVDB_DB_BRANCH) ⇒ Object
Download a previously generated database from the official yavdb repository into yavdb_path.
-
.generate_database(database_path = YAVDB::Constants::DEFAULT_GENERATE_DATABASE_PATH) ⇒ Object
Crawl several sources and generate a local database in database_path.
-
.list_vulnerabilities(package_manager, package_name, database_path = YAVDB::Constants::DEFAULT_YAVDB_PATH) ⇒ Array<Advisory>
List vulnerabilities from database_path of package_name for package_manager.
Class Method Details
.download_database(force_update = false, yavdb_path = YAVDB::Constants::DEFAULT_YAVDB_PATH, yavdb_url = YAVDB::Constants::YAVDB_DB_URL, yavdb_branch = YAVDB::Constants::YAVDB_DB_BRANCH) ⇒ Object
Download a previously generated database from the official yavdb repository into yavdb_path.
60 61 62 63 64 65 |
# File 'lib/yavdb.rb', line 60 def self.download_database(force_update = false, yavdb_path = YAVDB::Constants::DEFAULT_YAVDB_PATH, yavdb_url = YAVDB::Constants::YAVDB_DB_URL, yavdb_branch = YAVDB::Constants::YAVDB_DB_BRANCH) YAVDB::Utils::Git.download_or_update(yavdb_path, yavdb_url, yavdb_branch, force_update) end |
.generate_database(database_path = YAVDB::Constants::DEFAULT_GENERATE_DATABASE_PATH) ⇒ Object
Crawl several sources and generate a local database in database_path.
49 50 51 52 |
# File 'lib/yavdb.rb', line 49 def self.generate_database(database_path = YAVDB::Constants::DEFAULT_GENERATE_DATABASE_PATH) vulnerabilities = YAVDB::Crawler.vulnerabilities YAVDB::Database.save(database_path, vulnerabilities) end |
.list_vulnerabilities(package_manager, package_name, database_path = YAVDB::Constants::DEFAULT_YAVDB_PATH) ⇒ Array<Advisory>
List vulnerabilities from database_path of package_name for package_manager.
40 41 42 43 44 |
# File 'lib/yavdb.rb', line 40 def self.list_vulnerabilities(package_manager, package_name, database_path = YAVDB::Constants::DEFAULT_YAVDB_PATH) YAVDB::Database.search(database_path, package_manager, package_name) end |