From 4b59ce1751f7f8a5ff05cd3482ac5b4b90aa7bcd Mon Sep 17 00:00:00 2001 From: Ellen Teapot Date: Mon, 7 Jan 2019 11:15:00 -0800 Subject: [PATCH] Add subcommand for diffs --- lib/xcodeproj/command.rb | 3 +-- lib/xcodeproj/command/diff.rb | 10 ++++++++++ .../command/{project_diff.rb => diff/project.rb} | 4 ++-- .../command/{target_diff.rb => diff/target.rb} | 4 ++-- 4 files changed, 15 insertions(+), 6 deletions(-) create mode 100644 lib/xcodeproj/command/diff.rb rename lib/xcodeproj/command/{project_diff.rb => diff/project.rb} (96%) rename lib/xcodeproj/command/{target_diff.rb => diff/target.rb} (95%) diff --git a/lib/xcodeproj/command.rb b/lib/xcodeproj/command.rb index 908750016..ffae84b59 100644 --- a/lib/xcodeproj/command.rb +++ b/lib/xcodeproj/command.rb @@ -4,8 +4,7 @@ module Xcodeproj class Command < CLAide::Command require 'xcodeproj/command/config_dump' - require 'xcodeproj/command/target_diff' - require 'xcodeproj/command/project_diff' + require 'xcodeproj/command/diff' require 'xcodeproj/command/show' require 'xcodeproj/command/sort' diff --git a/lib/xcodeproj/command/diff.rb b/lib/xcodeproj/command/diff.rb new file mode 100644 index 000000000..9ebe9dfeb --- /dev/null +++ b/lib/xcodeproj/command/diff.rb @@ -0,0 +1,10 @@ +module Xcodeproj + class DiffCommand < Command + require 'xcodeproj/command/diff/project' + require 'xcodeproj/command/diff/target' + + self.abstract_command = true + self.command = 'diff' + self.description = 'Shows the differences between Xcode objects.' + end +end diff --git a/lib/xcodeproj/command/project_diff.rb b/lib/xcodeproj/command/diff/project.rb similarity index 96% rename from lib/xcodeproj/command/project_diff.rb rename to lib/xcodeproj/command/diff/project.rb index 2f5d553bf..5d1dab69c 100644 --- a/lib/xcodeproj/command/project_diff.rb +++ b/lib/xcodeproj/command/diff/project.rb @@ -1,6 +1,6 @@ module Xcodeproj - class Command - class ProjectDiff < Command + class DiffCommand + class Project < DiffCommand self.summary = 'Shows the difference between two projects' self.description = summary + <<-EOS.gsub(/ {8}/, '') diff --git a/lib/xcodeproj/command/target_diff.rb b/lib/xcodeproj/command/diff/target.rb similarity index 95% rename from lib/xcodeproj/command/target_diff.rb rename to lib/xcodeproj/command/diff/target.rb index 7390beec6..94539ef67 100644 --- a/lib/xcodeproj/command/target_diff.rb +++ b/lib/xcodeproj/command/diff/target.rb @@ -1,6 +1,6 @@ module Xcodeproj - class Command - class TargetDiff < Command + class DiffCommand + class Target < DiffCommand self.summary = 'Shows the difference between two targets' def self.options