diff --git a/lib/aws/core.rb b/lib/aws/core.rb index de92850241d..99cbe0be56b 100644 --- a/lib/aws/core.rb +++ b/lib/aws/core.rb @@ -237,96 +237,6 @@ module Http class << self - # @!method cloud_front - # @return [CloudFront] - - # @!method cloud_search - # @return [CloudSearch] - - # @!method cloud_watch - # @return [CloudWatch] - - # @!method dynamo_db - # @return [DynamoDB] - - # @!method ec2 - # @return [EC2] - - # @!method emr - # @return [EMR] - - # @!method elasticache - # @return [ElastiCache] - - # @!method glacier - # @return [Glacier] - - # @!method rds - # @return [RDS] - - # @!method route_53 - # @return [Route53] - - # @!method simple_email_service - # @return [SimpleEmailService] - - # @!method sns - # @return [SNS] - - # @!method sqs - # @return [SQS] - - # @!method simple_workflow - # @return [SimpleWorkflow] - - # @!method simple_db - # @return [SimpleDB] - - # @!method auto_scaling - # @return [AutoScaling] - - # @!method cloud_formation - # @return [CloudFormation] - - # @!method data_pipeline - # @return [DataPipeline] - - # @!method direct_connect - # @return [DirectConnect] - - # @!method elastic_beanstalk - # @return [ElasticBeanstalk] - - # @!method iam - # @return [IAM] - - # @!method import_export - # @return [ImportExport] - - # @!method ops_works - # @return [OpsWorks] - - # @!method sts - # @return [STS] - - # @!method storage_gateway - # @return [StorageGateway] - - # @!method support - # @return [Support] - - # @!method elb - # @return [ELB] - - # @!method elastic_transcoder - # @return [ElasticTranscoder] - - # @!method redshift - # @return [Redshift] - - # @!method s3 - # @return [S3] - SERVICES.values.each do |svc| define_method(svc.method_name) do |*args| AWS.const_get(svc.class_name).new(args.first || {}) diff --git a/lib/aws/core/region.rb b/lib/aws/core/region.rb index b21d6e7907e..4f00530b4a3 100644 --- a/lib/aws/core/region.rb +++ b/lib/aws/core/region.rb @@ -22,18 +22,20 @@ module Core # aws.dynamo_db.tables.map(&:name) # aws.ec2.instances.map(&:id) # + # Regions provide helper methods for each service. + # # @attr_reader [AutoScaling] auto_scaling # @attr_reader [CloudFormation] cloud_formation # @attr_reader [CloudFront] cloud_front # @attr_reader [CloudSearch] cloud_search # @attr_reader [CloudWatch] cloud_watch - # @attr_reader [DynamoDB] dynamo_db # @attr_reader [DataPipeline] data_pipeline # @attr_reader [DirectConnect] direct_connect + # @attr_reader [DynamoDB] dynamo_db # @attr_reader [EC2] ec2 - # @attr_reader [ElastiCache] elasticache # @attr_reader [ElasticBeanstalk] elastic_beanstalk # @attr_reader [ElasticTranscoder] elastic_transcoder + # @attr_reader [ElastiCache] elasticache # @attr_reader [ELB] elb # @attr_reader [EMR] emr # @attr_reader [Glacier] glacier @@ -44,13 +46,14 @@ module Core # @attr_reader [Redshift] redshift # @attr_reader [Route53] route_53 # @attr_reader [S3] s3 + # @attr_reader [SimpleEmailService] ses # @attr_reader [SimpleDB] simple_db - # @attr_reader [SimpleEmailService] simple_email_service - # @attr_reader [SimpleWorkflow] simple_workflow # @attr_reader [SNS] sns # @attr_reader [SQS] sqs # @attr_reader [StorageGateway] storage_gateway # @attr_reader [STS] sts + # @attr_reader [Support] support + # @attr_reader [SimpleWorkflow] swf # class Region diff --git a/tasks/docs.rake b/tasks/docs.rake index 80257e27203..b1089d79566 100644 --- a/tasks/docs.rake +++ b/tasks/docs.rake @@ -15,7 +15,7 @@ require 'yard' namespace :docs do - task :yard => [:update_readme, :update_core] do + task :yard => [:update_readme, :update_region] do sh "yard" end @@ -83,22 +83,21 @@ namespace :docs do ) end - # updates the list of supported services in lib/aws/core.rb - task :update_core do + task :update_region do require 'aws/core' svcs = [] - AWS::SERVICES.values.each do |svc| - svcs << "# * {AWS.#{svc.method_name}}" + AWS::SERVICES.values.sort_by(&:method_name).each do |svc| + svcs << " # @attr_reader [#{svc.class_name}] #{svc.method_name}" end - start = '# # Supported Services' - stop = '# # Configuration' + start = ' # Regions provide helper methods for each service.' + stop = ' class Region' update_file( - 'lib/aws/core.rb', - "#{start}\n#\n#{svcs.sort.join("\n")}\n#\n#{stop}\n", + 'lib/aws/core/region.rb', + "#{start}\n #\n#{svcs.join("\n")}\n #\n#{stop}\n", /^#{start}/, /^#{stop}/ )