Class: Spandx::Dotnet::Index
- Inherits:
-
Object
- Object
- Spandx::Dotnet::Index
- Defined in:
- lib/spandx/dotnet/index.rb
Constant Summary collapse
- DEFAULT_DIR =
File.(File.join(Dir.home, '.local', 'share', 'spandx'))
Instance Attribute Summary collapse
-
#cache ⇒ Object
readonly
Returns the value of attribute cache.
-
#directory ⇒ Object
readonly
Returns the value of attribute directory.
-
#gateway ⇒ Object
readonly
Returns the value of attribute gateway.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(directory: DEFAULT_DIR, gateway: Spandx::Dotnet::NugetGateway.new) ⇒ Index
constructor
A new instance of Index.
- #update! ⇒ Object
Constructor Details
#initialize(directory: DEFAULT_DIR, gateway: Spandx::Dotnet::NugetGateway.new) ⇒ Index
Returns a new instance of Index.
9 10 11 12 13 14 |
# File 'lib/spandx/dotnet/index.rb', line 9 def initialize(directory: DEFAULT_DIR, gateway: Spandx::Dotnet::NugetGateway.new) @directory = directory ? File.(directory) : DEFAULT_DIR @name = 'nuget' @gateway = gateway @cache = Spandx::Core::Cache.new(@name, root: directory) end |
Instance Attribute Details
#cache ⇒ Object (readonly)
Returns the value of attribute cache.
7 8 9 |
# File 'lib/spandx/dotnet/index.rb', line 7 def cache @cache end |
#directory ⇒ Object (readonly)
Returns the value of attribute directory.
7 8 9 |
# File 'lib/spandx/dotnet/index.rb', line 7 def directory @directory end |
#gateway ⇒ Object (readonly)
Returns the value of attribute gateway.
7 8 9 |
# File 'lib/spandx/dotnet/index.rb', line 7 def gateway @gateway end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/spandx/dotnet/index.rb', line 7 def name @name end |
Instance Method Details
#update! ⇒ Object
16 17 18 19 20 |
# File 'lib/spandx/dotnet/index.rb', line 16 def update!(*) queue = Queue.new [fetch(queue), save(queue)].each(&:join) cache.rebuild_index end |