Skip to content

Commit

Permalink
Sets up RDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
Rodrigo Tassinari de Oliveira committed Mar 21, 2013
1 parent 44a88b1 commit ca0ac0f
Show file tree
Hide file tree
Showing 11 changed files with 92 additions and 31 deletions.
68 changes: 67 additions & 1 deletion README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,70 @@ Command line application to deploy and manage webapps on Amazon Web Services.

{<img src="https://travis-ci.org/myfreecomm/myfc_cloud.png?branch=master" alt="Build Status" />}[https://travis-ci.org/myfreecomm/myfc_cloud]
{<img src="https://coveralls.io/repos/myfreecomm/myfc_cloud/badge.png?branch=master" alt="Coverage Status" />}[https://coveralls.io/r/myfreecomm/myfc_cloud]
{<img src="https://codeclimate.com/github/myfreecomm/myfc_cloud.png" />}[https://codeclimate.com/github/myfreecomm/myfc_cloud]
{<img src="https://codeclimate.com/github/myfreecomm/myfc_cloud.png" alt="Code Climate Status" />}[https://codeclimate.com/github/myfreecomm/myfc_cloud]

== Installation

$ gem install myfc_cloud

== Usage

=== Available commands

$ myfc_cloud help

NAME
myfc_cloud - Command line application to deploy and manage webapps on Amazon Web Services

SYNOPSIS
myfc_cloud [global options] command [command options] [arguments...]

VERSION
0.0.1

GLOBAL OPTIONS
-C, --config_file=PATH_TO_CONFIG_FILE - Path to the configuration file (default: ~/.myfc_cloud.yml)
-P, --production - Targets the production environment
-S, --sandbox - Targets the sandbox environment (default)
-T, --stage - Targets the stage environment
--help - Show this message
--version -

COMMANDS
check - Checks if all required configuration is properly set and all requirements are met
deploy - Deploys your application to the selected environment
help - Shows a list of commands or help for one command
scaling_group:check - Checks if all instances are InService AND Healthy on your ASG
scaling_group:freeze - 'Freezes' your ASG
scaling_group:info - Lists information about your Auto Scaling Group
scaling_group:update - Updates some attributes of your ASG

=== Configuration

+myfc_cloud+ expects a YAML configuration file with your AWS settings, keyed by environment, like this:

production:
access_key_id: production_access_key_id
secret_access_key: production_secret_access_key
auto_scaling_group_name: production_asg
elastic_load_balancer_name: production_elb
rds_instance_identifier: production_rds
app_path_on_server: /path/to/production/app/src
sandbox:
access_key_id: sandbox_access_key_id
secret_access_key: sandbox_secret_access_key
auto_scaling_group_name: sandbox_asg
elastic_load_balancer_name: sandbox_elb
rds_instance_identifier: sandbox_rds
app_path_on_server: /path/to/sandbox/app/src
stage:
access_key_id: stage_access_key_id
secret_access_key: stage_secret_access_key
auto_scaling_group_name: stage_asg
elastic_load_balancer_name: stage_elb
rds_instance_identifier: stage_rds
app_path_on_server: /path/to/stage/app/src

Optionally, you can leave out the +access_key_id+ and +secret_access_key+ information from the configuration file, and supply them as environment variables when you call the +myfc_cloud+ command, for example:

$ MYFC_CLOUD_ACCESS_KEY_ID=some-id MYFC_CLOUD_SECRET_ACCESS_KEY=some-secret myfc_cloud deploy
16 changes: 8 additions & 8 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# encoding: utf-8
require "bundler/gem_tasks"

require "rspec/core/rake_task"

require 'rdoc/task'
Rake::RDocTask.new do |rdoc|
rdoc.title = 'myfc_cloud'
rdoc.main = "README.rdoc"
rdoc.rdoc_dir = 'doc'
rdoc.rdoc_files.include("README.rdoc","lib/**/*.rb","bin/**/*")
# rdoc.generator = 'darkfish'
end

require "rspec/core/rake_task"
RSpec::Core::RakeTask.new(:spec)

Rake::RDocTask.new do |rd|
rd.main = "README.rdoc"
rd.rdoc_files.include("README.rdoc","lib/**/*.rb","bin/**/*")
rd.title = 'myfc_cloud'
end

task :test => :spec
task :default => :spec
4 changes: 2 additions & 2 deletions bin/myfc_cloud
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# have this method, so we add it so we get resolved symlinks
# and compatibility
unless File.respond_to?(:realpath)
class File #:nodoc:
class File # :nodoc:
def self.realpath(path)
return realpath(File.readlink(path)) if symlink?(path)
path
Expand All @@ -24,7 +24,7 @@ AwesomePrint.defaults = {
:index => false
}

include GLI::App
include GLI::App # :nodoc:

program_desc 'Command line application to deploy and manage webapps on Amazon Web Services'

Expand Down
10 changes: 5 additions & 5 deletions lib/myfc_cloud.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@
require "myfc_cloud/configuration"
require "myfc_cloud/version"

module MyfcCloud
module MyfcCloud # :nodoc:
end

# TODO extract these extensions to separate file (or just use active_support already)
class Object
class Object # :nodoc:
# TODO extract these extensions to separate file (or just use active_support already)
def blank?
respond_to?(:empty?) ? empty? : !self
end
end

class Hash
class Hash # :nodoc:
# TODO extract these extensions to separate file (or just use active_support already)
def symbolize_keys
inject({}) do |options, (key, value)|
options[(key.to_sym rescue key) || key] = value
options
end
end

def symbolize_keys!
self.replace(self.symbolize_keys)
end
Expand Down
4 changes: 2 additions & 2 deletions lib/myfc_cloud/commands.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
require "myfc_cloud/commands/deploy"
require "myfc_cloud/commands/scaling_group"

module MyfcCloud
module Commands
module MyfcCloud # :nodoc:
module Commands # :nodoc:
end
end
4 changes: 2 additions & 2 deletions lib/myfc_cloud/commands/check.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# encoding: utf-8
module MyfcCloud
module Commands
module MyfcCloud # :nodoc:
module Commands # :nodoc:
class Check

def initialize(configuration)
Expand Down
4 changes: 2 additions & 2 deletions lib/myfc_cloud/commands/deploy.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# encoding: utf-8
module MyfcCloud
module Commands
module MyfcCloud # :nodoc:
module Commands # :nodoc:
class Deploy

def initialize(configuration, options={})
Expand Down
4 changes: 2 additions & 2 deletions lib/myfc_cloud/commands/scaling_group.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# encoding: utf-8
module MyfcCloud
module Commands
module MyfcCloud # :nodoc:
module Commands # :nodoc:
class ScalingGroup

def initialize(configuration)
Expand Down
2 changes: 1 addition & 1 deletion lib/myfc_cloud/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require 'yaml'
require 'ostruct'

module MyfcCloud
module MyfcCloud # :nodoc:
class Configuration

def initialize(filepath, environment=:sandbox)
Expand Down
2 changes: 1 addition & 1 deletion lib/myfc_cloud/version.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# encoding: utf-8
module MyfcCloud
module MyfcCloud # :nodoc:
VERSION = '0.0.1'
end
5 changes: 0 additions & 5 deletions myfc_cloud.rdoc

This file was deleted.

0 comments on commit ca0ac0f

Please sign in to comment.