Sha256: 5fa9afb2a28506f1c090f5a092127b48abe39dfc4d40f1e04a04b095501a625b

Contents?: true

Size: 613 Bytes

Versions: 9

Compression:

Stored size: 613 Bytes

Contents

# frozen_string_literal: true

require "pathname"
require "refinements/structs"

module Rubysmith
  module Builders
    # Initializes building of project by checking for existence first.
    class Init
      using Refinements::Structs

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

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

      def call
        builder.call(configuration.merge(template_path: "%project_name%")).check
        configuration
      end

      private

      attr_reader :configuration, :builder
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rubysmith-5.9.0 lib/rubysmith/builders/init.rb
rubysmith-5.8.1 lib/rubysmith/builders/init.rb
rubysmith-5.8.0 lib/rubysmith/builders/init.rb
rubysmith-5.7.0 lib/rubysmith/builders/init.rb
rubysmith-5.6.0 lib/rubysmith/builders/init.rb
rubysmith-5.5.0 lib/rubysmith/builders/init.rb
rubysmith-5.4.0 lib/rubysmith/builders/init.rb
rubysmith-5.3.0 lib/rubysmith/builders/init.rb
rubysmith-5.2.0 lib/rubysmith/builders/init.rb