Sha256: 6147a99796b294bf21176ef0fc2c2cbd33e4b1c29cac2e9c33b2cf258ab0d19b
Contents?: true
Size: 1.21 KB
Versions: 79
Compression:
Stored size: 1.21 KB
Contents
# frozen_string_literal: true module RailsAppGenerator module Diff # Diff Report class Report attr_reader :info attr_reader :show_left_only attr_reader :show_right_only attr_reader :show_same attr_reader :show_different def initialize(compare_info, **opts) @info = compare_info @show_left_only = opts[:show_left_only].nil? ? true : opts[:show_left_only] @show_right_only = opts[:show_right_only].nil? ? true : opts[:show_right_only] @show_same = opts[:show_same].nil? ? false : opts[:show_same] @show_different = opts[:show_different].nil? ? true : opts[:show_different] end def display display_files('Files only in source folder' , info.lhs_only) if show_left_only display_files('Files only in target folder' , info.rhs_only) if show_right_only display_files('Files in both folders' , info.same) if show_same display_files('Files that are different' , info.diff) if show_different end private def display_files(heading, files) return if files.empty? Util.line(heading) puts files.map(&:file) end end end end
Version data entries
79 entries across 79 versions & 1 rubygems