Sha256: c4cbc6597f37dd639781d491cbd496f11a9ad7638f33c7a459c3c1c62b203472

Contents?: true

Size: 597 Bytes

Versions: 3

Compression:

Stored size: 597 Bytes

Contents

require 'taketo/destination_matcher'
require 'taketo/actions/base_action'
require 'taketo/group_resolver'
require 'taketo/node_resolver'
require 'taketo/server_resolver'

module Taketo
  module Actions

    class Matches < BaseAction
      def initialize(options)
        super
        @resolver = if options[:list]
          GroupResolver
        elsif options[:view]
          NodeResolver
        else
          ServerResolver
        end.new(config, destination_path)
      end

      def run
        puts DestinationMatcher.new(@resolver.nodes).matches.join(" ")
      end
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
taketo-0.3.1 lib/taketo/actions/matches.rb
taketo-0.3.0 lib/taketo/actions/matches.rb
taketo-0.2.0 lib/taketo/actions/matches.rb