Sha256: c294fa731a20f8d63bf03db939eb51dd57b87eec0fbd0b2cdb4ec4f106ce66bc

Contents?: true

Size: 726 Bytes

Versions: 21

Compression:

Stored size: 726 Bytes

Contents

module LgPodPlugin

  class LFileManager

    def self.cache_director
      Pathname(File.join(Dir.home, "Library/Caches"))
    end

    # 本地下载路径 ~Library/Caches/LgPodPlugin
    def self.download_director
      cache_path = self.cache_director.join("LgPodPlugin")
      # pp "文件路径不存在, 就创建"
      cache_path.mkdir(0700) unless cache_path.exist?
      cache_path
    end

    # pod缓存工作目录, 根据项目所在路径计算所得 确保唯一
    def self.cache_workspace(root)
      timestamp = "_#{Time.now.to_i}_"
      key = root.to_path + timestamp + "#{(rand * 10000000).to_i}"
      director = LUtils.md5(key)
      return self.download_director.join(director)
    end

  end

end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
lg_pod_plugin-1.1.7.4 lib/lg_pod_plugin/utils/file_path.rb
lg_pod_plugin-1.1.7.3 lib/lg_pod_plugin/utils/file_path.rb
lg_pod_plugin-1.1.6.7 lib/lg_pod_plugin/utils/file_path.rb
lg_pod_plugin-1.1.6.6 lib/lg_pod_plugin/utils/file_path.rb
lg_pod_plugin-1.1.6.5 lib/lg_pod_plugin/utils/file_path.rb
lg_pod_plugin-1.1.6.4 lib/lg_pod_plugin/utils/file_path.rb
lg_pod_plugin-1.1.6.3 lib/lg_pod_plugin/utils/file_path.rb
lg_pod_plugin-1.1.6.2 lib/lg_pod_plugin/utils/file_path.rb
lg_pod_plugin-1.1.6.0 lib/lg_pod_plugin/utils/file_path.rb
lg_pod_plugin-1.1.5.9 lib/lg_pod_plugin/utils/file_path.rb
lg_pod_plugin-1.1.5.7 lib/lg_pod_plugin/utils/file_path.rb
lg_pod_plugin-1.1.5.6 lib/lg_pod_plugin/utils/file_path.rb
lg_pod_plugin-1.1.5.5 lib/lg_pod_plugin/utils/file_path.rb
lg_pod_plugin-1.1.5.4 lib/lg_pod_plugin/utils/file_path.rb
lg_pod_plugin-1.1.5.3 lib/lg_pod_plugin/utils/file_path.rb
lg_pod_plugin-1.1.5.2 lib/lg_pod_plugin/utils/file_path.rb
lg_pod_plugin-1.1.5.1 lib/lg_pod_plugin/utils/file_path.rb
lg_pod_plugin-1.1.4.4 lib/lg_pod_plugin/utils/file_path.rb
lg_pod_plugin-1.1.4.3 lib/lg_pod_plugin/utils/file_path.rb
lg_pod_plugin-1.1.4.2 lib/lg_pod_plugin/utils/file_path.rb