Module: ShopifyCLI::Theme::IgnoreHelper

Included in:
DevServer::Hooks::FileChangeHook, Syncer
Defined in:
lib/shopify_cli/theme/ignore_helper.rb

Instance Method Summary collapse

Instance Method Details

#ignore_file?(file) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
14
# File 'lib/shopify_cli/theme/ignore_helper.rb', line 11

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

#ignore_operation?(operation) ⇒ Boolean

Returns:

  • (Boolean)


6
7
8
9
# File 'lib/shopify_cli/theme/ignore_helper.rb', line 6

def ignore_operation?(operation)
  path = operation.file_path
  ignore_path?(path)
end

#ignore_path?(path) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
19
20
21
22
23
24
# File 'lib/shopify_cli/theme/ignore_helper.rb', line 16

def ignore_path?(path)
  is_ignored = ignored_by_ignore_filter?(path) || ignored_by_include_filter?(path)

  if is_ignored && @ctx
    @ctx.debug("ignore #{path}")
  end

  is_ignored
end