Sha256: e25451f586b92e12fe3f9549a8672cee769c3bfea465c97649e5cc2b1d70ca3c

Contents?: true

Size: 944 Bytes

Versions: 2

Compression:

Stored size: 944 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 = AcquiaToolbelt::CLI::API.request "sites/#{site}"

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

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
acquia_toolbelt-2.0.1 lib/acquia_toolbelt/cli/site.rb
acquia_toolbelt-2.0.0 lib/acquia_toolbelt/cli/site.rb