Sha256: 0ff1280aeda1e6de0b5fbf1e41a9ec2c3c2cbdb5a7a5ddd9428315f11e110b97

Contents?: true

Size: 1 KB

Versions: 22

Compression:

Stored size: 1 KB

Contents

require 'shellwords'

module Aptible
  module CLI
    module Subcommands
      module Domains
        def self.included(thor)
          thor.class_eval do
            include Helpers::Operation
            include Helpers::App

            desc 'domains',
                 "Print an app's current virtual domains - DEPRECATED"
            app_options
            option :verbose, aliases: '-v'
            def domains
              deprecated 'This command is deprecated in favor of endpoints:list'
              app = ensure_app(options)
              print_vhosts(app) do |vhost|
                if options[:verbose]
                  "#{vhost.virtual_domain} -> #{vhost.external_host}"
                else
                  vhost.virtual_domain
                end
              end
            end

            private

            def print_vhosts(app)
              (app.vhosts || []).each do |vhost|
                say yield(vhost)
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
aptible-cli-0.18.3 lib/aptible/cli/subcommands/domains.rb
aptible-cli-0.18.2 lib/aptible/cli/subcommands/domains.rb
aptible-cli-0.18.1 lib/aptible/cli/subcommands/domains.rb
aptible-cli-0.18.0 lib/aptible/cli/subcommands/domains.rb
aptible-cli-0.17.2 lib/aptible/cli/subcommands/domains.rb
aptible-cli-0.17.1 lib/aptible/cli/subcommands/domains.rb
aptible-cli-0.17.0 lib/aptible/cli/subcommands/domains.rb
aptible-cli-0.16.9 lib/aptible/cli/subcommands/domains.rb
aptible-cli-0.16.8 lib/aptible/cli/subcommands/domains.rb
aptible-cli-0.16.7 lib/aptible/cli/subcommands/domains.rb
aptible-cli-0.16.6 lib/aptible/cli/subcommands/domains.rb
aptible-cli-0.16.5 lib/aptible/cli/subcommands/domains.rb
aptible-cli-0.16.4 lib/aptible/cli/subcommands/domains.rb
aptible-cli-0.16.3 lib/aptible/cli/subcommands/domains.rb
aptible-cli-0.16.2 lib/aptible/cli/subcommands/domains.rb
aptible-cli-0.16.1 lib/aptible/cli/subcommands/domains.rb
aptible-cli-0.16.0 lib/aptible/cli/subcommands/domains.rb
aptible-cli-0.15.2 lib/aptible/cli/subcommands/domains.rb
aptible-cli-0.15.1 lib/aptible/cli/subcommands/domains.rb
aptible-cli-0.15.0 lib/aptible/cli/subcommands/domains.rb