Class: Toys::Templates::Clean

Inherits:
Object
  • Object
show all
Includes:
Toys::Template
Defined in:
lib/toys/templates/clean.rb

Overview

A template for tools that clean build artifacts

Constant Summary collapse

DEFAULT_TOOL_NAME =

Default tool name

Returns:

  • (String)
"clean"

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Toys::Template

create

Constructor Details

#initialize(name: nil, paths: [], context_directory: nil) ⇒ Clean

Create the template settings for the Clean template.

Parameters:

  • name (String) (defaults to: nil)

    Name of the tool to create. Defaults to DEFAULT_TOOL_NAME.

  • paths (Array<String>) (defaults to: [])

    An array of glob patterns indicating what to clean. You can also include the symbol :gitignore which will clean all items covered by .gitignore files, if contained in a git working tree.

  • context_directory (String) (defaults to: nil)

    A custom context directory to use when executing this tool.



29
30
31
32
33
# File 'lib/toys/templates/clean.rb', line 29

def initialize(name: nil, paths: [], context_directory: nil)
  @name = name
  @paths = paths
  @context_directory = context_directory
end

Instance Attribute Details

#context_directory=(value) ⇒ String

Custom context directory for this tool.

Parameters:

  • value (String)

Returns:

  • (String)


57
58
59
# File 'lib/toys/templates/clean.rb', line 57

def context_directory=(value)
  @context_directory = value
end

#name=(value) ⇒ String

Name of the tool to create.

Parameters:

  • value (String)

Returns:

  • (String)


41
42
43
# File 'lib/toys/templates/clean.rb', line 41

def name=(value)
  @name = value
end

#paths=(value) ⇒ Array<String>

An array of glob patterns indicating what to clean.

Parameters:

  • value (Array<String>)

Returns:

  • (Array<String>)


49
50
51
# File 'lib/toys/templates/clean.rb', line 49

def paths=(value)
  @paths = value
end