tasks/docs.rake
def supported_services_table

  line = "| %-35s | %-25s | %-30s |\n"

  lines = []
  Aws.service_classes.keys.sort_by(&:downcase).each do |svc|
    svc = Aws.service_classes[svc]
    client = svc.default_client_class
    full_name = client.api.metadata['service_full_name']
    versions = svc.api_versions
    if versions.size > 1
      versions = "#{versions.first} &mdash; #{versions.last}"
    else
      versions = versions.first
    end
    lines << line % [full_name, svc.name, versions]
  end

  [
    "\n",
    line % ['Service Name', 'Service Class', 'API Versions'],
    line % ['-' * 35, '-' * 25, '-' * 30],
    lines.sort_by(&:downcase),
    "\n",
  ]
end
# Generates an HTML table of supported services that is used by README.md
Generates an HTML table of supported services that is used by README.md
Generates an HTML table of supported services that is used by README . md
def supported_services_table
  line = "| %-35s | %-25s | %-30s |\n"
  lines = []
  Aws.service_classes.keys.sort_by(&:downcase).each do |svc|
    svc = Aws.service_classes[svc]
    client = svc.default_client_class
    full_name = client.api.metadata['service_full_name']
    versions = svc.api_versions
    if versions.size > 1
      versions = "#{versions.first} &mdash; #{versions.last}"
    else
      versions = versions.first
    end
    lines << line % [full_name, svc.name, versions]
  end
  [
    "\n",
    line % ['Service Name', 'Service Class', 'API Versions'],
    line % ['-' * 35, '-' * 25, '-' * 30],
    lines.sort_by(&:downcase),
    "\n",
  ]
end
def supported_services_table line = "| %-35s | %-25s | %-30s |\n" lines = [ ] Aws . service_classes . keys . sort_by ( & :downcase ) . each do | svc | svc = Aws . service_classes [ svc ] client = svc . default_client_class full_name = client . api . metadata [ 'service_full_name' ] versions = svc . api_versions if versions . size > 1 versions = "#{versions.first} &mdash; #{versions.last}" else versions = versions . first end lines << line % [ full_name , svc . name , versions ] end [ "\n" , line % [ 'Service Name' , 'Service Class' , 'API Versions' ] , line % [ '-' * 35 , '-' * 25 , '-' * 30 ] , lines . sort_by ( & :downcase ) , "\n" , ] end
Generates an HTML table of supported services that is used by README.md
Generates an HTML table of supported services that is used by README . md