Module: Fanforce::CLI::Help

Extended by:
Help
Included in:
Help
Defined in:
lib/fanforce/cli/help.rb

Instance Method Summary collapse

Instance Method Details

#bundle_commandObject



68
69
70
71
# File 'lib/fanforce/cli/help.rb', line 68

def bundle_command; <<-eos
bundle     install|update                           Run bundle on all apps in current fanforce
eos
end

#cleanorgs_commandObject



94
95
96
97
# File 'lib/fanforce/cli/help.rb', line 94

def cleanorgs_command; <<-eos
cleanorgs  environment   supercore_api_key          Remove installs that are no longer valid in the db
eos
end

#commands(allowed_commands) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/fanforce/cli/help.rb', line 9

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

#config_commandObject



89
90
91
92
# File 'lib/fanforce/cli/help.rb', line 89

def config_command; <<-eos
config                                              Display your Fanforce CLI config in the current directory
eos
end

#count_commandObject



63
64
65
66
# File 'lib/fanforce/cli/help.rb', line 63

def count_command; <<-eos
count                                               Display the number of fanforce apps in the current directory
eos
end

#create_commandObject



29
30
31
32
# File 'lib/fanforce/cli/help.rb', line 29

def create_command; <<-eos
create     app-ID                                   Creates a new app folder and sets up the file structure
eos
end

#delete_commandObject



34
35
36
37
# File 'lib/fanforce/cli/help.rb', line 34

def delete_command; <<-eos
delete     app-ID                                   Delete the app folder and all related services
eos
end

#for(command, allowed_commands) ⇒ Object



18
19
20
21
22
# File 'lib/fanforce/cli/help.rb', line 18

def for(command, allowed_commands)
  response  = "\n#{command.to_s.upcase} COMMAND...\n-----------------------------------------------------------------------------------------------------------------------\n"
  response += self.method("#{command}_command").call
  response += "-----------------------------------------------------------------------------------------------------------------------\n\n"
end

#git_commandObject



73
74
75
76
77
# File 'lib/fanforce/cli/help.rb', line 73

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

#intro(executable, runtype) ⇒ Object



4
5
6
7
# File 'lib/fanforce/cli/help.rb', line 4

def intro(executable, runtype)
  response  = "-----------------------------------------------------------------------------------------------------------------------\n"
  response += "USAGE: #{executable} <command>\n"
end

#iron_commandObject



79
80
81
82
# File 'lib/fanforce/cli/help.rb', line 79

def iron_command; <<-eos
iron       upload|reset|delete    RACK_ENV|all      Updates env variables and upload one or more workers to iron.io
eos
end

#list_commandObject



24
25
26
27
# File 'lib/fanforce/cli/help.rb', line 24

def list_command; <<-eos
list                                                Show a list of all apps in the current directory
eos
end

#push_commandObject



49
50
51
52
53
54
55
56
# File 'lib/fanforce/cli/help.rb', line 49

def push_command; <<-eos
push       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

#restart_commandObject



58
59
60
61
# File 'lib/fanforce/cli/help.rb', line 58

def restart_command; <<-eos
restart    [*development|RACK_ENV|all]              Runs `touch tmp/restart` if development or else `heroku restart`
eos
end

#update_commandObject



39
40
41
42
43
44
45
46
47
# File 'lib/fanforce/cli/help.rb', line 39

def update_command; <<-eos
update     all|OR...                                Similar to the create command, except it updates existing files
            |files                                Ensure all files exist and contain correct config
            |bundle                               Run bundle install
            |pow                                  Ensure correct pow domains are configured
            |git                                  Ensure git is initialized
            |env                                  Update ENV variables
eos
end

#version_commandObject



84
85
86
87
# File 'lib/fanforce/cli/help.rb', line 84

def version_command; <<-eos
version                                             Display your current Fanforce CLI version number
eos
end