Class: SocialSnippet::CommandLine::SSpm::SubCommands::UpdateCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/social_snippet/command_line/sspm/sub_commands/update_command.rb

Instance Attribute Summary

Attributes inherited from Command

#args, #input_stream, #opt_parser, #options, #output_stream, #streams, #tokens

Instance Method Summary collapse

Methods inherited from Command

#define_option, #init, #initialize, #social_snippet

Constructor Details

This class inherits a constructor from SocialSnippet::CommandLine::Command

Instance Method Details

#define_optionsObject


22
23
# File 'lib/social_snippet/command_line/sspm/sub_commands/update_command.rb', line 22

def define_options
end

#descObject


18
19
20
# File 'lib/social_snippet/command_line/sspm/sub_commands/update_command.rb', line 18

def desc
  "Update repositories"
end

#runObject


25
26
27
28
29
30
31
32
33
# File 'lib/social_snippet/command_line/sspm/sub_commands/update_command.rb', line 25

def run
  if has_next_token?
    while has_next_token?
      social_snippet.api.update_repository next_token, options
    end
  else
    social_snippet.api.update_all_repositories options
  end
end

#usageObject


5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/social_snippet/command_line/sspm/sub_commands/update_command.rb', line 5

def usage
  <<EOF
Usage: sspm update [options] [--] [<repo> ...]

Examples:
$ sspm update
-> Update all installed repositories

$ sspm update example-repo
-> Update example-repo and Install missing dependencies
EOF
end