Skip to content

Commit a07c686

Browse files
GaoJileavez
authored andcommitted
add inhibit_warnings_with_condition
1 parent ecf5909 commit a07c686

File tree

4 files changed

+43
-3
lines changed

4 files changed

+43
-3
lines changed

Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
cocoapods-developing-folder (0.0.1)
4+
cocoapods-developing-folder (0.0.4)
55

66
GEM
77
remote: https://rubygems.org/
@@ -92,4 +92,4 @@ DEPENDENCIES
9292
rake
9393

9494
BUNDLED WITH
95-
1.14.3
95+
1.16.0

lib/cocoapods-developing-folder/command/folder.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
module Pod
44
class Podfile
5+
56
def use_folders(*skipped_top_level_folder_names)
67
require 'cocoapods-developing-folder/command/preserve_folder.rb'
78
names_to_skip = []
@@ -11,5 +12,13 @@ def use_folders(*skipped_top_level_folder_names)
1112
end
1213
Pod.set_skipped_top_level_folder_names (names_to_skip or [])
1314
end
15+
16+
17+
def inhibit_warnings_with_condition(&condition)
18+
require 'cocoapods-developing-folder/command/inhibit_warnings_with_condition.rb'
19+
Pod.set_inhibit_waning_condition_block proc(&condition)
20+
Pod.inhibit_waning_condition_block.call("aaaaaa")
21+
end
22+
1423
end
1524
end
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
3+
module Pod
4+
def self.inhibit_waning_condition_block
5+
@inhibit_waning_condition_block
6+
end
7+
def self.set_inhibit_waning_condition_block(block)
8+
@inhibit_waning_condition_block = block
9+
end
10+
end
11+
12+
module Pod
13+
class PodTarget
14+
15+
# the original code
16+
# https://github.com/CocoaPods/CocoaPods/blob/93011ece10dd76b8d783bc80db742dfd03f7cbac/lib/cocoapods/target/pod_target.rb
17+
18+
# ---- patch ----
19+
old_method = instance_method(:inhibit_warnings?)
20+
21+
define_method(:inhibit_warnings?) do
22+
if Pod.inhibit_waning_condition_block == nil
23+
# return the original
24+
return old_method.bind(self).()
25+
else
26+
return Pod.inhibit_waning_condition_block.call(pod_name)
27+
end
28+
end
29+
30+
end
31+
end
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module CocoapodsDevelopingFolder
2-
VERSION = "0.0.3"
2+
VERSION = "0.0.4"
33
end

0 commit comments

Comments
 (0)