Sha256: cb4ef38a712ba1b52e98e68200668b88b40d8b881dbd7aa653a93bf176851529

Contents?: true

Size: 1.09 KB

Versions: 5

Compression:

Stored size: 1.09 KB

Contents

require 'r10k/util/setopts'
require 'r10k/logging'

module R10K
  module Action
    class Base

      include R10K::Logging
      include R10K::Util::Setopts

      attr_accessor :settings

      # @param opts [Hash] A hash of options defined in #allowed_initialized_opts
      #   and managed by the SetOps mixin within the Action::Base class.
      #   Corresponds to the CLI flags and options.
      # @param argv [Enumerable] Typically CRI::ArgumentList or Array. A list-like
      #   collection of the remaining arguments to the CLI invocation (after
      #   removing flags and options).
      # @param settings [Hash] A hash of configuration loaded from the relevant
      #   config (r10k.yaml).
      #
      # @note All arguments will be required in the next major version
      def initialize(opts, argv, settings = {})
        @opts = opts
        @argv = argv
        @settings = settings

        setopts(opts, allowed_initialize_opts)
      end

      private

      def allowed_initialize_opts
        {
          :config => true,
          :trace  => true,
        }
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
r10k-3.12.0 lib/r10k/action/base.rb
r10k-3.11.0 lib/r10k/action/base.rb
r10k-3.10.0 lib/r10k/action/base.rb
r10k-3.9.3 lib/r10k/action/base.rb
r10k-3.9.2 lib/r10k/action/base.rb