Class: GithubControl::Actions::Repositories
Instance Method Summary
collapse
#initialize, #options, register, set
Instance Method Details
#add_options(parser) ⇒ Object
6
7
8
9
10
|
# File 'lib/github-control/actions/repositories.rb', line 6
def add_options(parser)
parser.on("-U name", "--user name", "The user to list the repositories") do |user_name|
options[:user_name] = user_name
end
end
|
#call ⇒ Object
12
13
14
15
16
17
18
|
# File 'lib/github-control/actions/repositories.rb', line 12
def call
puts "Repositories for #{user.name}"
puts "-" * 40
user.repositories.each do |repo|
puts "- #{repo.name}"
end
end
|
#user ⇒ Object
20
21
22
|
# File 'lib/github-control/actions/repositories.rb', line 20
def user
@cli.console.user_for(options[:user_name] || @cli.console.current_user.name)
end
|