Class: LgPodPlugin::LFileManager
- Inherits:
-
Object
- Object
- LgPodPlugin::LFileManager
- Defined in:
- lib/lg_pod_plugin/utils/file_path.rb
Class Method Summary collapse
- .cache_director ⇒ Object
-
.cache_workspace(root) ⇒ Object
pod缓存工作目录, 根据项目所在路径计算所得 确保唯一.
-
.download_director ⇒ Object
本地下载路径 ~Library/Caches/LgPodPlugin.
Class Method Details
.cache_director ⇒ Object
6 7 8 |
# File 'lib/lg_pod_plugin/utils/file_path.rb', line 6 def self.cache_director Pathname(File.join(Dir.home, "Library/Caches")) end |
.cache_workspace(root) ⇒ Object
pod缓存工作目录, 根据项目所在路径计算所得 确保唯一
19 20 21 22 23 24 |
# File 'lib/lg_pod_plugin/utils/file_path.rb', line 19 def self.cache_workspace(root) = "_#{Time.now.to_i}_" key = root.to_path + + "#{(rand * 10000000).to_i}" director = LUtils.md5(key) return self.download_director.join(director) end |
.download_director ⇒ Object
本地下载路径 ~Library/Caches/LgPodPlugin
11 12 13 14 15 16 |
# File 'lib/lg_pod_plugin/utils/file_path.rb', line 11 def self.download_director cache_path = self.cache_director.join("LgPodPlugin") # pp "文件路径不存在, 就创建" cache_path.mkdir(0700) unless cache_path.exist? cache_path end |