sigh 0.1.2 → 0.1.3

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: a11b1adf724af2b32581b6691097dda749a87e61
4
- data.tar.gz: 9593cec147e8343fe6ee233b40fdf0ca65de5cbe
3
+ metadata.gz: 6be74216863962899b4a31743764edf32b7b2bb0
4
+ data.tar.gz: 0896e0185563e8c63738b828bfd2cee9f4051072
5
5
  SHA512:
6
- metadata.gz: 5a12346f217fbd2b3939f618d970747179013f9ce330562fb9857c5c76c129f8d072c12f7e9e962eb6ccb5b51384a6f1539d7180d6e0337106ce3b8b2ea35487
7
- data.tar.gz: 32e1aad4fb9113258d8e404d3ea983292df2ae6a3f1585f016451fb9d182f2721b6bf27f3be4e4949f37b9907b7b0d61a8848bf441d073eb70b4ec725a6d01f9
6
+ metadata.gz: 35ceb603813de63a00ca7b7a48c1d894e9084bebb250dc3a7f3bd8a4f975d13d6ebb56f512d7b175b5bea4edbf9a33193dffabc0e3b7383bfa460f06ebb80662
7
+ data.tar.gz: b7af53aac592952283ef08943a5086e88cda433caf06d5dbbe798767d7a45e2ee517dcbef951219deb5c012ee2a23b42da907a2dee3b1a77738288b204f9c9c5
data/README.md CHANGED
@@ -21,7 +21,7 @@ Sigh
21
21
  [![Gem](https://img.shields.io/gem/v/sigh.svg?style=flat)](http://rubygems.org/gems/sigh)
22
22
 
23
23
 
24
- Tired of manually creating, renewing and downloading your provisioning profiles?
24
+ Tired of manually creating, renewing and downloading your iOS provisioning profiles?
25
25
 
26
26
  ```sigh``` handles all that for you. Just run ```sigh``` and it will do the rest.
27
27
 
@@ -52,10 +52,12 @@ Follow the developer on Twitter: [@KrauseFx](https://twitter.com/KrauseFx)
52
52
  - Support for **multiple Teams**
53
53
  - Support for Enterprise Profiles
54
54
 
55
+ To automate iOS Push profiles you can use [PEM](https://github.com/KrauseFx/PEM).
56
+
55
57
  ### Why not let Xcode do the work?
56
58
 
57
59
  - ```sigh``` can easily be integrated into your CI-server (e.g. Jenkins)
58
- - Xcode sometimes invalidates all existing profiles ([Proof](assets/SignErrors.png))
60
+ - Xcode sometimes invalidates all existing profiles ([Screenshot](assets/SignErrors.png))
59
61
  - You have control over what happens
60
62
  - You still get to have the signing files, which you can then use for your build scripts or store in git
61
63
 
@@ -164,7 +164,7 @@ module Sigh
164
164
  visit PROFILES_URL
165
165
  end
166
166
 
167
- @list_certs_url = page.html.match(/var profileDataURL = "(.*)"/)[1]
167
+ @list_certs_url = wait_for_variable('profileDataURL')
168
168
  # list_certs_url will look like this: "https://developer.apple.com/services-account/..../account/ios/profile/listProvisioningProfiles.action?content-type=application/x-www-form-urlencoded&accept=application/json&requestId=id&userLocale=en_US&teamId=xy&includeInactiveProfiles=true&onlyCountLists=true"
169
169
  Helper.log.info "Fetching all available provisioning profiles..."
170
170
 
@@ -351,9 +351,10 @@ module Sigh
351
351
  certs_url << "development" if type == DEVELOPMENT
352
352
  visit certs_url
353
353
 
354
- certificateDataURL = page.html.match(/var certificateDataURL = "(.*)"/)[1]
355
- certificateRequestTypes = page.html.match(/var certificateRequestTypes = "(.*)"/)[1]
356
- certificateStatuses = page.html.match(/var certificateStatuses = "(.*)"/)[1]
354
+ certificateDataURL = wait_for_variable('certificateDataURL')
355
+ certificateRequestTypes = wait_for_variable('certificateRequestTypes')
356
+ certificateStatuses = wait_for_variable('certificateStatuses')
357
+
357
358
  url = [certificateDataURL, certificateRequestTypes, certificateStatuses].join('')
358
359
 
359
360
  # https://developer.apple.com/services-account/.../account/ios/certificate/listCertRequests.action?content-type=application/x-www-form-urlencoded&accept=application/json&requestId=...&userLocale=en_US&teamId=...&types=...&status=4&certificateStatus=0&type=distribution
@@ -405,23 +406,37 @@ module Sigh
405
406
  system("open '#{path}'")
406
407
  end
407
408
 
408
- def wait_for_elements(name)
409
+ def wait_for(method, parameter, success)
409
410
  counter = 0
410
- results = all(name)
411
- while results.count == 0
412
- # Helper.log.debug "Waiting for #{name}"
411
+ result = method.call(parameter)
412
+ while !success.call(result)
413
413
  sleep 0.2
414
414
 
415
- results = all(name)
415
+ result = method.call(parameter)
416
416
 
417
417
  counter += 1
418
418
  if counter > 100
419
419
  Helper.log.debug page.html
420
420
  Helper.log.debug caller
421
- raise DeveloperCenterGeneralError.new("Couldn't find element '#{name}' after waiting for quite some time")
421
+ raise DeveloperCenterGeneralError.new("Couldn't find '#{name}' after waiting for quite some time")
422
422
  end
423
423
  end
424
- return results
424
+ return result
425
+ end
426
+
427
+ def wait_for_elements(name)
428
+ method = Proc.new { |n| all(name) }
429
+ success = Proc.new { |r| r.count > 0 }
430
+ return wait_for(method, name, success)
431
+ end
432
+
433
+ def wait_for_variable(name)
434
+ method = Proc.new { |n|
435
+ retval = page.html.match(/var #{n} = "(.*)"/)
436
+ retval[1] unless retval == nil
437
+ }
438
+ success = Proc.new { |r| r != nil }
439
+ return wait_for(method, name, success)
425
440
  end
426
441
  end
427
442
  end
@@ -1,3 +1,3 @@
1
1
  module Sigh
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sigh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-02 00:00:00.000000000 Z
11
+ date: 2014-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json