Sha256: 448ddbff2f48b18cf79d73a297213ca68b588ad26fc73180cb03892d53bdd4f9

Contents?: true

Size: 706 Bytes

Versions: 15

Compression:

Stored size: 706 Bytes

Contents

# frozen_string_literal: true

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

        def ignore_file?(file)
          path = file.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
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
shopify-cli-2.22.0 lib/shopify_cli/theme/syncer/ignore_helper.rb
shopify-cli-2.21.0 lib/shopify_cli/theme/syncer/ignore_helper.rb
shopify-cli-2.20.1 lib/shopify_cli/theme/syncer/ignore_helper.rb
shopify-cli-2.20.0 lib/shopify_cli/theme/syncer/ignore_helper.rb
shopify-cli-2.19.0 lib/shopify_cli/theme/syncer/ignore_helper.rb
shopify-cli-2.18.1 lib/shopify_cli/theme/syncer/ignore_helper.rb
shopify-cli-2.18.0 lib/shopify_cli/theme/syncer/ignore_helper.rb
shopify-cli-2.17.0 lib/shopify_cli/theme/syncer/ignore_helper.rb
shopify-cli-2.16.1 lib/shopify_cli/theme/syncer/ignore_helper.rb
shopify-cli-2.16.0 lib/shopify_cli/theme/syncer/ignore_helper.rb
shopify-cli-2.15.6 lib/shopify_cli/theme/syncer/ignore_helper.rb
shopify-cli-2.15.5 lib/shopify_cli/theme/syncer/ignore_helper.rb
shopify-cli-2.15.4 lib/shopify_cli/theme/syncer/ignore_helper.rb
shopify-cli-2.15.3 lib/shopify_cli/theme/syncer/ignore_helper.rb
shopify-cli-2.15.2 lib/shopify_cli/theme/syncer/ignore_helper.rb