refinement 0.5.0 → 0.6.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
  SHA256:
3
- metadata.gz: 3f99f7e0933bae18ddd8c4f6fbd14f3e182f6233a1244b1418ccf678b5c1e471
4
- data.tar.gz: 451abebd764ff651e9489095bca0ce0fc4043965e81e962ca49df68e90341367
3
+ metadata.gz: bc6b7da6738a2abb9d51bbb8b07333f370ef7f819307217e01cee42cde2b4ea4
4
+ data.tar.gz: bf21a6db5de7f51904296972c4e45f27b8853b5751ec31705d7d3e45d2d7f80f
5
5
  SHA512:
6
- metadata.gz: 6f8348156cedae83212560898d95229be93c592347e052a82bd5a1bd3b13d76a7298703976f4e93799cd8d38543316409462d9c6ef564e1680bdde746bf084aa
7
- data.tar.gz: 1109c4b167045b0a2ac2ba45aa036ec6b3d4aacf06726be393c68fe072ee49479d61d41c89a6a29ad927b1e419a3e7932f82acba25ccf02fe4a08efc0a8aaae6
6
+ metadata.gz: 7333b23a303b68863872011b638d1bab86fb29ea56dd244a33e194873e0c90c4969a1340636c2a80bcee4d0f141b5f12003d038e21ecd10f566e3590d14e63a1
7
+ data.tar.gz: 024b7afb50f77256b0b399c3c349a3cd2abb92eeda59e51a4dfd1c3a80a757e1901937417e64471be04282470c692489ba10ec23482c72618f8e6e3fa9ec9c8d
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.0
1
+ 0.6.0
@@ -57,9 +57,10 @@ module Refinement
57
57
  # `:building` and `:testing`, with the only difference being `BuildActionEntry` are not
58
58
  # filtered out when building for testing, since test action macro expansion could
59
59
  # depend on a build entry being present.
60
- # @return [Xcodeproj::XCScheme] a scheme whose unchanged targets have been removed
60
+ # @param each_target [Proc] A proc called each time a target was determined to have changed or not.
61
+ # @return [Xcodeproj::XCScheme] a scheme whose unchanged targets have been removed.
61
62
  def filtered_scheme(scheme_path:, change_level: :full_transitive, filter_when_scheme_has_changed: false, log_changes: false,
62
- filter_scheme_for_build_action:)
63
+ filter_scheme_for_build_action:, each_target: nil)
63
64
  scheme = Xcodeproj::XCScheme.new(scheme_path)
64
65
 
65
66
  sections_to_filter =
@@ -93,9 +94,11 @@ module Refinement
93
94
  suite_name = buildable_reference.attributes['BlueprintName']
94
95
  if (change_reason = changes_by_suite_name[suite_name])
95
96
  puts "#{suite_name} changed because #{change_reason}" if log_changes
97
+ each_target&.call(type: :changed, target_name: suite_name, change_reason: change_reason)
96
98
  next
97
99
  end
98
100
  puts "#{suite_name} did not change, removing from scheme" if log_changes
101
+ each_target&.call(type: :unchanged, target_name: suite_name, change_reason: nil)
99
102
  buildable_reference.parent.remove
100
103
  end
101
104
  end
@@ -105,9 +108,11 @@ module Refinement
105
108
  suite_name = buildable_reference.attributes['BlueprintName']
106
109
  if (change_reason = changes_by_suite_name[suite_name])
107
110
  puts "#{suite_name} changed because #{change_reason}" if log_changes
111
+ each_target&.call(type: :changed, target_name: suite_name, change_reason: change_reason)
108
112
  next
109
113
  end
110
114
  puts "#{suite_name} did not change, setting to not build for testing" if log_changes
115
+ each_target&.call(type: :unchanged, target_name: suite_name, change_reason: nil)
111
116
  buildable_reference.parent.attributes['buildForTesting'] = 'NO'
112
117
  end
113
118
  end
@@ -89,7 +89,7 @@ module Refinement
89
89
  pattern = pattern.gsub('/**/', '{/**/,/}')
90
90
  values_by_set = {}
91
91
  pattern.scan(/\{[^}]*\}/) do |set|
92
- values = set.gsub(/[{}]/, '').split(',')
92
+ values = set.gsub(/[{}]/, '').split(',', -1)
93
93
  values_by_set[set] = values
94
94
  end
95
95
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refinement
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Giddins
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-08-17 00:00:00.000000000 Z
11
+ date: 2021-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xcodeproj