Sha256: 622c1130c22970b760ffa3faf8bfba3223157a81dcc9e6cc9b5dd919282c8d7c

Contents?: true

Size: 677 Bytes

Versions: 2

Compression:

Stored size: 677 Bytes

Contents

# frozen_string_literal: true

require "refinements/struct"

module Gemsmith
  module Builders
    # Builds project skeleton gem specification for use by RubyGems.
    class Specification < Rubysmith::Builders::Abstract
      using Refinements::Struct

      def call
        config = configuration.merge template_path: "%project_name%/%project_name%.gemspec.erb"

        builder.call(config)
               .render
               .replace("    \n", "")
               .replace("      ", "    ")
               .replace("  \n", "")
               .replace("    spec", "  spec")
               .replace(/\}\s+s/m, "}\n\n  s")

        configuration
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gemsmith-21.10.0 lib/gemsmith/builders/specification.rb
gemsmith-21.9.0 lib/gemsmith/builders/specification.rb