Sha256: efe4eb60190ea6e1c1dd332b96e5cffd4557c3f3937ef8592c10b9e9e3f3a27d

Contents?: true

Size: 1.67 KB

Versions: 4

Compression:

Stored size: 1.67 KB

Contents

# frozen_string_literal: true

module Rubysmith
  module CLI
    module Actions
      # Handles the build action.
      class Build
        include Rubysmith::Import[:logger]

        # Order is important.
        # rubocop:todo Metrics/CollectionLiteralLength
        BUILDERS = [
          Builders::Core,
          Builders::Version,
          Builders::Documentation::Readme,
          Builders::Documentation::Citation,
          Builders::Documentation::License,
          Builders::Documentation::Version,
          Builders::Git::Setup,
          Builders::Git::Ignore,
          Builders::Git::Safe,
          Builders::Bundler,
          Builders::Rake,
          Builders::Console,
          Builders::CircleCI,
          Builders::Setup,
          Builders::GitHub,
          Builders::GitHubCI,
          Builders::Guard,
          Builders::Reek,
          Builders::RSpec::Binstub,
          Builders::RSpec::Context,
          Builders::RSpec::Helper,
          Builders::Caliber,
          Extensions::Bundler,
          Extensions::Pragmater,
          Extensions::Tocer,
          Extensions::Rubocop,
          Builders::Git::Commit
        ].freeze
        # rubocop:enable Metrics/CollectionLiteralLength

        def initialize(builders: BUILDERS, **)
          super(**)
          @builders = builders
        end

        def call configuration
          log_info "Building project skeleton: #{configuration.project_name}..."
          builders.each { |builder| builder.call configuration }
          log_info "Project skeleton complete!"
        end

        private

        attr_reader :builders

        def log_info(message) = logger.info { message }
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rubysmith-4.9.0 lib/rubysmith/cli/actions/build.rb
rubysmith-4.8.0 lib/rubysmith/cli/actions/build.rb
rubysmith-4.7.0 lib/rubysmith/cli/actions/build.rb
rubysmith-4.6.1 lib/rubysmith/cli/actions/build.rb