Class: Rubysmith::Builders::Rake::Configuration

Inherits:
Abstract
  • Object
show all
Defined in:
lib/rubysmith/builders/rake/configuration.rb

Overview

Builds project skeleton Rake file configuration.

Instance Method Summary collapse

Methods inherited from Abstract

#initialize

Constructor Details

This class inherits a constructor from Rubysmith::Builders::Abstract

Instance Method Details

#callObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/rubysmith/builders/rake/configuration.rb', line 12

def call
  return false unless settings.build_rake

  builder.call(settings.merge(template_path: "%project_name%/Rakefile.erb"))
         .render
         .replace(/\[\s+/, "[")
         .replace(/\s+\]/, "]")
         .replace("  ", "")
         .replace("task.options", "  task.options")
         .replace(/\n+(?=require)/, "\n")
         .replace(/\n{2,}/, "\n\n")

  true
end