Class: PodPrebuild::CommandExecutor

Inherits:
Object
  • Object
show all
Defined in:
lib/command/executor/base.rb

Direct Known Subclasses

CacheFetcher, CachePrebuilder, CachePusher, Visualizer

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ CommandExecutor

Returns a new instance of CommandExecutor.



3
4
5
# File 'lib/command/executor/base.rb', line 3

def initialize(options)
  @config = options[:config]
end

Instance Method Details

#git(cmd, options = {}) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/command/executor/base.rb', line 14

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]
  `#{comps.join(" ")}`
end

#git_clone(cmd, options = {}) ⇒ Object



23
24
25
# File 'lib/command/executor/base.rb', line 23

def git_clone(cmd, options = {})
  git("clone #{cmd}", options.merge(:cache_repo => false))
end

#installerObject



7
8
9
10
11
12
# File 'lib/command/executor/base.rb', line 7

def installer
  @installer ||= begin
    pod_config = Pod::Config.instance
    Pod::Installer.new(pod_config.sandbox, pod_config.podfile, pod_config.lockfile)
  end
end