Class: Spandx::Rubygems::Index
- Inherits:
-
Object
- Object
- Spandx::Rubygems::Index
- Defined in:
- lib/spandx/rubygems/index.rb
Constant Summary collapse
- COMMON_LICENSES =
['MIT', 'Apache-2.0', 'GPL-3.0', 'LGPL-3.0', 'BSD', 'BSD-3-Clause', 'WFTPL'].freeze
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize ⇒ Index
constructor
A new instance of Index.
- #licenses_for(name:, version:) ⇒ Object
- #to_h ⇒ Object
- #update! ⇒ Object
Constructor Details
Instance Method Details
#each ⇒ Object
17 18 19 |
# File 'lib/spandx/rubygems/index.rb', line 17 def each to_h.each { |key, value| yield key, value } end |
#licenses_for(name:, version:) ⇒ Object
13 14 15 |
# File 'lib/spandx/rubygems/index.rb', line 13 def licenses_for(name:, version:) to_h.fetch(index_key_for(name, version), []) end |
#to_h ⇒ Object
21 22 23 |
# File 'lib/spandx/rubygems/index.rb', line 21 def to_h @rubygems_file.data end |
#update! ⇒ Object
25 26 27 28 29 |
# File 'lib/spandx/rubygems/index.rb', line 25 def update! sort_index! build_optimized_index! end |