Skip to content

Commit

Permalink
Updated documentation for service helpers.
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorrowe committed Jul 5, 2013
1 parent 402acd4 commit 3f6d053
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 103 deletions.
90 changes: 0 additions & 90 deletions lib/aws/core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 || {})
Expand Down
11 changes: 7 additions & 4 deletions lib/aws/core/region.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
17 changes: 8 additions & 9 deletions tasks/docs.rake
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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}/
)
Expand Down

0 comments on commit 3f6d053

Please sign in to comment.