Class: CocoapodsPodinstallocaldepencencies::Podinstallocaldepencencies

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-podInstalLocalDepencencies/podInstalLocalDepencencies-preconfigDependencies.rb

Instance Method Summary collapse

Instance Method Details

#configPreUpdate(local_dependencies) ⇒ Object



23
24
25
26
27
28
29
30
31
# File 'lib/cocoapods-podInstalLocalDepencencies/podInstalLocalDepencencies-preconfigDependencies.rb', line 23

def configPreUpdate(local_dependencies)
    local_dependencies.each do |module_name, path|
        Pod::UI.puts "Updating #{module_name} dependencies...".green
        upgrade = system("pod update --no-repo-update --project-directory=#{path}")
        if !upgrade
            abort("Error on #{module_name} instalation".red)
        end
    end
end

#install_local_dependencies(local_dependencies) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/cocoapods-podInstalLocalDepencencies/podInstalLocalDepencencies-preconfigDependencies.rb', line 13

def install_local_dependencies(local_dependencies)
    local_dependencies.each do |module_name, path|
        Pod::UI.puts "Installing #{module_name} dependencies...".green
        instalation = system("pod install --project-directory=#{path}")
        if !instalation
            abort("Error on #{module_name} instalation".red)
        end
    end
end

#save_pods_on_local_json(podsname) ⇒ Object



6
7
8
9
10
11
# File 'lib/cocoapods-podInstalLocalDepencencies/podInstalLocalDepencencies-preconfigDependencies.rb', line 6

def save_pods_on_local_json(podsname)
    File.open("./Podfile_CommonPods.json","w") do |f|
        f.write(podsname.to_json)
    end
    Pod::UI.puts 'Saved Podfile_CommonPods.json'.green
end