From 2ff3fb763a052e40f37c56787f029f6fce5143b9 Mon Sep 17 00:00:00 2001 From: Vitaliy Salnikov Date: Thu, 4 Jun 2020 18:53:20 +0300 Subject: [PATCH 1/2] Include numbers in build badge --- xcode/commonFastfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xcode/commonFastfile b/xcode/commonFastfile index 382a448..34bf137 100644 --- a/xcode/commonFastfile +++ b/xcode/commonFastfile @@ -87,7 +87,10 @@ end private_lane :addShield do |options| buildNumber = options[:buildNumber] - buildDescription = options[:xcconfig_name].scan(/\p{Upper}/)[1..2].join + buildDescription = options[:xcconfig_name] + .split(/(?=[A-Z])/) + .map { |v| v.gsub(/[[:lower:]]+/, "") }[1..2] + .join begin add_badge( From 4c3aea94a227a6a5df1590086f5aa0d4ed361158 Mon Sep 17 00:00:00 2001 From: Vitaliy Salnikov Date: Fri, 5 Jun 2020 14:14:25 +0300 Subject: [PATCH 2/2] Add comments to build badge description creation --- xcode/commonFastfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xcode/commonFastfile b/xcode/commonFastfile index 34bf137..ec84766 100644 --- a/xcode/commonFastfile +++ b/xcode/commonFastfile @@ -87,10 +87,10 @@ end private_lane :addShield do |options| buildNumber = options[:buildNumber] - buildDescription = options[:xcconfig_name] - .split(/(?=[A-Z])/) - .map { |v| v.gsub(/[[:lower:]]+/, "") }[1..2] - .join + buildDescription = options[:xcconfig_name] # EnterpriseCustomerDev1WithoutSSLPinningRelease + .split(/(?=[A-Z])/) # -> ["Enterprise", "Customer", "Dev1", "Without", "S", "S", "L", "Pinning", "Release"] + .map { |v| v.gsub(/[[:lower:]]+/, "") }[1..2] # -> ["E", "C", "D1", "W", "S", "S", "L", "P", "R"] -> ["C", "D1"] + .join # -> "CD1" begin add_badge(