Sha256: 129304ea15856272a55023346231a3c8a089057a30dbfd335af13f25e73ca74c

Contents?: true

Size: 835 Bytes

Versions: 4

Compression:

Stored size: 835 Bytes

Contents

# frozen_string_literal: true

module Rubysmith
  module Builders
    # Builds project skeleton GitHub templates.
    class GitHub
      def self.call(...) = new(...).call

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

      def call
        return unless configuration.build_git_hub

        builder.call(with_issue_template).render
        builder.call(with_pull_request_template).render
      end

      private

      attr_reader :configuration, :builder

      def with_issue_template
        configuration.with template_path: "%project_name%/.github/ISSUE_TEMPLATE.md.erb"
      end

      def with_pull_request_template
        configuration.with template_path: "%project_name%/.github/PULL_REQUEST_TEMPLATE.md.erb"
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rubysmith-0.16.1 lib/rubysmith/builders/git_hub.rb
rubysmith-0.16.0 lib/rubysmith/builders/git_hub.rb
rubysmith-0.15.0 lib/rubysmith/builders/git_hub.rb
rubysmith-0.14.0 lib/rubysmith/builders/git_hub.rb