Class: AWSCDK::IgnoreStrategy

Inherits:
Jsii::Object
  • Object
show all
Defined in:
ignore_strategy.rb

Overview

Represents file path ignoring behavior.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeIgnoreStrategy

Returns a new instance of IgnoreStrategy.



8
9
10
# File 'ignore_strategy.rb', line 8

def initialize
  Jsii::Object.instance_method(:initialize).bind(self).call
end

Class Method Details

.docker(absolute_root_path, patterns) ⇒ AWSCDK::DockerIgnoreStrategy

Ignores file paths based on the .dockerignore specification.

Parameters:

  • absolute_root_path (String)

    the absolute path to the root directory of the paths to be considered.

  • patterns (Array<String>)

Returns:



25
26
27
28
29
# File 'ignore_strategy.rb', line 25

def self.docker(absolute_root_path, patterns)
  Jsii::Type.check_type(absolute_root_path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "absoluteRootPath")
  Jsii::Type.check_type(patterns, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "patterns")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.IgnoreStrategy", "docker", [absolute_root_path, patterns])
end

.from_copy_options(options, absolute_root_path) ⇒ AWSCDK::IgnoreStrategy

Creates an IgnoreStrategy based on the ignoreMode and exclude in a CopyOptions.

Parameters:

  • options (AWSCDK::CopyOptions)

    the CopyOptions to create the IgnoreStrategy from.

  • absolute_root_path (String)

    the absolute path to the root directory of the paths to be considered.

Returns:

  • (AWSCDK::IgnoreStrategy)

    IgnoreStrategy based on the CopyOptions



36
37
38
39
40
41
# File 'ignore_strategy.rb', line 36

def self.from_copy_options(options, absolute_root_path)
  options = options.is_a?(Hash) ? ::AWSCDK::CopyOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5Db3B5T3B0aW9ucyJ9")), "options")
  Jsii::Type.check_type(absolute_root_path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "absoluteRootPath")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.IgnoreStrategy", "fromCopyOptions", [options, absolute_root_path])
end

.git(absolute_root_path, patterns) ⇒ AWSCDK::GitIgnoreStrategy

Ignores file paths based on the .gitignore specification.

Parameters:

  • absolute_root_path (String)

    the absolute path to the root directory of the paths to be considered.

  • patterns (Array<String>)

Returns:



48
49
50
51
52
# File 'ignore_strategy.rb', line 48

def self.git(absolute_root_path, patterns)
  Jsii::Type.check_type(absolute_root_path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "absoluteRootPath")
  Jsii::Type.check_type(patterns, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "patterns")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.IgnoreStrategy", "git", [absolute_root_path, patterns])
end

.glob(absolute_root_path, patterns) ⇒ AWSCDK::GlobIgnoreStrategy

Ignores file paths based on simple glob patterns.

Parameters:

  • absolute_root_path (String)

    the absolute path to the root directory of the paths to be considered.

  • patterns (Array<String>)

Returns:



59
60
61
62
63
# File 'ignore_strategy.rb', line 59

def self.glob(absolute_root_path, patterns)
  Jsii::Type.check_type(absolute_root_path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "absoluteRootPath")
  Jsii::Type.check_type(patterns, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "patterns")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.IgnoreStrategy", "glob", [absolute_root_path, patterns])
end

.jsii_overridable_methodsObject



12
13
14
15
16
17
18
# File 'ignore_strategy.rb', line 12

def self.jsii_overridable_methods
  {
    :add => { kind: :method, name: "add", is_optional: false },
    :completely_ignores => { kind: :method, name: "completelyIgnores", is_optional: false },
    :ignores => { kind: :method, name: "ignores", is_optional: false },
  }
end

Instance Method Details

#add(pattern) ⇒ void

This method returns an undefined value.

Adds another pattern.

Parameters:

  • pattern (String)


69
70
71
72
# File 'ignore_strategy.rb', line 69

def add(pattern)
  Jsii::Type.check_type(pattern, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "pattern")
  jsii_call_method("add", [pattern])
end

#completely_ignores(absolute_directory_path) ⇒ Boolean

Determines whether a given directory path should be ignored and have all of its children ignored.

Parameters:

  • absolute_directory_path (String)

    absolute directory path to be assessed against the pattern.

Returns:

  • (Boolean)

    true if the directory and all of its children should be ignored



78
79
80
81
# File 'ignore_strategy.rb', line 78

def completely_ignores(absolute_directory_path)
  Jsii::Type.check_type(absolute_directory_path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "absoluteDirectoryPath")
  jsii_call_method("completelyIgnores", [absolute_directory_path])
end

#ignores(absolute_file_path) ⇒ Boolean

Determines whether a given file path should be ignored or not.

Parameters:

  • absolute_file_path (String)

    absolute file path to be assessed against the pattern.

Returns:

  • (Boolean)

    true if the file should be ignored



87
88
89
90
# File 'ignore_strategy.rb', line 87

def ignores(absolute_file_path)
  Jsii::Type.check_type(absolute_file_path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "absoluteFilePath")
  jsii_call_method("ignores", [absolute_file_path])
end