diff --git a/classes/cve_info.rb b/classes/cve_info.rb index ae3bb52..b49c441 100644 --- a/classes/cve_info.rb +++ b/classes/cve_info.rb @@ -1,2 +1,4 @@ class CveInfo -end + def initialize + end +end \ No newline at end of file diff --git a/classes/nvd_downloader.rb b/classes/nvd_downloader.rb new file mode 100644 index 0000000..b0c2151 --- /dev/null +++ b/classes/nvd_downloader.rb @@ -0,0 +1,30 @@ +require 'rest-client' + +class NvdDownloader + attr_accessor :base_url, :years + + MIN_YEAR = '2002' + MAX_YEAR = '2019' + AVAILABLE_YEARS = (MIN_YEAR..MAX_YEAR).to_a + + def initialize + @base_url = "https://nvd.nist.gov/feeds/json/cve/1.0/" + @years = self.years + end + + def years + year = NvdDownloader::AVAILABLE_YEARS.map do |year| + [year.to_i, year] + end.to_h + end + + def year(year) + years[year] + end + + + def get(url) + + end + +end \ No newline at end of file