class Gitcloudcli::CloudSpace

空间操作

Public Instance Methods

add(name, url, token) click to toggle source
# File lib/gitcloudcli/command/space.rb, line 16
def add(name, url, token)
    configs = Gitcloudcli.configHash
    if configs[name]
        puts "#{name} existed"
        return
    end
    configs[name] = {
        "remote"=>url,
        "token"=>token
    }
    Gitcloudcli.configCover(configs)
end
list() click to toggle source
# File lib/gitcloudcli/command/space.rb, line 8
def list
    configs = Gitcloudcli.configHash
    configs.each do |key|
        puts "#{key[0]}  #{key[1]["remote"]}"
    end
end
remove(name) click to toggle source
# File lib/gitcloudcli/command/space.rb, line 30
def remove(name)
    configs = Gitcloudcli.configHash
    if !configs[name]
        puts "#{name} does not exist"
        return
    end
    configs.delete(name)
    Gitcloudcli.configCover(configs)
end