Sha256: 5f4ef51f2e8061f76933ae87a6448a48be2459bdbf5df783631518d36f6c5a11

Contents?: true

Size: 650 Bytes

Versions: 5

Compression:

Stored size: 650 Bytes

Contents

# frozen_string_literal: true

module ShopifyCLI
  module Theme
    module IgnoreHelper
      def ignore_operation?(operation)
        path = operation.file_path
        ignore_path?(path)
      end

      def ignore_file?(file)
        path = file.relative_path
        ignore_path?(path)
      end

      def ignore_path?(path)
        ignored_by_ignore_filter?(path) || ignored_by_include_filter?(path)
      end

      private

      def ignored_by_ignore_filter?(path)
        ignore_filter&.ignore?(path)
      end

      def ignored_by_include_filter?(path)
        !!include_filter && !include_filter.match?(path)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
shopify-cli-2.29.0 lib/shopify_cli/theme/ignore_helper.rb
shopify-cli-2.28.0 lib/shopify_cli/theme/ignore_helper.rb
shopify-cli-2.27.0 lib/shopify_cli/theme/ignore_helper.rb
shopify-cli-2.26.0 lib/shopify_cli/theme/ignore_helper.rb
shopify-cli-2.25.0 lib/shopify_cli/theme/ignore_helper.rb