module Fanforce::CLI::Help extend Fanforce::CLI::Help def intro(executable, runtype) response = "-----------------------------------------------------------------------------------------------------------------------\n" response += "USAGE: #{executable} \n" end def commands(allowed_commands) response = "\n\nAVAILABLE COMMANDS...\n-----------------------------------------------------------------------------------------------------------------------\n" commands = allowed_commands.inject([]) do |results, c| results << self.send(:"#{c}_command") rescue next results end response += commands.join("-----------------------------------------------------------------------------------------------------------------------\n") response += "-----------------------------------------------------------------------------------------------------------------------\n\n" end def for(command, allowed_commands) response = "\n#{command.to_s.upcase} COMMAND...\n-----------------------------------------------------------------------------------------------------------------------\n" response += "-----------------------------------------------------------------------------------------------------------------------\n\n" end def list_command; <<-eos list Show a list of all apps in the current directory eos end def create_command; <<-eos create app-ID Creates a new app folder and sets up the file structure eos end def update_command; <<-eos update *all|app-ID Similar to the create command, except it updates existing files eos end def delete_command; <<-eos delete app-ID Delete the app folder and all related services eos end def push_command; <<-eos push development|RACK_ENV [*all|OR...] Push all changes to the environment specified |env Update environment vars in remote environments |bitbucket Push the latest commit to bitbucket |heroku Push the latest commit to heroku and restart |iron Push changes to workers eos end def restart_command; <<-eos restart [*development|RACK_ENV|all] Runs `touch tmp/restart` if development or else `heroku restart` eos end def count_command; <<-eos count Display the number of fanforce apps in the current directory eos end def bundle_command; <<-eos bundle (install|update) Run bundle on all apps in current fanforce eos end def git_command; <<-eos git [ANY GIT COMMAND] Run the same git command across all apps in current fanforce git status:overview A custom git command that displays a simple status for each app eos end def iron_command; <<-eos iron (upload|reset|delete) [*all|RACK_ENV] Updates env variables and upload one or more workers to iron.io eos end def version_command; <<-eos version Display your current Fanforce CLI version number eos end def config_command; <<-eos config Display your Fanforce CLI config in the current directory eos end def cleanorgs_command; <<-eos cleanorgs environment supercore_api_key Remove installs that are no longer valid in the db eos end end