Sha256: 0cc7bb635520277c321e1ad538bc83c7e5ac2095de3dadd80434b04785d30cbe

Contents?: true

Size: 711 Bytes

Versions: 1

Compression:

Stored size: 711 Bytes

Contents

# frozen_string_literal: true

module Rubysmith
  module Builders
    # Builds project skeleton core structure and minimum file support.
    class Core
      def self.call(...) = new(...).call

      def initialize configuration, builder: Builder
        @configuration = configuration
        @builder = builder
      end

      def call
        builder.call(configuration.with(template_path: "%project_name%/lib/%project_path%.rb.erb"))
               .render
               .replace(/  (?!(module|end))/, "")

        builder.call(configuration.with(template_path: "%project_name%/.ruby-version.erb")).render
        nil
      end

      private

      attr_reader :configuration, :builder
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rubysmith-0.12.0 lib/rubysmith/builders/core.rb