Class: BB::StableEnv

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

Instance Method Summary collapse

Constructor Details

#initialize(stable_source = nil, stable_branch = nil, stable_tag = nil) ⇒ StableEnv

Returns a new instance of StableEnv.



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

def initialize(stable_source = nil, stable_branch = nil, stable_tag = nil)
    if stable_source.nil?
      stable_source = StableSource.stable_default_source
    end
    @stable_source = stable_source
    @stable_branch = stable_branch
    @stable_tag = stable_tag

    @cache = BB::Cache.new()
    configGitPath(@cache.cachePath)
end

Instance Method Details

#loadDeveloperEnvObject

开发环境,执行pod install/update



24
25
26
27
28
29
30
31
32
33
34
# File 'lib/cocoapods-bb-PodAssistant/helpers/stable_env_helper.rb', line 24

def loadDeveloperEnv
    cachePath = @cache.cachePath
    puts "hook [pod install/update] sync stable git=>#{cachePath}"
    if Dir.exist?(File.join(cachePath))
      `cd #{cachePath}; git switch main; git pull --all`
    else
      clonePath = File.dirname(cachePath)
      FileUtils.mkdir_p clonePath
      `git clone #{@stable_source} #{cachePath}`
    end
end

#loadStaleEnvObject

stable 环境,执行pod stable



19
20
21
# File 'lib/cocoapods-bb-PodAssistant/helpers/stable_env_helper.rb', line 19

def loadStaleEnv
    
end