class Maintainer::MaintainerUpdater

Public Class Methods

new_pod(podname: nil) click to toggle source
# File lib/maintainer_core/maintainFileUpdater.rb, line 4
def new_pod(podname: nil)
    puts "Adding #{podname} to Maintainfile"
    file = File.open("./maintain/Maintainfile", "a+")

    Writer.file_replace(file, /^#Pods.*/i) do |match| 
        "#{match}\n#{podname}"
    end

    file.puts "#Pods"
    file.puts("#{podname}")
    file.close
    puts "Successfully added #{podname} to Maintainfile"
end
update_all!() click to toggle source
# File lib/maintainer_core/maintainFileUpdater.rb, line 18
def update_all!()
    file = File.open("./maintain/Maintainfile", "a+")

    # state = ":pods"

    file.each_line do |line|
        if line =~ /^#Pods.*/i then
            CocoapodRunner.pod_update!
        elsif line =~ /^#npm.*/i then
        elsif line =~ /^#spm.*/i then
        elsif line =~ /^#gem.*/i then
        else
        end
        # if state == ":pods" then
        # elsif state == ":npm" then
        # elsif state == ":spm" then
        # elsif state == ":gem" then
        # else
        #     puts "Cant maintain this: #{line}"
        # end
    end
end