Module: BigKeeper::DepType

Defined in:
lib/big_keeper/dependency/dep_type.rb

Constant Summary collapse

NONE =
0
COCOAPODS =
1
GRADLE =
2

Class Method Summary collapse

Class Method Details

.operator(path, user) ⇒ Object



22
23
24
25
26
27
28
29
30
31
# File 'lib/big_keeper/dependency/dep_type.rb', line 22

def self.operator(path, user)
  operator_type = type(path)
  if COCOAPODS == operator_type
    DepPodOperator.new(path, user)
  elsif GRADLE == operator_type
    DepGradleOperator.new(path, user)
  else
    DepOperator.new(path, user)
  end
end

.type(path) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/big_keeper/dependency/dep_type.rb', line 12

def self.type(path)
  if FileOperator.definitely_exists?("#{path}/Podfile")
    COCOAPODS
  elsif FileOperator.definitely_exists?("#{path}/build.gradle")
    GRADLE
  else
    NONE
  end
end