slowlane 1.2.3 → 1.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e4f5d6975c357ce1f0c7051270f0b7bd0dd25cf6
4
- data.tar.gz: 9521140c4ada029ce321058d42d5353a1c65102d
3
+ metadata.gz: 05ed49cc155293caa7a07b5487a7776da249ea78
4
+ data.tar.gz: 7e81ebf6935878f9adb2135cfc67e3a9150c4ac9
5
5
  SHA512:
6
- metadata.gz: 25532777751e2fdf3a5f413587494db4c388eb6e80a144742f3cea43ae63c80ea9be5f33e6544db0253d8e64ef0cbf1b307c1bea7ab22a617b8b9cb771ff1707
7
- data.tar.gz: 447cf177bea9d587a122dc315f00a627918f732583e329fdb4c3f45fda040a477ccdbad2661edc02914f8defdc456856510b272aededd9aa57266e2678982cc6
6
+ metadata.gz: 72319bb6909807e4fc3f08d80256f514eeac05f2558246c07d0d66e759f1cb271750108ab5792ee726f68ec30fbd687e0f8d82cc31c6da6389597ec09e396942
7
+ data.tar.gz: 1d6b12ae04279ab1769ca61654e1763f8962d474c275fb570e4882e3c291049044568ef1f16b95f898bcbb5b5926120a91acdf17133c9089eb010917f2e95978
data/README.md CHANGED
@@ -32,7 +32,8 @@ results in binaries:
32
32
  - `slowlane-ipa` (NOTE: this might change to a more generic `slowlane-ios` command)
33
33
 
34
34
  ## Changes
35
- - 1.2.3: (fabric) invite and resend_invitation tester
35
+ - 1.2.4: (fabric) invite tester
36
+ - 1.2.3: (fabric) resend_invitation tester
36
37
  - 1.2.2: (portal) add_device to provisioning profile
37
38
  - 1.2.1: (fabric) list all devices
38
39
  - 1.2.0: (fabric) list testers, list devices of tester, list members
@@ -83,6 +84,8 @@ results in binaries:
83
84
  - `slowlane-fabric tester list`
84
85
  - `slowlane-fabric device list`
85
86
  - `slowlane-fabric tester devices <email>`
87
+ - `slowlane-fabric tester resend_invitation <email> <bundle_id>`
88
+ - `slowlane-fabric tester invite <email> <bundle_id> <group_name>`
86
89
  - `slowlane-fabric organization list`
87
90
  - `slowlane-fabric member list`
88
91
 
@@ -83,6 +83,37 @@ module Slowlane
83
83
  raise Error
84
84
  end
85
85
 
86
+ def put(uri, parameters = [], referer = nil, headers = {})
87
+ uri = ::File.join("https://#{self.host}", uri) unless /^https?/ === uri
88
+
89
+ #puts "Requesting: #{uri}"
90
+
91
+ unless (self.developer_token.nil?)
92
+ headers['X-CRASHLYTICS-DEVELOPER-TOKEN'] = self.developer_token
93
+ end
94
+
95
+ unless (self.access_token.nil?)
96
+ headers['X-CRASHLYTICS-ACCESS-TOKEN'] = self.access_token
97
+ end
98
+
99
+ unless (self.csrf_token.nil?)
100
+ headers['X-CSRF-Token'] = self.csrf_token
101
+ end
102
+
103
+ headers['X-Requested-With'] = 'XMLHttpRequest'
104
+ headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8'
105
+
106
+ 3.times do
107
+
108
+ agent.put(uri, parameters, headers)
109
+
110
+ return agent.page
111
+ end
112
+
113
+ #raise NetworkError
114
+ raise Error
115
+ end
116
+
86
117
  #
87
118
  # Handles login and CSRF tokens
88
119
  #
@@ -138,6 +169,21 @@ module Slowlane
138
169
  return members
139
170
  end
140
171
 
172
+ def find_group_by_name(name)
173
+ testers = list_testers()
174
+ testers.each do |tester|
175
+ groups=tester['groups']
176
+ groups.each do |group|
177
+ #puts group['name']
178
+ if group['name'] == name
179
+ return group
180
+ end
181
+ end
182
+ end
183
+ return nil
184
+
185
+ end
186
+
141
187
  def find_apps_by_bundle_id(bundle_id)
142
188
  apps = list_apps()
143
189
  apps.select { |app| app['bundle_identifier'] == bundle_id }
@@ -200,9 +246,8 @@ module Slowlane
200
246
  def tester_invite(app_id,group_id,email)
201
247
  bootstrap
202
248
 
203
- page = post("/api/v2/organizations/#{self.team_id}/apps/#{app_id}/beta_distribution/groups/#{group_id}/testers/invite", {
204
- "emails[]" => email
205
- })
249
+ input = URI.encode_www_form( "emails[]" => email)
250
+ page = put("/api/v2/organizations/#{self.team_id}/apps/#{app_id}/beta_distribution/groups/#{group_id}/testers/invite", input)
206
251
  data = JSON.parse(page.body)
207
252
  require 'pp'
208
253
  pp data
@@ -82,8 +82,8 @@ module Slowlane
82
82
  end
83
83
  end
84
84
 
85
- desc "invite", "invite tester with <email> to group <group_name>"
86
- def invite(email,bundle_id)
85
+ desc "invite", "invite tester with <email> to <bundle_id> in group <group_name>"
86
+ def invite(email,bundle_id,group_name)
87
87
  c=Utils.credentials(options)
88
88
 
89
89
  fabric = Slowlane::Fabric::Client.new
@@ -91,9 +91,11 @@ module Slowlane
91
91
  fabric.password = c.password
92
92
  fabric.team = Utils.team(options)
93
93
 
94
+ group = fabric.find_group_by_name(group_name)
95
+
94
96
  apps = fabric.find_apps_by_bundle_id(bundle_id)
95
97
  apps.each do |app|
96
- fabric.tester_invite(app['id'],email)
98
+ fabric.tester_invite(app['id'],group['id'],email)
97
99
  end
98
100
  end
99
101
 
data/slowlane.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "slowlane"
5
- s.version = "1.2.3"
5
+ s.version = "1.2.4"
6
6
  s.platform = Gem::Platform::RUBY
7
7
  s.license = 'MIT'
8
8
  s.authors = ["Patrick Debois"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slowlane
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.3
4
+ version: 1.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Debois