class Xcodeproj::Command::ProjectDiff
def self.options
def self.options [ ['--ignore=KEY', 'A key to ignore in the comparison. Can be specified multiple times.'], ].concat(super) end
def initialize(argv)
def initialize(argv) @path_project1 = argv.shift_argument @path_project2 = argv.shift_argument @keys_to_ignore = argv.all_options('ignore') super end
def run
def run hash_1 = @project1.to_tree_hash.dup hash_2 = @project2.to_tree_hash.dup @keys_to_ignore.each do |key| Differ.clean_hash!(hash_1, key) Differ.clean_hash!(hash_2, key) end diff = Differ.project_diff(hash_1, hash_2, @path_project1, @path_project2) require 'yaml' yaml = diff.to_yaml yaml.gsub!(@path_project1, @path_project1.cyan) yaml.gsub!(@path_project2, @path_project2.magenta) yaml.gsub!(':diff:', 'diff:'.yellow) puts yaml end
def validate!
def validate! super @project1, @project2 = open_project!(@path_project1, @path_project2) end