Class: GithubCLI::Commands::Hooks
- Inherits:
-
GithubCLI::Command
- Object
- Thor
- GithubCLI::Command
- GithubCLI::Commands::Hooks
- Defined in:
- lib/github_cli/commands/hooks.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
Attributes included from Thor::Base
#args, #options, #parent_options
Instance Method Summary collapse
- #create(user, repo) ⇒ Object
- #delete(user, repo, id) ⇒ Object
- #edit(user, repo, id) ⇒ Object
- #get(user, repo, id) ⇒ Object
- #list(user, repo) ⇒ Object
- #test(user, repo, id) ⇒ Object
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
#create(user, repo) ⇒ Object
35 36 37 38 39 40 41 42 43 |
# File 'lib/github_cli/commands/hooks.rb', line 35 def create(user, repo) params = [:params].dup params['name'] = [:name] params['config'] = [:config] params['events'] = [:events] if [:events] params['active'] = [:active] if [:active] Hook.create user, repo, params, [:format] end |
#delete(user, repo, id) ⇒ Object
86 87 88 |
# File 'lib/github_cli/commands/hooks.rb', line 86 def delete(user, repo, id) Hook.delete user, repo, id, [:params], [:format] end |
#edit(user, repo, id) ⇒ Object
68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/github_cli/commands/hooks.rb', line 68 def edit(user, repo, id) params = [:params].dup params['name'] = [:name] params['config'] = [:config] params['events'] = [:events] if [:events] params['add_events'] = [:add_events] if [:add_events] params['remove_events'] = [:remove_events] if [:remove_events] params['active'] = [:active] if [:active] Hook.edit user, repo, id, params, [:format] end |
#get(user, repo, id) ⇒ Object
14 15 16 |
# File 'lib/github_cli/commands/hooks.rb', line 14 def get(user, repo, id) Hook.get user, repo, id, [:params], [:format] end |
#list(user, repo) ⇒ Object
9 10 11 |
# File 'lib/github_cli/commands/hooks.rb', line 9 def list(user, repo) Hook.all user, repo, [:params], [:format] end |
#test(user, repo, id) ⇒ Object
81 82 83 |
# File 'lib/github_cli/commands/hooks.rb', line 81 def test(user, repo, id) Hook.test user, repo, id, [:params], [:format] end |