Class: AppSendr::Command::Help
- Defined in:
- lib/appsendr/commands/help.rb
Defined Under Namespace
Classes: HelpGroup
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Base
#appsendr, #ask, #confirm, #extract_app, #extract_option, #format_date, #initialize, #option_exists?
Methods included from Helpers
#credentials_file, #credentials_setup?, #display, #error, #has_project_droppr?, #home_directory, #in_project_dir?, #project_appsendr, #project_appsendr_app, #read_app, #read_app_id, #require_in_project_and_no_droppr, #require_project, #require_project_dir, #require_project_droppr, #running_on_a_mac?, #running_on_windows?
Constructor Details
This class inherits a constructor from AppSendr::Command::Base
Class Method Details
.create_default_groups! ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/appsendr/commands/help.rb', line 31 def self.create_default_groups! group 'Commands' do |group| group.command 'help', 'show this usage' group.command 'version', 'show the gem version' group.space group.command 'list', 'list your apps' group.command 'link', 'link your app with an exsiting one in appsendr' group.command 'create <name>', 'create a new app' group.space group.command 'url', 'get the latest version install url. pass --copy to copy to the clipboard' group.space group.command 'build <active configuration>', 'build your xcode project and deploy' group.command 'build:clean', 'clean your xcode project' group.space group.command 'deploy <active configuration>', 'deploy the current build. pass --notify to send notification to all testers' group.space group.command 'testers', 'list testers' group.command 'testers:add <email> <name>', 'add a tester' group.command 'testers:remove <email> ', 'remove a tester' group.command 'testers:clear', 'remove all testers' group.command 'testers:notify <group>', 'notify testers about the latest build. group is optional.' group.space group.command 'groups', 'list groups' group.space group.command 'collaborators', 'list collaborators' group.command 'collaborators:add <email>', 'add collaborators' group.command 'collaborators:remove <email>','add collaborators' end end |
.group(title, &block) ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/appsendr/commands/help.rb', line 23 def self.group(title, &block) groups << begin group = HelpGroup.new(title) yield group group end end |
.groups ⇒ Object
19 20 21 |
# File 'lib/appsendr/commands/help.rb', line 19 def self.groups @groups ||= [] end |
Instance Method Details
#index ⇒ Object
62 63 64 |
# File 'lib/appsendr/commands/help.rb', line 62 def index display usage end |
#usage ⇒ Object
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/appsendr/commands/help.rb', line 70 def usage longest_command_length = self.class.groups.map do |group| group.map { |g| g.first.length } end.flatten.max self.class.groups.inject(StringIO.new) do |output, group| output.puts "=== %s" % group.title output.puts group.each do |command, description| if command.empty? output.puts else output.puts "%-*s # %s" % [longest_command_length, command, description] end end output.puts output end.string end |