diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f3a759..b4ad721 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ 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) - New features diff --git a/README.md b/README.md index 8319d7b..4e6c20d 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ [documentation](https://www.rubydoc.info/gems/sonarqube/frames) 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 diff --git a/docs/client/groups.markdown b/docs/client/groups.markdown index 7896adb..d2947aa 100644 --- a/docs/client/groups.markdown +++ b/docs/client/groups.markdown @@ -63,7 +63,7 @@ group = Sonarqube.add_member('AXQRcKrW9pRiZzanEJ2E', 'test-user') # => # true -group = Sonarqube.add_member('AXQRcKrW9pRiZzanEJ2E', 'test-user', {name: 'sonar-groups'}) +group = Sonarqube.add_member(nil, 'test-user', {name: 'sonar-groups'}) # => # true diff --git a/lib/sonarqube/client/groups.rb b/lib/sonarqube/client/groups.rb index 0c913a5..15a263c 100644 --- a/lib/sonarqube/client/groups.rb +++ b/lib/sonarqube/client/groups.rb @@ -79,7 +79,7 @@ class Sonarqube::Client # @option options [String] :name Optional name of group. # @return [Sonarqube::ObjectifiedHash] 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)) end @@ -97,7 +97,7 @@ class Sonarqube::Client # @option options [String] :name Optional name of group. # @return [Sonarqube::ObjectifiedHash] 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)) end diff --git a/lib/sonarqube/version.rb b/lib/sonarqube/version.rb index 534bab2..aa86a51 100644 --- a/lib/sonarqube/version.rb +++ b/lib/sonarqube/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Sonarqube - VERSION = '1.2.0' + VERSION = '1.2.1' end