Class: PodPrebuild::CommandExecutor
- Inherits:
-
Object
- Object
- PodPrebuild::CommandExecutor
show all
- Defined in:
- lib/command/executor/base.rb
Instance Method Summary
collapse
Constructor Details
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
7
8
9
10
11
12
13
14
|
# File 'lib/command/executor/base.rb', line 7
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
16
17
18
|
# File 'lib/command/executor/base.rb', line 16
def git_clone(cmd, options = {})
git("clone #{cmd}", options.merge(:cache_repo => false))
end
|