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