Sha256: 6399b66c9c00617bd9c9324dcec83cd1cf222a34bc75da6363ab6278cf2a2d58

Contents?: true

Size: 1.33 KB

Versions: 4

Compression:

Stored size: 1.33 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,
          Builders::Rubocop::Formatter
        ].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::Setup,
          Builders::Rubocop::Formatter,
          Builders::RubyCritic,
          Builders::Git::Commit
        ].freeze

        def self.with_minimum
          new builders: MINIMUM
        end

        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

4 entries across 4 versions & 1 rubygems

Version Path
rubysmith-0.9.1 lib/rubysmith/cli/processors/build.rb
rubysmith-0.9.0 lib/rubysmith/cli/processors/build.rb
rubysmith-0.8.0 lib/rubysmith/cli/processors/build.rb
rubysmith-0.7.0 lib/rubysmith/cli/processors/build.rb