Class: Solargraph::Collection::Gem
- Includes:
- Logging
- Defined in:
- lib/solargraph/collection/gem.rb
Overview
Cacheable gem pins.
Constant Summary collapse
- @@path_source_cache =
{}
Constants included from Logging
Logging::DEFAULT_LOG_LEVEL, Logging::LOG_LEVELS
Instance Attribute Summary collapse
-
#metagem ⇒ Object
readonly
Returns the value of attribute metagem.
Class Method Summary collapse
Instance Method Summary collapse
- #cache_file ⇒ Object
-
#initialize(metagem) ⇒ Gem
constructor
A new instance of Gem.
- #load ⇒ Object
- #pins ⇒ Object
Methods included from Logging
Methods inherited from Base
Constructor Details
#initialize(metagem) ⇒ Gem
Returns a new instance of Gem.
15 16 17 18 |
# File 'lib/solargraph/collection/gem.rb', line 15 def initialize super() @metagem = end |
Instance Attribute Details
#metagem ⇒ Object (readonly)
Returns the value of attribute metagem.
10 11 12 |
# File 'lib/solargraph/collection/gem.rb', line 10 def @metagem end |
Class Method Details
.cached?(metagem) ⇒ Boolean
33 34 35 |
# File 'lib/solargraph/collection/gem.rb', line 33 def self.cached? .cacheable? && File.exist?(new().cache_file) end |
Instance Method Details
#cache_file ⇒ Object
20 21 22 |
# File 'lib/solargraph/collection/gem.rb', line 20 def cache_file File.join CacheDir.gem_dir, "#{.cache_name}.ser" end |
#load ⇒ Object
24 25 26 27 |
# File 'lib/solargraph/collection/gem.rb', line 24 def load return super if .cacheable? @@path_source_cache[.full_path] ||= pins end |
#pins ⇒ Object
29 30 31 |
# File 'lib/solargraph/collection/gem.rb', line 29 def pins @pins ||= without_yard end |