Class: RailsAppGenerator::Cli::Diff

Inherits:
Thor
  • Object
show all
Defined in:
lib/rails_app_generator/cli/diff.rb

Overview

Folder Diff

Instance Method Summary collapse

Instance Method Details

#diff(lhs_folder, rhs_folder) ⇒ Object

rubocop:disable Metrics/AbcSize



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/rails_app_generator/cli/diff.rb', line 22

def diff(lhs_folder, rhs_folder)
  # puts "Diffing #{lhs_folder} and #{rhs_folder}"
  # puts JSON.pretty_generate(options)
  processor = RailsAppGenerator::Diff::Processor.new(lhs_folder, rhs_folder)
  compare_info = processor.compare

  report = RailsAppGenerator::Diff::Report.new(
    compare_info,
    show_left_only: options[:show_left_only],
    show_right_only: options[:show_right_only],
    show_same: options[:show_same],
    show_different: options[:show_different]
  )
  report.display

  vscode = RailsAppGenerator::Diff::OpenInEditor.new(
    compare_info,
    open_left_only: options[:open_left_only],
    open_right_only: options[:open_right_only],
    open_same: options[:open_same],
    open_different: options[:show_different]
  )
  vscode.open
end