Sha256: 3ca0d686e6178b31b12dc2afb72f06e3be11980146d725204ca4c8839215bcd9

Contents?: true

Size: 734 Bytes

Versions: 8

Compression:

Stored size: 734 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(/  (?=.+(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
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rubysmith-8.0.0 lib/rubysmith/builders/bundler.rb
rubysmith-7.9.0 lib/rubysmith/builders/bundler.rb
rubysmith-7.8.0 lib/rubysmith/builders/bundler.rb
rubysmith-7.7.0 lib/rubysmith/builders/bundler.rb
rubysmith-7.6.0 lib/rubysmith/builders/bundler.rb
rubysmith-7.5.0 lib/rubysmith/builders/bundler.rb
rubysmith-7.4.0 lib/rubysmith/builders/bundler.rb
rubysmith-7.3.0 lib/rubysmith/builders/bundler.rb