class PodPrebuild::CommandExecutor

Public Class Methods

new(options) click to toggle source
# File lib/command/executor/base.rb, line 3
def initialize(options)
  @config = options[:config]
  prepare_cache_dir
end

Public Instance Methods

git(cmd, options = {}) click to toggle source
# File lib/command/executor/base.rb, line 23
def git(cmd, options = {})
  comps = ["git"]
  comps << "-C" << @config.cache_path unless options[:cache_repo] == false
  comps << cmd
  comps << "&> /dev/null" if options[:ignore_output]
  comps << "|| true" if options[:can_fail]
  cmd = comps.join(" ")
  raise "Fail to run command '#{cmd}'" unless system(cmd)
end
git_clone(cmd, options = {}) click to toggle source
# File lib/command/executor/base.rb, line 33
def git_clone(cmd, options = {})
  git("clone #{cmd}", options.merge(:cache_repo => false))
end
installer() click to toggle source
# File lib/command/executor/base.rb, line 8
def installer
  @installer ||= begin
    pod_config = Pod::Config.instance
    Pod::Installer.new(pod_config.sandbox, pod_config.podfile, pod_config.lockfile)
  end
end
prepare_cache_dir() click to toggle source
# File lib/command/executor/base.rb, line 19
def prepare_cache_dir
  FileUtils.mkdir_p(@config.cache_path) if @config.cache_path
end
use_local_cache?() click to toggle source
# File lib/command/executor/base.rb, line 15
def use_local_cache?
  @config.cache_repo.nil?
end