match 0.2.5 → 0.3.0

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: 54d0caad76c482f80450aedc80b68b88b6b8fa51
4
- data.tar.gz: dcedc940caf37ecfe77c1c3c26cd38d7b34c5725
3
+ metadata.gz: 3955b373eb0b95aaee3f8972276ee7efa05a3359
4
+ data.tar.gz: 0e7a0ae52d3274adf5c5a00c8d759a1a49a811c4
5
5
  SHA512:
6
- metadata.gz: dca86d78e968958ebaec5c53ab53b0e936f17251255a853e504d6646a14b39c74fe49d9f70ded06ca93f9a85a94c227f02b9f6ffebb5596ea90581f3ff29a676
7
- data.tar.gz: 8fc7408f1bc350f74f5ce8131a6431e1f69aecea56bd6995d450f3d65fd402516620f039eb1e38ac81c8e19d04cc7174355ed46fdb1c508f6711fa8a66435c41
6
+ metadata.gz: 5c22c2f2a336cae9181d48802838f66fe956d66943e2b9e0dca3d31effe76161a91cada588b03745bd35d669959a2a675e8a2cd0030527617c3d79bede2d9212
7
+ data.tar.gz: b85f1a297f9268c8717cfd72a71e76c2cf2d31df224130ba1a7269c57025ea8f5340ffd3892023143b74c6416a1ab7df1b6fc130657f49665511d28520f8fd2f
data/README.md CHANGED
@@ -358,6 +358,9 @@ Because of the potentially dangerous nature of In-House profiles we decided to n
358
358
  # Need help?
359
359
  Please submit an issue on GitHub and provide information about your setup
360
360
 
361
+ # Code of Conduct
362
+ Help us keep `match` open and inclusive. Please read and follow our [Code of Conduct](https://github.com/fastlane/code-of-conduct).
363
+
361
364
  # License
362
365
  This project is licensed under the terms of the MIT license. See the LICENSE file.
363
366
 
data/lib/match/encrypt.rb CHANGED
@@ -85,7 +85,7 @@ module Match
85
85
  command << "&> /dev/null" unless $verbose # to show show an error message is something goes wrong
86
86
  success = system(command.join(' '))
87
87
 
88
- raise "Error decrypting '#{path}'" unless success
88
+ UI.crash!("Error decrypting '#{path}'") unless success
89
89
  FileUtils.mv(tmpfile, path)
90
90
  end
91
91
  end
@@ -12,7 +12,7 @@ module Match
12
12
  print_all: $verbose,
13
13
  print_command: $verbose)
14
14
 
15
- raise "Error cloning repo, make sure you have access to it '#{git_url}'".red unless File.directory?(@dir)
15
+ UI.user_error!("Error cloning repo, make sure you have access to it '#{git_url}'") unless File.directory?(@dir)
16
16
 
17
17
  if !Helper.test? and GitHelper.match_version(@dir).nil? and manual_password.nil? and File.exist?(File.join(@dir, "README.md"))
18
18
  UI.important "Migrating to new match..."
data/lib/match/options.rb CHANGED
@@ -21,7 +21,7 @@ module Match
21
21
  default_value: 'development',
22
22
  verify_block: proc do |value|
23
23
  unless Match.environments.include?(value)
24
- raise "Unsupported environment #{value}, must be in #{Match.environments.join(', ')}".red
24
+ UI.user_error!("Unsupported environment #{value}, must be in #{Match.environments.join(', ')}")
25
25
  end
26
26
  end),
27
27
  FastlaneCore::ConfigItem.new(key: :app_identifier,
@@ -87,11 +87,16 @@ module Match
87
87
  if value.start_with?("/var/folders") or value.include?("tmp/") or value.include?("temp/")
88
88
  # that's fine
89
89
  else
90
- raise "Specify the `git_url` instead of the `path`".red
90
+ UI.user_error!("Specify the `git_url` instead of the `path`")
91
91
  end
92
92
  end
93
93
  end,
94
- optional: true)
94
+ optional: true),
95
+ FastlaneCore::ConfigItem.new(key: :force_for_new_devices,
96
+ env_name: "MATCH_FORCE_FOR_NEW_DEVICES",
97
+ description: "Renew the provisioning profiles if the device count on the developer portal has changed",
98
+ is_string: false,
99
+ default_value: false)
95
100
  ]
96
101
  end
97
102
  end
data/lib/match/runner.rb CHANGED
@@ -74,6 +74,11 @@ module Match
74
74
 
75
75
  # Install the provisioning profiles
76
76
  profile = profiles.last
77
+
78
+ if params[:force_for_new_devices]
79
+ params[:force] = device_count_different?(profile: profile) unless params[:force]
80
+ end
81
+
77
82
  if profile.nil? or params[:force]
78
83
  UI.crash!("No matching provisioning profiles found and can not create a new one because you enabled `readonly`") if params[:readonly]
79
84
  profile = Generator.generate_provisioning_profile(params: params,
@@ -90,5 +95,20 @@ module Match
90
95
 
91
96
  return uuid
92
97
  end
98
+
99
+ def device_count_different?(profile: nil)
100
+ if profile
101
+ parsed = FastlaneCore::ProvisioningProfile.parse(profile)
102
+ uuid = parsed["UUID"]
103
+ portal_profile = Spaceship.provisioning_profile.all.detect { |i| i.uuid == uuid }
104
+
105
+ if portal_profile
106
+ profile_device_count = portal_profile.devices.count
107
+ portal_device_count = Spaceship.device.all.count
108
+ return portal_device_count != profile_device_count
109
+ end
110
+ end
111
+ return false
112
+ end
93
113
  end
94
114
  end
data/lib/match/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Match
2
- VERSION = "0.2.5"
2
+ VERSION = "0.3.0"
3
3
  DESCRIPTION = "Easily sync your certificates and profiles across your team using git"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: match
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-21 00:00:00.000000000 Z
11
+ date: 2016-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: security
@@ -30,7 +30,7 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.35.0
33
+ version: 0.36.1
34
34
  - - "<"
35
35
  - !ruby/object:Gem::Version
36
36
  version: 1.0.0
@@ -40,7 +40,7 @@ dependencies:
40
40
  requirements:
41
41
  - - ">="
42
42
  - !ruby/object:Gem::Version
43
- version: 0.35.0
43
+ version: 0.36.1
44
44
  - - "<"
45
45
  - !ruby/object:Gem::Version
46
46
  version: 1.0.0
@@ -242,14 +242,14 @@ dependencies:
242
242
  requirements:
243
243
  - - "~>"
244
244
  - !ruby/object:Gem::Version
245
- version: '0.34'
245
+ version: 0.35.1
246
246
  type: :development
247
247
  prerelease: false
248
248
  version_requirements: !ruby/object:Gem::Requirement
249
249
  requirements:
250
250
  - - "~>"
251
251
  - !ruby/object:Gem::Version
252
- version: '0.34'
252
+ version: 0.35.1
253
253
  description: Easily sync your certificates and profiles across your team using git
254
254
  email:
255
255
  - match@krausefx.com