Merge pull request #9 from psyreactor/develop

Fix groups parameter validation
This commit is contained in:
Psyreactor 2020-09-08 20:03:24 -03:00 committed by GitHub
commit 85f07d2ec6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 5 deletions

View File

@ -4,6 +4,11 @@
Please see: https://github.com/psyreactor/sonarqube-ruby/releases Please see: https://github.com/psyreactor/sonarqube-ruby/releases
### 1.2.1 (08/09/2020)
- Fix
* Fix groups parameter validation
### 1.2.0 (03/09/2020) ### 1.2.0 (03/09/2020)
- New features - New features

View File

@ -10,7 +10,7 @@
[documentation](https://www.rubydoc.info/gems/sonarqube/frames) [documentation](https://www.rubydoc.info/gems/sonarqube/frames)
Sonarqube is a Ruby wrapper and CLI for the Sonarqube API Sonarqube is a Ruby wrapper and CLI for the Sonarqube API
As of version `1.2.0` this gem only supports Sonarqube 7.9. As of version `1.2.1` this gem only supports Sonarqube 7.9.
## Installation ## Installation

View File

@ -63,7 +63,7 @@ group = Sonarqube.add_member('AXQRcKrW9pRiZzanEJ2E', 'test-user')
# => #<Sonarqube::ObjectifiedHash:46220 {hash: {}} # => #<Sonarqube::ObjectifiedHash:46220 {hash: {}}
group.to_hash.empty? group.to_hash.empty?
# => true # => true
group = Sonarqube.add_member('AXQRcKrW9pRiZzanEJ2E', 'test-user', {name: 'sonar-groups'}) group = Sonarqube.add_member(nil, 'test-user', {name: 'sonar-groups'})
# => #<Sonarqube::ObjectifiedHash:46220 {hash: {}} # => #<Sonarqube::ObjectifiedHash:46220 {hash: {}}
group.to_hash.empty? group.to_hash.empty?
# => true # => true

View File

@ -79,7 +79,7 @@ class Sonarqube::Client
# @option options [String] :name Optional name of group. # @option options [String] :name Optional name of group.
# @return [Sonarqube::ObjectifiedHash] # @return [Sonarqube::ObjectifiedHash]
def add_member(id = nil, login = nil, options = {}) def add_member(id = nil, login = nil, options = {})
raise ArgumentError, 'Missing required parameters' if id.nil? || login.nil? raise ArgumentError, 'Missing required parameters' if id.nil? && login.nil?
post('/api/user_groups/add_user', body: { id: id, login: login }.merge!(options)) post('/api/user_groups/add_user', body: { id: id, login: login }.merge!(options))
end end
@ -97,7 +97,7 @@ class Sonarqube::Client
# @option options [String] :name Optional name of group. # @option options [String] :name Optional name of group.
# @return [Sonarqube::ObjectifiedHash] # @return [Sonarqube::ObjectifiedHash]
def remove_member(id = nil, login = nil, options = {}) def remove_member(id = nil, login = nil, options = {})
raise ArgumentError, 'Missing required parameters' if id.nil? || login.nil? raise ArgumentError, 'Missing required parameters' if id.nil? && login.nil?
post('/api/user_groups/remove_user', body: { id: id, login: login }.merge!(options)) post('/api/user_groups/remove_user', body: { id: id, login: login }.merge!(options))
end end

View File

@ -1,5 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
module Sonarqube module Sonarqube
VERSION = '1.2.0' VERSION = '1.2.1'
end end