class Option

(☝ ՞ਊ ՞)☝——————————————————————===#

This source file is part of the xsort open source project

Copyright (c) 2018 -  Keisuke Yamagishi. project authors
Licensed under MIT LICENCE

See https://github.com/keisukeYamagishi/xsort/blob/master/LICENSE.txt for license information

——————————————————————(☝ ՞ਊ ՞)☝/

Public Class Methods

new(argv) click to toggle source
# File lib/xsort/option.rb, line 14
def initialize(argv)
    @stdout = false
    argvs = Array.new
    @notOverwrite = false

    argv.each_with_index do |arg, i|
        argvs.push(arg)
    end

    @options = Array.new
    @path = ""
    argvs.each{|argv|
        if !argv.index(".xcodeproj")

            if argv == "-o"
                @stdout = true
            elsif argv == "-r"
                @notOverwrite = true
            end
            @options.push(argv)
        else
            @path = createPath(argv)
        end
    }
end

Public Instance Methods

createPath(path) click to toggle source
# File lib/xsort/option.rb, line 40
def createPath(path)
    if path.index(".pbxproj")
        return path
    else
        pbxproj = path.dup
        pbxproj << "/project.pbxproj"
        return pbxproj
    end

end
notOverwrite() click to toggle source
# File lib/xsort/option.rb, line 63
def notOverwrite
    @notOverwrite
end
options() click to toggle source
# File lib/xsort/option.rb, line 51
def options
    @options
end
path() click to toggle source
# File lib/xsort/option.rb, line 55
def path
    @path
end
stdout() click to toggle source
# File lib/xsort/option.rb, line 59
def stdout
    @stdout
end