Sha256: 0630f80a8f3fff4239147b788f8c122e2ada495e23fc5282adea0d06e175e4ea

Contents?: true

Size: 725 Bytes

Versions: 3

Compression:

Stored size: 725 Bytes

Contents

# frozen_string_literal: true

require "refinements/struct"

module Rubysmith
  module Builders
    # Builds Bundler Gemfile configuration for project skeleton.
    class Bundler < Abstract
      using Refinements::Struct

      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(/  (?=.+(refinements|zeitwerk))/, "")
               .replace(/(\n+|\s+)end/, "\nend")
               .replace(/\n\ngroup :(quality|development|test|tools) do\nend/, "")
               .replace(/org"\n+/, "org\"\n\n")

        true
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rubysmith-7.2.0 lib/rubysmith/builders/bundler.rb
rubysmith-7.1.0 lib/rubysmith/builders/bundler.rb
rubysmith-7.0.0 lib/rubysmith/builders/bundler.rb