Class: Spandx::Python::Index
- Inherits:
-
Object
- Object
- Spandx::Python::Index
- Includes:
- Enumerable
- Defined in:
- lib/spandx/python/index.rb
Instance Attribute Summary collapse
-
#directory ⇒ Object
readonly
Returns the value of attribute directory.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#pypi ⇒ Object
readonly
Returns the value of attribute pypi.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
-
#initialize(directory:) ⇒ Index
constructor
A new instance of Index.
- #update! ⇒ Object
Constructor Details
#initialize(directory:) ⇒ Index
Returns a new instance of Index.
10 11 12 13 14 15 16 |
# File 'lib/spandx/python/index.rb', line 10 def initialize(directory:) @directory = directory @name = 'pypi' @source = 'https://pypi.org' @pypi = Pypi.new @cache = ::Spandx::Core::Cache.new(@name, root: directory) end |
Instance Attribute Details
#directory ⇒ Object (readonly)
Returns the value of attribute directory.
8 9 10 |
# File 'lib/spandx/python/index.rb', line 8 def directory @directory end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/spandx/python/index.rb', line 8 def name @name end |
#pypi ⇒ Object (readonly)
Returns the value of attribute pypi.
8 9 10 |
# File 'lib/spandx/python/index.rb', line 8 def pypi @pypi end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
8 9 10 |
# File 'lib/spandx/python/index.rb', line 8 def source @source end |
Instance Method Details
#update! ⇒ Object
18 19 20 21 22 |
# File 'lib/spandx/python/index.rb', line 18 def update!(*) queue = Queue.new [fetch(queue), save(queue)].each(&:join) cache.rebuild_index end |