Class: BB::Cache

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-bb-PodAssistant/config/cache_path.rb

Instance Method Summary collapse

Constructor Details

#initialize(stable_source = nil, verify_stable_env = true) ⇒ Cache

Returns a new instance of Cache.



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/cocoapods-bb-PodAssistant/config/cache_path.rb', line 6

def initialize(stable_source = nil, verify_stable_env=true)
    if stable_source.nil?
        stable_source = StableSource.stable_default_source
    end
    @stable_source = stable_source
    if verify_stable_env && File.exist?(File.join(Pathname.pwd, "Podfile"))
        @bundleId = BB::PodUtils.getProjectBundleIdentifier
    end
    if @bundleId.nil?
        @bundleId = 'stable'
    end
end

Instance Method Details

#cachePathObject



19
20
21
22
# File 'lib/cocoapods-bb-PodAssistant/config/cache_path.rb', line 19

def cachePath()
    # 缓存路径采用bundle包名区分,解决多产品同时打包问题
    File.join(File.expand_path('~/.cache'), 'cocoapods-bb-PodAssistant',@bundleId,@stable_source.split('/').last.chomp('.git').to_s)
end