Sha256: c93d45ba138023fceba4b27fbf5181660d63b65997241e0d3dbb449d7c1dd27c

Contents?: true

Size: 692 Bytes

Versions: 14

Compression:

Stored size: 692 Bytes

Contents

# frozen_string_literal: true

require "refinements/structs"

module Rubysmith
  module Builders
    # Builds project skeleton Circle CI configuration.
    class CircleCI
      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_circle_ci

        builder.call(configuration.merge(template_path: "%project_name%/.circleci/config.yml.erb"))
               .render

        configuration
      end

      private

      attr_reader :configuration, :builder
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
rubysmith-3.4.0 lib/rubysmith/builders/circle_ci.rb
rubysmith-3.3.0 lib/rubysmith/builders/circle_ci.rb
rubysmith-3.2.0 lib/rubysmith/builders/circle_ci.rb
rubysmith-3.1.0 lib/rubysmith/builders/circle_ci.rb
rubysmith-3.0.1 lib/rubysmith/builders/circle_ci.rb
rubysmith-3.0.0 lib/rubysmith/builders/circle_ci.rb
rubysmith-2.0.2 lib/rubysmith/builders/circle_ci.rb
rubysmith-2.0.1 lib/rubysmith/builders/circle_ci.rb
rubysmith-2.0.0 lib/rubysmith/builders/circle_ci.rb
rubysmith-1.3.0 lib/rubysmith/builders/circle_ci.rb
rubysmith-1.2.0 lib/rubysmith/builders/circle_ci.rb
rubysmith-1.1.1 lib/rubysmith/builders/circle_ci.rb
rubysmith-1.1.0 lib/rubysmith/builders/circle_ci.rb
rubysmith-1.0.0 lib/rubysmith/builders/circle_ci.rb