Module: Solargraph::CacheDir
- Defined in:
- lib/solargraph/cache_dir.rb
Class Method Summary collapse
-
.base_dir ⇒ String
The base directory for cached YARD documentation and serialized pins.
- .clear ⇒ Object
-
.gem_dir ⇒ String
The current gem directory.
-
.rbs_dir ⇒ String
The current RBS collection directory.
-
.stdlib_dir ⇒ String
The current stdlib directory.
-
.work_dir ⇒ String
The working directory for the current Ruby, RBS, and Solargraph versions.
-
.yard_dir ⇒ String
The directory for the current YARD version.
Class Method Details
.base_dir ⇒ String
The base directory for cached YARD documentation and serialized pins.
13 14 15 16 17 |
# File 'lib/solargraph/cache_dir.rb', line 13 def base_dir ENV['SOLARGRAPH_CACHE'] || (ENV['XDG_CACHE_HOME'] ? File.join(ENV['XDG_CACHE_HOME'], 'solargraph') : nil) || File.join(Dir.home, '.cache', 'solargraph') end |
.clear ⇒ Object
54 55 56 |
# File 'lib/solargraph/cache_dir.rb', line 54 def clear FileUtils.rm_rf base_dir end |
.gem_dir ⇒ String
The current gem directory.
29 30 31 |
# File 'lib/solargraph/cache_dir.rb', line 29 def gem_dir File.join(work_dir, 'gems') end |
.rbs_dir ⇒ String
The current RBS collection directory.
43 44 45 |
# File 'lib/solargraph/cache_dir.rb', line 43 def rbs_dir File.join(work_dir, 'rbs') end |
.stdlib_dir ⇒ String
The current stdlib directory.
36 37 38 |
# File 'lib/solargraph/cache_dir.rb', line 36 def stdlib_dir File.join(work_dir, 'stdlib') end |
.work_dir ⇒ String
The working directory for the current Ruby, RBS, and Solargraph versions.
22 23 24 |
# File 'lib/solargraph/cache_dir.rb', line 22 def work_dir File.join(base_dir, "ruby-#{RUBY_VERSION}", "rbs-#{RBS::VERSION}", "solargraph-#{Solargraph::VERSION}") end |
.yard_dir ⇒ String
The directory for the current YARD version.
50 51 52 |
# File 'lib/solargraph/cache_dir.rb', line 50 def yard_dir File.join(base_dir, "yard-#{YARD::VERSION}", "yard-activesupport-concern-#{YARD::ActiveSupport::Concern::VERSION}") end |