Class: Rubysmith::Builders::Git::Ignore

Inherits:
Object
  • Object
show all
Defined in:
lib/rubysmith/builders/git/ignore.rb

Overview

Builds Git repository directory and file ignore configuration.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(configuration, builder: Builder) ⇒ Ignore

Returns a new instance of Ignore.



14
15
16
17
# File 'lib/rubysmith/builders/git/ignore.rb', line 14

def initialize configuration, builder: Builder
  @configuration = configuration
  @builder = builder
end

Class Method Details

.callObject



12
# File 'lib/rubysmith/builders/git/ignore.rb', line 12

def self.call(...) = new(...).call

Instance Method Details

#callObject



19
20
21
22
23
24
25
26
27
# File 'lib/rubysmith/builders/git/ignore.rb', line 19

def call
  return configuration unless configuration.build_git

  builder.call(configuration.merge(template_path: "%project_name%/.gitignore.erb"))
         .render
         .replace("  ", "")

  configuration
end