Sha256: 1464a9d222bfee975abaabdb22e735b8987c9702a032c5fdbf9b3e31ac53e31e

Contents?: true

Size: 617 Bytes

Versions: 1

Compression:

Stored size: 617 Bytes

Contents

module Terraforming
  module DNSimple
    class CLI < Thor
      def self.cli_options
        option :tfstate, type: :boolean
        option :user_name, type: :string
        option :api_token, type: :string
      end

      desc "dnsr", "DNSimple Record"
      cli_options
      def dnsr
        execute(Terraforming::Resource::DNSimpleRecord, options)
      end

      private

      def execute(klass, options)
        client = Dnsimple::Client.new(username: options[:user_name], api_token: options[:api_token])
        puts options[:tfstate] ? klass.tfstate(client) : klass.tf(client)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
terraforming-dnsimple-0.1.0 lib/terraforming/dnsimple/cli.rb