slowlane 1.2.2 → 1.2.3

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: df099b47e27d5d21cf0229e67362d9569a53f974
4
- data.tar.gz: 50eeaf332affa659c7debf61bc0213e467ae36b9
3
+ metadata.gz: e4f5d6975c357ce1f0c7051270f0b7bd0dd25cf6
4
+ data.tar.gz: 9521140c4ada029ce321058d42d5353a1c65102d
5
5
  SHA512:
6
- metadata.gz: 5fdb38358eb5651c43b50aea138bb9dc17c9c8729ba5c117f9c1bb012ef904d4f03c4463cf2a7d48be9ffcf5e49c1e16db28bbf908e536683eed5563430516fe
7
- data.tar.gz: d2b3493de67c0dd42f857bda8e3aa38f9eec1568fd21ebf988632429d5250d0b4ac1a4ed902f3fa511d9e4d8e85c6390b4f91e379939d79a8791634ebdad2cfd
6
+ metadata.gz: 25532777751e2fdf3a5f413587494db4c388eb6e80a144742f3cea43ae63c80ea9be5f33e6544db0253d8e64ef0cbf1b307c1bea7ab22a617b8b9cb771ff1707
7
+ data.tar.gz: 447cf177bea9d587a122dc315f00a627918f732583e329fdb4c3f45fda040a477ccdbad2661edc02914f8defdc456856510b272aededd9aa57266e2678982cc6
data/README.md CHANGED
@@ -32,6 +32,7 @@ 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
36
  - 1.2.2: (portal) add_device to provisioning profile
36
37
  - 1.2.1: (fabric) list all devices
37
38
  - 1.2.0: (fabric) list testers, list devices of tester, list members
@@ -51,6 +51,38 @@ module Slowlane
51
51
  raise Error
52
52
  end
53
53
 
54
+ def post(uri, parameters = [], referer = nil, headers = {})
55
+ uri = ::File.join("https://#{self.host}", uri) unless /^https?/ === uri
56
+
57
+ #puts "Requesting: #{uri}"
58
+
59
+ unless (self.developer_token.nil?)
60
+ headers['X-CRASHLYTICS-DEVELOPER-TOKEN'] = self.developer_token
61
+ end
62
+
63
+ unless (self.access_token.nil?)
64
+ headers['X-CRASHLYTICS-ACCESS-TOKEN'] = self.access_token
65
+ end
66
+
67
+ unless (self.csrf_token.nil?)
68
+ headers['X-CSRF-Token'] = self.csrf_token
69
+ end
70
+
71
+ headers['X-Requested-With'] = 'XMLHttpRequest'
72
+ headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8'
73
+
74
+ # emails[]:patrick@smalltownheroes.be
75
+ 3.times do
76
+
77
+ agent.post(uri, parameters, headers)
78
+
79
+ return agent.page
80
+ end
81
+
82
+ #raise NetworkError
83
+ raise Error
84
+ end
85
+
54
86
  #
55
87
  # Handles login and CSRF tokens
56
88
  #
@@ -106,9 +138,9 @@ module Slowlane
106
138
  return members
107
139
  end
108
140
 
109
- def find_app_by_bundle_id(bundle_id)
141
+ def find_apps_by_bundle_id(bundle_id)
110
142
  apps = list_apps()
111
- apps.find { |app| app['bundle_identifier'] == bundle_id }
143
+ apps.select { |app| app['bundle_identifier'] == bundle_id }
112
144
  end
113
145
 
114
146
  def find_tester_by_email(email)
@@ -153,6 +185,29 @@ module Slowlane
153
185
 
154
186
  end
155
187
 
188
+ def tester_resend_invitation(app_id,email)
189
+ bootstrap
190
+
191
+ page = post("/api/v2/organizations/#{self.team_id}/apps/#{app_id}/beta_distribution/resend_invitation", {
192
+ "emails[]" => email
193
+ })
194
+ data = JSON.parse(page.body)
195
+ require 'pp'
196
+ pp data
197
+ end
198
+
199
+
200
+ def tester_invite(app_id,group_id,email)
201
+ bootstrap
202
+
203
+ page = post("/api/v2/organizations/#{self.team_id}/apps/#{app_id}/beta_distribution/groups/#{group_id}/testers/invite", {
204
+ "emails[]" => email
205
+ })
206
+ data = JSON.parse(page.body)
207
+ require 'pp'
208
+ pp data
209
+ end
210
+
156
211
  def list_tester_groups(tester_id)
157
212
  bootstrap
158
213
 
@@ -67,6 +67,36 @@ module Slowlane
67
67
 
68
68
  end
69
69
 
70
+ desc "resend_invitation", "invite tester with <email> to app with <bundle_id>"
71
+ def resend_invitation(email,bundle_id)
72
+ c=Utils.credentials(options)
73
+
74
+ fabric = Slowlane::Fabric::Client.new
75
+ fabric.username = c.username
76
+ fabric.password = c.password
77
+ fabric.team = Utils.team(options)
78
+
79
+ apps = fabric.find_apps_by_bundle_id(bundle_id)
80
+ apps.each do |app|
81
+ fabric.tester_resend_invitation(app['id'],email)
82
+ end
83
+ end
84
+
85
+ desc "invite", "invite tester with <email> to group <group_name>"
86
+ def invite(email,bundle_id)
87
+ c=Utils.credentials(options)
88
+
89
+ fabric = Slowlane::Fabric::Client.new
90
+ fabric.username = c.username
91
+ fabric.password = c.password
92
+ fabric.team = Utils.team(options)
93
+
94
+ apps = fabric.find_apps_by_bundle_id(bundle_id)
95
+ apps.each do |app|
96
+ fabric.tester_invite(app['id'],email)
97
+ end
98
+ end
99
+
70
100
  desc "devices", "get devices of tester <email>"
71
101
  def devices(email)
72
102
 
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.2"
5
+ s.version = "1.2.3"
6
6
  s.platform = Gem::Platform::RUBY
7
7
  s.license = 'MIT'
8
8
  s.authors = ["Patrick Debois"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slowlane
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Debois
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-17 00:00:00.000000000 Z
11
+ date: 2016-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor