Class: Rubysmith::Builders::Bundler

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

Overview

Builds Bundler Gemfile configuration for project skeleton.

Instance Method Summary collapse

Methods inherited from Abstract

#initialize

Constructor Details

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

Instance Method Details

#callObject



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/rubysmith/builders/bundler.rb', line 11

def call
  builder.call(settings.merge(template_path: "%project_name%/Gemfile.erb"))
         .render
         .replace(/\n\s+group/, "\n\ngroup")
         .replace(/\n\s+gem/, "\n  gem")
         .replace(/  (?=.+(bootsnap|refinements|zeitwerk))/, "")
         .replace(/(\n+|\s+)end/, "\nend")
         .replace(/\n\ngroup :(quality|development|test|tools) do\nend/, "")
         .replace(/org"\n+/, "org\"\n\n")

  true
end