Sha256: cce2ada44532ed7922effe936589b9621a911ec18c4831b11c393626a327628d

Contents?: true

Size: 759 Bytes

Versions: 6

Compression:

Stored size: 759 Bytes

Contents

# frozen_string_literal: true

require "refinements/structs"

module Rubysmith
  module Builders
    # Builds project skeleton GitHub CI template.
    class GitHubCI
      using Refinements::Structs

      def self.call(...) = new(...).call

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

      def call
        return configuration unless configuration.build_git_hub_ci

        builder.call(configuration_with_template).render
        configuration
      end

      private

      attr_reader :configuration, :builder

      def configuration_with_template
        configuration.merge template_path: "%project_name%/.github/workflows/ci.yml.erb"
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rubysmith-4.4.0 lib/rubysmith/builders/git_hub_ci.rb
rubysmith-4.3.0 lib/rubysmith/builders/git_hub_ci.rb
rubysmith-4.2.0 lib/rubysmith/builders/git_hub_ci.rb
rubysmith-4.1.0 lib/rubysmith/builders/git_hub_ci.rb
rubysmith-4.0.1 lib/rubysmith/builders/git_hub_ci.rb
rubysmith-4.0.0 lib/rubysmith/builders/git_hub_ci.rb