class YJCocoa::Unused

Usage

Attributes

ignore[RW]
match[RW]
matcho[RW]

property

output[RW]

Public Class Methods

new(argv) click to toggle source

初始化

Calls superclass method
# File lib/yjcocoa/unused/unused.rb, line 29
def initialize(argv)
    super
    self.matcho = argv.option('match-o')
    self.match = argv.option('match')
    self.match = self.match.split(",").reject {|i| i.empty? } if self.match
    self.ignore = argv.option('ignore')
    self.ignore = self.ignore.split(",").reject {|i| i.empty? } if self.ignore
    self.output = argv.option('output')
    self.output = Dir.pwd + "/YJCocoa.h" unless self.output
end

Public Instance Methods

check_ignore(item) click to toggle source
# File lib/yjcocoa/unused/unused.rb, line 48
def check_ignore(item)
    return false unless self.ignore
    self.ignore.each { |i|
        return true if item.include?(i)
    }
    return false
end
check_match(item) click to toggle source
# File lib/yjcocoa/unused/unused.rb, line 40
def check_match(item)
    return true unless self.match
    self.match.each { |m|
        return true if item.include?(m)
    }
    return false
end