Class: GithubCLI::Commands::Teams

Inherits:
GithubCLI::Command show all
Defined in:
lib/github_cli/commands/teams.rb

Constant Summary

Constants inherited from GithubCLI::Command

GithubCLI::Command::ALIASES, GithubCLI::Command::API_CLASSES, GithubCLI::Command::HELP_COMMAND

Constants inherited from Thor

Thor::DynamicTask, Thor::HELP_MAPPINGS, Thor::HiddenTask, Thor::MANPAGES, Thor::THOR_RESERVED_WORDS, Thor::Task, Thor::UndefinedTaskError, Thor::VERSION

Instance Attribute Summary

Attributes included from Thor::Actions

#behavior

Attributes included from Thor::Base

#args, #options, #parent_options

Instance Method Summary collapse

Methods inherited from GithubCLI::Command

all, api, banner, command_to_show, extract_namespace, is_api_command?, output_formats

Methods included from Thor::Actions

#action, #append_to_file, #apply, #chmod, #comment_lines, #copy_file, #create_file, #create_link, #destination_root, #destination_root=, #directory, #empty_directory, #find_in_source_paths, #gsub_file, #in_root, included, #initialize, #inject_into_class, #insert_into_file, #inside, #link_file, #prepend_to_file, #relative_to_original_destination_root, #remove_file, #run, #run_ruby_script, #source_paths, #template, #thor, #uncomment_lines

Methods inherited from Thor

check_unknown_options!, check_unknown_options?, command_help, default_command, desc, global_flags, handle_no_task_error, help, #help, long_desc, map, method_option, method_options, printable_commands, register, stop_on_unknown_option!, stop_on_unknown_option?, subcommand, subcommands

Methods included from Thor::Base

included, #initialize, register_klass_file, shell, shell=, subclass_files, subclasses

Instance Method Details

#add_member(id, user) ⇒ Object



90
91
92
# File 'lib/github_cli/commands/teams.rb', line 90

def add_member(id, user)
  Team.add_member id, user, options[:params], options[:format]
end

#add_repo(id, user, repo) ⇒ Object



121
122
123
# File 'lib/github_cli/commands/teams.rb', line 121

def add_repo(id, user, repo)
  Team.add_repo id, user, repo, options[:params], options[:format]
end

#create(org) ⇒ Object



34
35
36
37
38
39
40
41
# File 'lib/github_cli/commands/teams.rb', line 34

def create(org)
  params = options[:params].dup
  params['name'] = options[:name]
  params['repo_names'] = options[:repo_names] if options[:repo_names]
  params['permission'] = options[:permission] if options[:permission]

  Team.create org, params, options[:format]
end

#delete(id) ⇒ Object



69
70
71
# File 'lib/github_cli/commands/teams.rb', line 69

def delete(id)
  Team.delete id, options[:params], options[:format]
end

#edit(id) ⇒ Object



57
58
59
60
61
62
63
# File 'lib/github_cli/commands/teams.rb', line 57

def edit(id)
  params = options[:params].dup
  params['name'] = options[:name]
  params['permission'] = options[:permission] if options[:permission]

  Team.edit id, params, options[:format]
end

#get(id) ⇒ Object



14
15
16
# File 'lib/github_cli/commands/teams.rb', line 14

def get(id)
  Team.get id, options[:params], options[:format]
end

#list(org) ⇒ Object



9
10
11
# File 'lib/github_cli/commands/teams.rb', line 9

def list(org)
  Team.all org, options[:params], options[:format]
end

#list_member(id) ⇒ Object



74
75
76
# File 'lib/github_cli/commands/teams.rb', line 74

def list_member(id)
  Team.all_member id, options[:params], options[:format]
end

#list_repo(id) ⇒ Object



106
107
108
# File 'lib/github_cli/commands/teams.rb', line 106

def list_repo(id)
  Team.all_repo id, options[:params], options[:format]
end

#member(id, user) ⇒ Object



82
83
84
# File 'lib/github_cli/commands/teams.rb', line 82

def member(id, user)
  Team.member id, user, options[:params], options[:format]
end

#remove_member(id, user) ⇒ Object



101
102
103
# File 'lib/github_cli/commands/teams.rb', line 101

def remove_member(id, user)
  Team.remove_member id, user, options[:params], options[:format]
end

#remove_repo(id, user, repo) ⇒ Object



131
132
133
# File 'lib/github_cli/commands/teams.rb', line 131

def remove_repo(id, user, repo)
  Team.remove_repo id, user, repo, options[:params], options[:format]
end

#repo(id, user, repo) ⇒ Object



111
112
113
# File 'lib/github_cli/commands/teams.rb', line 111

def repo(id, user, repo)
  Team.repo id, user, repo, options[:params], options[:format]
end