Class: GithubCLI::Commands::Issues
- Inherits:
-
GithubCLI::Command
- Object
- Thor
- GithubCLI::Command
- GithubCLI::Commands::Issues
- Defined in:
- lib/github_cli/commands/issues.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::MANPAGES, Thor::THOR_RESERVED_WORDS, Thor::Task, Thor::UndefinedTaskError, Thor::VERSION
Instance Attribute Summary
Attributes included from Thor::Actions
Attributes included from Thor::Base
#args, #options, #parent_options
Instance Method Summary collapse
- #create(user, repo) ⇒ Object
- #edit(user, repo, number) ⇒ Object
- #get(user, repo, number) ⇒ Object
- #list ⇒ Object
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
#create(user, repo) ⇒ Object
113 114 115 116 117 118 119 120 121 122 123 124 |
# File 'lib/github_cli/commands/issues.rb', line 113 def create(user, repo) = .dup params = [:params].dup params['title'] = [:title] params['body'] = [:body] if [:body] params['assignee'] = [:assignee] if [:assignee] params['milestone'] = [:milestone] if [:milestone] params['labels'] = [:labels] if [:labels] Util.hash_without!(, params.keys + ['params']) Issue.create user, repo, params, end |
#edit(user, repo, number) ⇒ Object
151 152 153 154 155 156 157 158 159 160 161 162 163 |
# File 'lib/github_cli/commands/issues.rb', line 151 def edit(user, repo, number) = .dup params = [:params].dup params['title'] = [:title] params['body'] = [:body] if [:body] params['assignee'] = [:assignee] if [:assignee] params['milestone'] = [:milestone] if [:milestone] params['labels'] = [:labels] if [:labels] params['state'] = [:state] if [:state] Util.hash_without!(, params.keys + ['params']) Issue.edit user, repo, number, params, end |
#get(user, repo, number) ⇒ Object
83 84 85 86 87 88 89 |
# File 'lib/github_cli/commands/issues.rb', line 83 def get(user, repo, number) = .dup params = [:params].dup Util.hash_without!(, params.keys + ['params']) Issue.get user, repo, number, params, end |
#list ⇒ Object
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/github_cli/commands/issues.rb', line 58 def list = .dup params = [:params].dup params['org'] = [:org] if [:org] params['user'] = [:user] if [:user] params['repo'] = [:repo] if [:repo] params['filter'] = [:filter] if [:filter] params['milestone'] = [:milestone] if [:milestone] params['assignee'] = [:assignee] if [:assignee] params['creator'] = [:creator] if [:creator] params['mentioned'] = [:mentioned] if [:mentioned] params['sort'] = [:sort] if [:sort] params['state'] = [:state] if [:state] params['labels'] = [:labels] if [:labels] params['direction'] = [:direction] if [:direction] params['since'] = [:since] if [:since] arg = [] arg = :user if ![:all] && !([:user] || [:org]) Util.hash_without!(, params.keys + ['params', 'all']) Issue.all arg, params, end |