Sha256: 80dc91da0d4fac5e4479f1da6f9d55e4bdcf1b9d370150b1c99920724cb31c0e

Contents?: true

Size: 599 Bytes

Versions: 1

Compression:

Stored size: 599 Bytes

Contents

module Terraforming
  module DNSimple
    class CLI < Thor
      def self.cli_options
        option :tfstate, type: :boolean
        option :user, type: :string
        option :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], api_token: options[: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.1 lib/terraforming/dnsimple/cli.rb