Sha256: d46c15722aa9f0fb9b86e4111b8dd903678fd8c48e3625a92183e45216f5bc4f

Contents?: true

Size: 789 Bytes

Versions: 11

Compression:

Stored size: 789 Bytes

Contents

# frozen_string_literal: true

require "refinements/struct"

module Hanamismith
  module Builders
    module CI
      # Builds project skeleton GitHub CI configuration.
      class GitHub
        using Refinements::Struct

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

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

        def call
          return configuration unless configuration.build_git_hub_ci

          path = "%project_name%/.github/workflows/ci.yml.erb"
          builder.call(configuration.merge(template_path: path)).render.replace(/\n\n\Z/, "\n")
          configuration
        end

        private

        attr_reader :configuration, :builder
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
hanamismith-0.34.0 lib/hanamismith/builders/ci/git_hub.rb
hanamismith-0.33.0 lib/hanamismith/builders/ci/git_hub.rb
hanamismith-0.32.0 lib/hanamismith/builders/ci/git_hub.rb
hanamismith-0.31.0 lib/hanamismith/builders/ci/git_hub.rb
hanamismith-0.30.0 lib/hanamismith/builders/ci/git_hub.rb
hanamismith-0.29.0 lib/hanamismith/builders/ci/git_hub.rb
hanamismith-0.28.1 lib/hanamismith/builders/ci/git_hub.rb
hanamismith-0.28.0 lib/hanamismith/builders/ci/git_hub.rb
hanamismith-0.27.0 lib/hanamismith/builders/ci/git_hub.rb
hanamismith-0.26.0 lib/hanamismith/builders/ci/git_hub.rb
hanamismith-0.25.0 lib/hanamismith/builders/ci/git_hub.rb