cocoapods-whitelist 0.0.4 → 0.0.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 275a7b9b2d3314e417857aaef959a015d1310ffc
4
- data.tar.gz: 96eded8cd786a390e197a635f9ddc4f91649d52c
3
+ metadata.gz: 750058d7d825d9b61916a46ea50350581cfe3518
4
+ data.tar.gz: 270b1db1faf90555f31e4c43c655b1d7494ce650
5
5
  SHA512:
6
- metadata.gz: 9256c19ff3486cc5deddd8a99dabfcd2e7daa07d20fe72d51c0be2243032c849bb7b867da1e0b4d15d8c46760c7d1acebdde830305a858bff3c6b4cfe876a81d
7
- data.tar.gz: 32a6eb3d057689dda39056cb8293a87560f2511899cbf7f38e3cc97c9d95f6c992a6f7b46523f79d44a43c7d98a610eec38dfcffc9a7178cc0d0cadaf272b9e6
6
+ metadata.gz: 63a7cdc92b231d590dcc66ccbd8e41f1c167da2147c7c041f009bc3da783c76f5ce6f892300c4d90b3b918ffeca0ed63d57214da7ccf1dfd6e7cc9489ee8f418
7
+ data.tar.gz: 2b4debab422c070ed134a2eddaa366b36004eeb2c1b2354007922070bb0864aede76215580ffd7da0923dc84ca07a94929879aa464a5a1a6b3c887cf887783d7
@@ -1,3 +1,9 @@
1
+ ## 0.0.7
2
+ - Add `outfile` parameter
3
+
4
+ ## 0.0.4
5
+ - Use Regex to validate dependency names
6
+
1
7
  ## 0.0.3
2
8
  - Improve error messages
3
9
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cocoapods-whitelist (0.0.3)
4
+ cocoapods-whitelist (0.0.6)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -21,12 +21,14 @@ module Pod
21
21
 
22
22
  self.arguments = [ CLAide::Argument.new('config', false),
23
23
  CLAide::Argument.new('podspec', false),
24
- CLAide::Argument.new('fail-on-error', false) ]
24
+ CLAide::Argument.new('fail-on-error', false),
25
+ CLAide::Argument.new('outfile', false) ]
25
26
 
26
27
  def self.options
27
28
  [ ['--config=CONFIG', 'Config file or URL for the blacklist'],
28
29
  ['--podspec=PODSPEC', 'Podspec file to be lint'],
29
- ['--fail-on-error', 'Raise an exception in case of error']
30
+ ['--fail-on-error', 'Raise an exception in case of error'],
31
+ ['--outfile=PATH', 'Output the linter results to a file']
30
32
  ].concat(super)
31
33
  end
32
34
 
@@ -34,6 +36,7 @@ module Pod
34
36
  @whitelist_url = argv ? argv.option('config', DEFAULT_WHITELIST_URL) : DEFAULT_WHITELIST_URL
35
37
  @pospec_path = argv ? argv.option('podspec') : nil
36
38
  @fail_on_error = argv ? argv.flag?('fail-on-error') : false
39
+ @outfile = argv ? argv.option('outfile') : nil
37
40
  @failure = false
38
41
  super
39
42
  end
@@ -43,6 +46,7 @@ module Pod
43
46
  end
44
47
 
45
48
  def run
49
+ prepare_outfile
46
50
  whitelist = get_whitelist
47
51
  specifications = get_podspec_specifications
48
52
 
@@ -61,17 +65,16 @@ module Pod
61
65
  def show_result_message
62
66
  return unless @failure
63
67
  message = "Please check your dependencies.\nYou can see the allowed dependencies at #{@whitelist_url}"
68
+ show_error_message(message)
64
69
  if @fail_on_error
65
- raise Informative.new(message)
66
- else
67
- UI.puts message.yellow
70
+ raise Informative.new()
68
71
  end
69
72
  end
70
73
 
71
74
  # Checks the dependencies the project contains are in the whitelist
72
75
  def validate_dependencies(podspec, whitelist, parentName = nil)
73
76
  pod_name = parentName ? "#{parentName}/#{podspec['name']}" : podspec['name']
74
- UI.puts "Verifying dependencies in #{pod_name}"
77
+ UI.puts "Verifying dependencies in #{pod_name}".green
75
78
 
76
79
  dependencies = podspec["dependencies"] ? podspec["dependencies"] : []
77
80
  not_allowed = []
@@ -143,13 +146,30 @@ module Pod
143
146
  return podspecs.map { |path| Pod::Specification.from_file(path) }
144
147
  end
145
148
 
146
- def show_error_message(message)
149
+ def show_error_message(message)
150
+ unless @outfile == nil
151
+ IO.write(@outfile, "#{message}\n", mode: 'a')
152
+ end
153
+
147
154
  if @fail_on_error
148
155
  UI.puts message.red
149
156
  else
150
157
  UI.puts message.yellow
151
158
  end
152
159
  end
160
+
161
+ def prepare_outfile
162
+ if @outfile == nil
163
+ return
164
+ end
165
+
166
+ if File.exist?(@outfile)
167
+ FileUtils.rm(@outfile)
168
+ elsif File.dirname(@outfile)
169
+ FileUtils.mkdir_p(File.dirname(@outfile))
170
+ end
171
+ end
172
+
153
173
  end
154
174
  end
155
175
  end
@@ -1,3 +1,3 @@
1
1
  module CocoapodsWhitelist
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-whitelist
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mobile Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-01 00:00:00.000000000 Z
11
+ date: 2017-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler