Method: Pindo::CommonConfuseProj#confuse_version_type

Defined in:
lib/pindo/module/build/commonconfuseproj.rb

#confuse_version_type(path: nil, default_type: "symash1") ⇒ Object



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/pindo/module/build/commonconfuseproj.rb', line 38

def confuse_version_type(path:nil, default_type:"symash1")
    symash_type = default_type
    if File.exist?(File.join(path, "Symash.json"))
        symash_json = JSON.parse(File.read(File.join(path, "Symash.json")))
        if !symash_json.nil? && (symash_json.kind_of? Hash) && symash_json.has_key?('VERSION')
            if symash_json['VERSION'] == 2
                symash_type = "symash2"
            else
                symash_type = "symash1"
            end
        else
            symash_type = default_type
        end
    else
        symash_type = default_type
    end
    return symash_type
end