Sha256: 5457b045cdca14f41e46ad54f65008c1595ac195241541c51c1d67ff2b149285

Contents?: true

Size: 1.15 KB

Versions: 1

Compression:

Stored size: 1.15 KB

Contents

# frozen_string_literal: true

module Rubysmith
  module CLI
    module Processors
      # Handles the Command Line Interface (CLI) for building of a project skeleton.
      class Build
        # Order is important.
        MINIMUM = [
          Builders::Core,
          Builders::Bundler,
          Builders::Pragma
        ].freeze

        # Order is important.
        MAXIMUM = [
          Builders::Core,
          Builders::Documentation,
          Builders::Git::Setup,
          Builders::Bundler,
          Builders::Rake,
          Builders::Console,
          Builders::Setup,
          Builders::Guard,
          Builders::Reek,
          Builders::RSpec::Context,
          Builders::RSpec::Helper,
          Builders::Pragma,
          Builders::Rubocop,
          Builders::Git::Commit
        ].freeze

        def initialize builders: MAXIMUM
          @builders = builders
        end

        def call options
          Realm[**options].then { |realm| process realm }
        end

        private

        attr_reader :builders

        def process realm
          builders.each { |builder| builder.call realm }
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rubysmith-0.5.0 lib/rubysmith/cli/processors/build.rb