Sha256: d7379fbead50207eae1bc88d8a78092efe56ef21ad197d32fdf4b6dd30be059a

Contents?: true

Size: 1.49 KB

Versions: 6

Compression:

Stored size: 1.49 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.
        BUILDERS = [
          Builders::Core,
          Builders::Version,
          Builders::Documentation::Readme,
          Builders::Documentation::Citation,
          Builders::Documentation::License,
          Builders::Documentation::Version,
          Builders::Git::Setup,
          Builders::Git::Ignore,
          Builders::Bundler,
          Builders::Rake,
          Builders::Console,
          Builders::CircleCI,
          Builders::Setup,
          Builders::GitHub,
          Builders::Guard,
          Builders::Reek,
          Builders::RSpec::Context,
          Builders::RSpec::Helper,
          Builders::Caliber,
          Extensions::Bundler,
          Extensions::Pragmater,
          Extensions::Tocer,
          Extensions::Rubocop,
          Builders::Git::Commit
        ].freeze

        def initialize builders: BUILDERS, **dependencies
          super(**dependencies)
          @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

6 entries across 6 versions & 1 rubygems

Version Path
rubysmith-3.8.0 lib/rubysmith/cli/actions/build.rb
rubysmith-3.7.0 lib/rubysmith/cli/actions/build.rb
rubysmith-3.6.0 lib/rubysmith/cli/actions/build.rb
rubysmith-3.5.0 lib/rubysmith/cli/actions/build.rb
rubysmith-3.4.0 lib/rubysmith/cli/actions/build.rb
rubysmith-3.3.0 lib/rubysmith/cli/actions/build.rb