Sha256: 991e26a2822e1cc12fd6f2b2ba94a055bacb785dcb833ea16d2c632e8a8f87c2

Contents?: true

Size: 604 Bytes

Versions: 11

Compression:

Stored size: 604 Bytes

Contents

module BooticCli
  module Themes
    class MissingItemsTheme
      def initialize(source:, target:)
        @source, @target = source, target
      end

      def templates
        @templates ||= find_missing_files(source.templates, target.templates)
      end

      def assets
        @assets ||= find_missing_files(source.assets, target.assets)
      end

      private
      attr_reader :source, :target

      def find_missing_files(set1, set2)
        file_names = set2.map(&:file_name)
        set1.select do |f|
          !file_names.include?(f.file_name)
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
bootic_cli-0.4.3 lib/bootic_cli/themes/missing_items_theme.rb
bootic_cli-0.4.2 lib/bootic_cli/themes/missing_items_theme.rb
bootic_cli-0.4.1 lib/bootic_cli/themes/missing_items_theme.rb
bootic_cli-0.4.0 lib/bootic_cli/themes/missing_items_theme.rb
bootic_cli-0.3.0 lib/bootic_cli/themes/missing_items_theme.rb
bootic_cli-0.2.1 lib/bootic_cli/themes/missing_items_theme.rb
bootic_cli-0.2.0 lib/bootic_cli/themes/missing_items_theme.rb
bootic_cli-0.2.0.pre4 lib/bootic_cli/themes/missing_items_theme.rb
bootic_cli-0.2.0.pre3 lib/bootic_cli/themes/missing_items_theme.rb
bootic_cli-0.2.0.pre2 lib/bootic_cli/themes/missing_items_theme.rb
bootic_cli-0.2.0.pre1 lib/bootic_cli/themes/missing_items_theme.rb