Sha256: 6fd3f171ad13588128394b6afd1436a2ee845868370fa86cd4e0bf10f0d0cea2

Contents?: true

Size: 985 Bytes

Versions: 1

Compression:

Stored size: 985 Bytes

Contents

module AcquiaToolbelt
  class CLI
    class Sites < AcquiaToolbelt::Thor
      # Public: List all subscriptions the user has access to.
      #
      # Returns a list of subscriptions.
      desc "list", "List all subscriptions you have access to."
      def list
        sites = AcquiaToolbelt::CLI::API.request "sites"

        sites.each do |site|
          ui.say
          # Get the individual subscription information.
          site_data = AcquiaToolbelt::CLI::API.request "sites/#{site}"

          ui.say "#{site_data["title"]}"
          ui.say "> Username: #{site_data["unix_username"]}"
          ui.say "> Subscription: #{site_data["name"]}"

          # If the VCS type is SVN, we want it in all uppercase, otherwise just
          # capitilise it.
          vcs_name = (site_data["vcs_type"] == "svn") ? site_data["vcs_type"].upcase : site_data["vcs_type"].capitalize
          ui.say "> #{vcs_name} URL: #{site_data["vcs_url"]}"
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
acquia_toolbelt-2.3.1 lib/acquia_toolbelt/cli/site.rb