Method: NexusCli::RepositoryActions#repository_in_group?

Defined in:
lib/nexus_cli/mixins/repository_actions.rb

#repository_in_group?(group_id, repository_to_check) ⇒ Boolean

Checks if a the given [repository_to_check] is a member of the given group repository - [group_ip].

Parameters:

  • group_id (String)

    the group repository to look in

  • repository_to_check (String)

    the repository that might be a member of the group

Returns:

  • (Boolean)

    true if the [repository_to_check] is a member of group repository, false otherwise



118
119
120
121
122
123
# File 'lib/nexus_cli/mixins/repository_actions.rb', line 118

def repository_in_group?(group_id, repository_to_check)
  group_repository = JSON.parse(get_group_repository(group_id))
  repositories_in_group = group_repository["data"]["repositories"]

  repositories_in_group.find{|repository| repository["id"] == sanitize_for_id(repository_to_check)}
end