Class: DYAutomate::Command::WorkSpace::Install

Inherits:
DYAutomate::Command::WorkSpace show all
Defined in:
lib/DYAutomate/Command/Workspace/install.rb

Instance Attribute Summary

Attributes inherited from DYAutomate::Command::WorkSpace

#isSilent, #name, #path, #project_path, #workSpace_path

Attributes inherited from DYAutomate::Command

#config, #env_str, #repo_name

Instance Method Summary collapse

Methods inherited from DYAutomate::Command::WorkSpace

#dy_update_repo, #existProject?, #existWorkSpace?, options

Methods inherited from DYAutomate::Command

#pp

Constructor Details

#initialize(argv) ⇒ Install

Returns a new instance of Install.



22
23
24
25
# File 'lib/DYAutomate/Command/Workspace/install.rb', line 22

def initialize(argv)
  # @name = argv.shift_argument
  super
end

Instance Method Details

#do_installObject



45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/DYAutomate/Command/Workspace/install.rb', line 45

def do_install
  isOk = system "#{@env_str} pod install"
  if isOk
    pp("pod install 成功",1)
  else
    pp("pod install 失败",1)
  end
  
  unless isSilent
    system "sleep 3"
    system "open *.xcworkspace"
  end

end

#runObject



38
39
40
41
42
43
# File 'lib/DYAutomate/Command/Workspace/install.rb', line 38

def run
  pp('pod WorkSpace update run  ...',1)
  Dir.chdir(@path)
  dy_update_repo
  do_install
end

#validate!Object



27
28
29
30
31
32
33
34
35
36
# File 'lib/DYAutomate/Command/Workspace/install.rb', line 27

def validate!
  super
  # unless @name
  #   help! 'need the lib `NAME`.'
  # end

  # unless existAtPools?
  #   help! "the podspec file is not exist at #{Dir.pwd}."
  # end
end