Sha256: 315111d9b82b8d15b58a95a92c9dd9f9795587526f2a7bd50ad17d8753c34a0c

Contents?: true

Size: 666 Bytes

Versions: 4

Compression:

Stored size: 666 Bytes

Contents

module R10K
  module Action
    class Runner
      def initialize(opts, argv, klass)
        @opts = opts
        @argv = argv
        @klass = klass
      end

      def instance
        if @_instance.nil?
          iopts = @opts.dup
          iopts.delete(:loglevel)
          @_instance = @klass.new(iopts, @argv)
        end
        @_instance
      end

      def call
        setup_logging
        setup_settings
        # @todo check arguments
        instance.call
      end

      def setup_logging
        if @opts.key?(:loglevel)
          R10K::Logging.level = @opts[:loglevel]
        end
      end

      def setup_settings
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
r10k-1.5.1 lib/r10k/action/runner.rb
r10k-1.4.2 lib/r10k/action/runner.rb
r10k-1.4.1 lib/r10k/action/runner.rb
r10k-1.4.0 lib/r10k/action/runner.rb