spaceship/lib/spaceship/test_flight/client.rb in fastlane-2.28.3 vs spaceship/lib/spaceship/test_flight/client.rb in fastlane-2.28.4

- old
+ new

@@ -18,10 +18,24 @@ response = request(:get, "providers/#{team_id}/apps/#{app_id}/platforms/#{platform}/trains/#{train_version}/builds") handle_response(response) end + def testers_for_app(app_id: nil) + assert_required_params(__method__, binding) + url = "providers/#{team_id}/apps/#{app_id}/testers" + response = request(:get, url) + handle_response(response) + end + + def delete_tester_from_app(app_id: nil, tester_id: nil) + assert_required_params(__method__, binding) + url = "providers/#{team_id}/apps/#{app_id}/testers/#{tester_id}" + response = request(:delete, url) + handle_response(response) + end + def post_tester(app_id: nil, tester: nil) assert_required_params(__method__, binding) url = "providers/#{team_id}/apps/#{app_id}/testers" response = request(:post) do |req| req.url url @@ -126,14 +140,22 @@ # used to assert all of the named parameters are supplied values # # @raises NameError if the values are nil def assert_required_params(method_name, binding) - parameter_names = Hash[method(method_name).parameters].values + parameter_names = method(method_name).parameters.map { |k, v| v } parameter_names.each do |name| - if binding.local_variable_get(name).nil? + if local_variable_get(binding, name).nil? raise NameError, "`#{name}' is a required parameter" end + end + end + + def local_variable_get(binding, name) + if binding.respond_to?(:local_variable_get) + binding.local_variable_get(name) + else + binding.eval(name.to_s) end end end end