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::HELP_COMMAND

Constants inherited from Thor

Thor::DynamicTask, Thor::HELP_MAPPINGS, Thor::HiddenTask, 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, 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, package_name, 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


107
108
109
110
111
112
# File 'lib/github_cli/commands/teams.rb', line 107

def add_member(id, user)
  global_options = options.dup
  params = options[:params].dup
  Util.hash_without!(global_options, params.keys + ['params'])
  Team.add_member id, user, params, global_options
end

#add_repo(id, user, repo) ⇒ Object


150
151
152
153
154
155
# File 'lib/github_cli/commands/teams.rb', line 150

def add_repo(id, user, repo)
  global_options = options.dup
  params = options[:params].dup
  Util.hash_without!(global_options, params.keys + ['params'])
  Team.add_repo id, user, repo, params, global_options
end

#create(org) ⇒ Object


40
41
42
43
44
45
46
47
48
# File 'lib/github_cli/commands/teams.rb', line 40

def create(org)
  global_options = options.dup
  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]
  Util.hash_without!(global_options, params.keys + ['params'])
  Team.create org, params, global_options
end

#delete(id) ⇒ Object


77
78
79
80
81
82
# File 'lib/github_cli/commands/teams.rb', line 77

def delete(id)
  global_options = options.dup
  params = options[:params].dup
  Util.hash_without!(global_options, params.keys + ['params'])
  Team.delete id, params, global_options
end

#edit(id) ⇒ Object


64
65
66
67
68
69
70
71
# File 'lib/github_cli/commands/teams.rb', line 64

def edit(id)
  global_options = options.dup
  params = options[:params].dup
  params['name']       = options[:name]
  params['permission'] = options[:permission] if options[:permission]
  Util.hash_without!(global_options, params.keys + ['params'])
  Team.edit id, params, global_options
end

#get(id) ⇒ Object


17
18
19
20
21
22
# File 'lib/github_cli/commands/teams.rb', line 17

def get(id)
  global_options = options.dup
  params = options[:params].dup
  Util.hash_without!(global_options, params.keys + ['params'])
  Team.get id, params, global_options
end

#list(org) ⇒ Object


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

def list(org)
  global_options = options.dup
  params = options[:params].dup
  Util.hash_without!(global_options, params.keys + ['params'])
  Team.all org, params, global_options
end

#list_member(id) ⇒ Object


85
86
87
88
89
90
# File 'lib/github_cli/commands/teams.rb', line 85

def list_member(id)
  global_options = options.dup
  params = options[:params].dup
  Util.hash_without!(global_options, params.keys + ['params'])
  Team.all_member id, params, global_options
end

#list_repo(id) ⇒ Object


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

def list_repo(id)
  global_options = options.dup
  params = options[:params].dup
  Util.hash_without!(global_options, params.keys + ['params'])
  Team.all_repo id, params, global_options
end

#member(id, user) ⇒ Object


96
97
98
99
100
101
# File 'lib/github_cli/commands/teams.rb', line 96

def member(id, user)
  global_options = options.dup
  params = options[:params].dup
  Util.hash_without!(global_options, params.keys + ['params'])
  Team.member id, user, params, global_options
end

#remove_member(id, user) ⇒ Object


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

def remove_member(id, user)
  global_options = options.dup
  params = options[:params].dup
  Util.hash_without!(global_options, params.keys + ['params'])
  Team.remove_member id, user, params, global_options
end

#remove_repo(id, user, repo) ⇒ Object


163
164
165
166
167
168
# File 'lib/github_cli/commands/teams.rb', line 163

def remove_repo(id, user, repo)
  global_options = options.dup
  params = options[:params].dup
  Util.hash_without!(global_options, params.keys + ['params'])
  Team.remove_repo id, user, repo, params, global_options
end

#repo(id, user, repo) ⇒ Object


137
138
139
140
141
142
# File 'lib/github_cli/commands/teams.rb', line 137

def repo(id, user, repo)
  global_options = options.dup
  params = options[:params].dup
  Util.hash_without!(global_options, params.keys + ['params'])
  Team.repo id, user, repo, params, global_options
end