Module: Fanforce::Factory::Help

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

Instance Method Summary collapse

Instance Method Details

#bundle_commandObject



66
67
68
69
# File 'lib/fanforce/factory/help.rb', line 66

def bundle_command; <<-eos
bundle     (install|update)                         Run bundle on all addons in current factory
eos
end

#cleanorgs_commandObject



92
93
94
95
# File 'lib/fanforce/factory/help.rb', line 92

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/factory/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



87
88
89
90
# File 'lib/fanforce/factory/help.rb', line 87

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

#count_commandObject



61
62
63
64
# File 'lib/fanforce/factory/help.rb', line 61

def count_command; <<-eos
count                                               Display the number of addons in the current factory
eos
end

#create_commandObject



23
24
25
26
# File 'lib/fanforce/factory/help.rb', line 23

def create_command; <<-eos
create     (plugin|widget|app)-ID [PLUGIN_TYPE]     Create new addon folder and setup the file structure
eos
end

#delete_commandObject



33
34
35
36
# File 'lib/fanforce/factory/help.rb', line 33

def delete_command; <<-eos
delete     (plugin|widget|app)-ID                   Delete the addon folder and all related services
eos
end

#for(command, allowed_commands) ⇒ Object



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

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

#git_commandObject



71
72
73
74
75
# File 'lib/fanforce/factory/help.rb', line 71

def git_command; <<-eos
git        [ANY GIT COMMAND]                        Run the same git command across all addons in current factory
git        status:overview                          A custom git command that displays a simple status for each addon
eos
end

#intro(executable, runtype) ⇒ Object



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

def intro(executable, runtype)
  response  = "-----------------------------------------------------------------------------------------------------------------------\n"
  response += "USAGE: #{executable} #{runtype == :single ? '' : '[:filter] '}<command>\n"
end

#iron_commandObject



77
78
79
80
# File 'lib/fanforce/factory/help.rb', line 77

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

#push_commandObject



53
54
55
56
57
58
59
# File 'lib/fanforce/factory/help.rb', line 53

def push_command; <<-eos
push       RACK_ENV:[*all|OR...]                    Push all changes to the environment specified
                       |bitbucket                 Push the latest commit to bitbucket
                       |heroku                    Push the latest commit to heroku and restart
                       |iron:[*upload:nuclear]    Push changes to workers
eos
end

#restart_commandObject



48
49
50
51
# File 'lib/fanforce/factory/help.rb', line 48

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

#setup_commandObject



28
29
30
31
# File 'lib/fanforce/factory/help.rb', line 28

def setup_command; <<-eos
setup      (plugin|widget|app)-ID [PLUGIN_TYPE]     Similar to the create command, except it uses existing files
eos
end

#update_commandObject



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

def update_command; <<-eos
update     (all|OR...)                              Update all items
             |files                               Create or update needed files
             |env:[*all|RACK_ENV]                 Update environment vars for a specific environment
             |pow                                 Ensure pow domains are setup for development environment
             |bitbucket                           Create new repositories in bitbucket and push latest commit
             |heroku:[*all|RACK_ENV]              Create new app in heroku account and push latest commit
eos
end

#version_commandObject



82
83
84
85
# File 'lib/fanforce/factory/help.rb', line 82

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