spaceship 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 23f971e7d7b5ede6c4c93239d7ada418bbdf5481
4
- data.tar.gz: b51315f65436991606e46d58096f7a2f3bedd7e3
3
+ metadata.gz: 7cecb5ddd86fe2c720e348787497b72acf74a766
4
+ data.tar.gz: 4f97f971ebeb8c5a2d300c596725e5cac85da2f5
5
5
  SHA512:
6
- metadata.gz: 0d7fa284e26beb96cf3c097e947f7f7af7e04491c6a7e191e5c0e7406f2d0c85933ebcc496b319d97154ed08e4433d3bbb425881e56c215a835e3e59ca4dc726
7
- data.tar.gz: ee10e4b8fb198da08b65141c58f545e67d879e13b5debeeb4925855c929683e42f2abd0cca35fbd8ff5bad1cf54cd77ba8eb0a52c31c151805669c5eea1ce79f
6
+ metadata.gz: a267147f381f12a03e0877a715a91cc788c1cf7f509b1d68647c3bb885e0d32055721bf24b821472bf1bd170ac34ceb48d77a4318372404f548ea2a5b3af854d
7
+ data.tar.gz: aa8361be2622f0edec39c4fa8fd6611f3bc492b5e02c2e3483020f129ccd0c850be93b120ecc05e824198ea0dbe87c7a85bd87f2fb1c51df3686ecc961c8c828
@@ -71,14 +71,16 @@ module Spaceship
71
71
  # @param email (String) (required): The email of the new tester
72
72
  # @param first_name (String) (optional): The first name of the new tester
73
73
  # @param last_name (String) (optional): The last name of the new tester
74
+ # @param group (String) (optional): The name of the group this tester should be added to
74
75
  # @example
75
76
  # Spaceship::Tunes::Tester.external.create!(email: "tester@mathiascarignani.com", first_name: "Cary", last_name:"Bennett")
76
77
  # @return (Tester): The newly created tester
77
- def create!(email: nil, first_name: nil, last_name: nil)
78
+ def create!(email: nil, first_name: nil, last_name: nil, group: nil)
78
79
  data = client.create_tester!(tester: self,
79
80
  email: email,
80
81
  first_name: first_name,
81
- last_name: last_name)
82
+ last_name: last_name,
83
+ group: group)
82
84
  self.factory(data)
83
85
  end
84
86
 
@@ -252,13 +252,12 @@ module Spaceship
252
252
  parse_response(r, 'data')['users']
253
253
  end
254
254
 
255
- def create_tester!(tester: nil, email: nil, first_name: nil, last_name: nil)
255
+ # @param group (String) an optional group name
256
+ def create_tester!(tester: nil, email: nil, first_name: nil, last_name: nil, group: nil)
256
257
  url = tester.url[:create]
257
258
  raise "Action not provided for this tester type." unless url
258
259
 
259
- data = {
260
- testers: [
261
- {
260
+ tester_data = {
262
261
  emailAddress: {
263
262
  value: email
264
263
  },
@@ -272,8 +271,17 @@ module Spaceship
272
271
  value: true
273
272
  }
274
273
  }
275
- ]
276
- }
274
+
275
+ if group
276
+ tester_data[:groups] = [{
277
+ id: nil,
278
+ name: {
279
+ value: group
280
+ }
281
+ }]
282
+ end
283
+
284
+ data = { testers: [tester_data] }
277
285
 
278
286
  r = request(:post) do |req|
279
287
  req.url url
@@ -1,3 +1,3 @@
1
1
  module Spaceship
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spaceship
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Natchev