cocoapods-ack_filter 0.0.1 → 0.0.2
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 +4 -4
- data/README.md +18 -0
- data/lib/cocoapods/ack_filter/version.rb +1 -1
- data/lib/pod/command/ack_filter.rb +20 -10
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e3121d72234207b0c876d5069d0ac48d4d437746
|
4
|
+
data.tar.gz: 6cb316801996565b1fa0ea7ecb12c1ace7f54966
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e13f001e555f2bd5b6ff3f2e368139ff13b678938ad4a281605298b5161c21162a1d4e34fcd77b6c795bd3b8f7e0e4e394b226a4d6809a709ad8b9ef5f4f7c1
|
7
|
+
data.tar.gz: 3dfdca779b407884ba36ba6ee5a3c2bbba951ffc96172891ec7f9925db17f6243099493bc7ec2da29a505f98db853a279c7645de67ecf0aa3f75eabc2e97ed2a
|
data/README.md
CHANGED
@@ -39,6 +39,24 @@ pod ack-filter MyCompany --output=Filtered.plist
|
|
39
39
|
# => Licenses which includes "MyCompany" are filtered out and output to "Filtered.plist"
|
40
40
|
```
|
41
41
|
|
42
|
+
Also, you can use ack_filter within Podfile.
|
43
|
+
|
44
|
+
```
|
45
|
+
post_install do
|
46
|
+
Pod::Command::AckFilter.filter(pattern: /MyCompany/, output: 'Filtered.plist')
|
47
|
+
end
|
48
|
+
```
|
49
|
+
|
50
|
+
For complex condition, you can use block to define filter.
|
51
|
+
|
52
|
+
```
|
53
|
+
post_install do
|
54
|
+
Pod::Command::AckFilter.filter(output: 'Filtered.plist') do |text|
|
55
|
+
text =~ /MyCompany/ && text !~ /Foobar/
|
56
|
+
end
|
57
|
+
end
|
58
|
+
```
|
59
|
+
|
42
60
|
## Contributing
|
43
61
|
|
44
62
|
1. Fork it ( https://github.com/[my-github-username]/cocoapods-ack_filter/fork )
|
@@ -12,21 +12,27 @@ module Pod
|
|
12
12
|
[['--output=FILENAME', 'Output filtered acknowledgements to FILENAME']]
|
13
13
|
end
|
14
14
|
|
15
|
-
def self.filter(
|
16
|
-
args
|
17
|
-
args << "--output=#{filename}" if filename
|
18
|
-
self.new(CLAide::ARGV.new(args)).run
|
15
|
+
def self.filter(args, &block)
|
16
|
+
self.new(args, &block).run
|
19
17
|
end
|
20
18
|
|
21
|
-
def initialize(argv)
|
22
|
-
|
23
|
-
|
24
|
-
|
19
|
+
def initialize(argv, &block)
|
20
|
+
if argv.kind_of?(CLAide::ARGV)
|
21
|
+
@pattern = Regexp.new(argv.shift_argument) unless argv.empty?
|
22
|
+
@filename = argv.option('output')
|
23
|
+
super
|
24
|
+
else
|
25
|
+
if argv[:pattern]
|
26
|
+
@pattern = argv[:pattern].kind_of?(Regexp) ? argv[:pattern] : Regexp.new(argv[:pattern])
|
27
|
+
end
|
28
|
+
@filename = argv[:output]
|
29
|
+
@filter_block = block
|
30
|
+
end
|
25
31
|
end
|
26
32
|
|
27
33
|
def validate!
|
28
34
|
super
|
29
|
-
help! 'Specify filtering pattern'
|
35
|
+
help! 'Specify filtering pattern' if !@pattern && !@filter_block
|
30
36
|
end
|
31
37
|
|
32
38
|
def output_filename
|
@@ -37,7 +43,11 @@ module Pod
|
|
37
43
|
plist = CFPropertyList::List.new(file: ACKNOWLEDGEMENTS_FILE)
|
38
44
|
specs = plist.value.value['PreferenceSpecifiers']
|
39
45
|
specs.value.reject! do |spec|
|
40
|
-
|
46
|
+
if @filter_block
|
47
|
+
@filter_block.call(spec.value['FooterText'].value)
|
48
|
+
else
|
49
|
+
spec.value['FooterText'].value =~ @pattern
|
50
|
+
end
|
41
51
|
end
|
42
52
|
plist.save(output_filename, CFPropertyList::List::FORMAT_XML)
|
43
53
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-ack_filter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yusuke Mito
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cocoapods
|