Class: Hexx::CLI::Base::Folder Private

Inherits:
Object
  • Object
show all
Defined in:
lib/hexx/cli/base/folder.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Copies all files from a source folder to the target one

  • Files, that have '.erb' extension, are pre-processed as erb templates.
  • The starting "_" symbol is removed from a file name.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.initialize(scaffolder) ⇒ Hexx::Processors::Folder

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Constructs the processor for given scaffolder

Parameters:

  • scaffolder (Thor::Actions)

Returns:

  • (Hexx::Processors::Folder)


22
23
24
# File 'lib/hexx/cli/base/folder.rb', line 22

def initialize(scaffolder)
  @__scaffolder__ = scaffolder
end

Instance Method Details

#copy(source, target, options = {}) ⇒ self

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Copies a source folder content to the target folder

Parameters:

  • source (String)

    The source folder path relative to the scaffolder's source_root

  • target (String)

    The target folder path relative to the scaffolder's destination_root

  • options (Hash) (defaults to: {})

Returns:

  • (self)

    itself



35
36
37
38
39
40
# File 'lib/hexx/cli/base/folder.rb', line 35

def copy(source, target, options = {})
  @source, @target, @options = source, target, options
  source_files.each { |file| file_processor.copy(file) }

  self
end

#new(scaffolder) ⇒ Hexx::Processors::Folder

Constructs the processor for given scaffolder

Parameters:

  • scaffolder (Thor::Actions)

Returns:

  • (Hexx::Processors::Folder)


22
23
24
# File 'lib/hexx/cli/base/folder.rb', line 22

def initialize(scaffolder)
  @__scaffolder__ = scaffolder
end