cocoapods-whitelist 0.0.2 → 0.0.3

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
  SHA1:
3
- metadata.gz: e5d9b4ac40951e4b43fb64d48a34e478e9a1fa1d
4
- data.tar.gz: 6b702f225f4f9f615f3407699ff63ccadef98e5b
3
+ metadata.gz: 9c7317c60ac4874a7648ac3b4b1d9731e1156b9f
4
+ data.tar.gz: 9c09ade5bbaa5e9529cef5b4d455b39538407105
5
5
  SHA512:
6
- metadata.gz: 184354b70faf57d5c2ef5409650811daafd36d36f972f2b62047f616a2e3120e83675b08b2abc40c9463b8a97a8ec530ca2a4b7dc6ee36069b7903aa974b1425
7
- data.tar.gz: 6c13acc44416b942e6e730cf8abe77b0ca3cd9ae2cd8b0577f61ee88246b57473fd0aae59e11b0ef7a3d89364035e2e622ce460d0d12d7db83b654ae3e6efe88
6
+ metadata.gz: 79ad88f8614ffe1f7b6ded7c08ccbe810abcce45839f75a8a052a39f5ca8ed924aaf1f1be02c937cf4adbc7de505adff453ef396500c8ee874c1414d52992233
7
+ data.tar.gz: ab1a52ebf12bc373c368fa56d7768db4a40c5013b59c8e97f752e5c95e85e9abf8e828ed276fe18e72ebc54e5663634173915eda70e3342b363dadea393391ae
data/Gemfile.lock CHANGED
@@ -1,39 +1,39 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cocoapods-whitelist (0.0.1)
4
+ cocoapods-whitelist (0.0.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- CFPropertyList (2.3.4)
10
- activesupport (4.2.7.1)
9
+ CFPropertyList (2.3.5)
10
+ activesupport (4.2.8)
11
11
  i18n (~> 0.7)
12
- json (~> 1.7, >= 1.7.7)
13
12
  minitest (~> 5.1)
14
13
  thread_safe (~> 0.3, >= 0.3.4)
15
14
  tzinfo (~> 1.1)
16
15
  bacon (1.2.0)
17
16
  claide (1.0.1)
18
- cocoapods (1.1.1)
17
+ cocoapods (1.2.1)
19
18
  activesupport (>= 4.0.2, < 5)
20
19
  claide (>= 1.0.1, < 2.0)
21
- cocoapods-core (= 1.1.1)
20
+ cocoapods-core (= 1.2.1)
22
21
  cocoapods-deintegrate (>= 1.0.1, < 2.0)
23
- cocoapods-downloader (>= 1.1.2, < 2.0)
22
+ cocoapods-downloader (>= 1.1.3, < 2.0)
24
23
  cocoapods-plugins (>= 1.0.0, < 2.0)
25
24
  cocoapods-search (>= 1.0.0, < 2.0)
26
25
  cocoapods-stats (>= 1.0.0, < 2.0)
27
- cocoapods-trunk (>= 1.1.1, < 2.0)
26
+ cocoapods-trunk (>= 1.2.0, < 2.0)
28
27
  cocoapods-try (>= 1.1.0, < 2.0)
29
- colored (~> 1.2)
28
+ colored2 (~> 3.1)
30
29
  escape (~> 0.0.4)
31
30
  fourflusher (~> 2.0.1)
32
31
  gh_inspector (~> 1.0)
33
- molinillo (~> 0.5.1)
32
+ molinillo (~> 0.5.7)
34
33
  nap (~> 1.0)
35
- xcodeproj (>= 1.3.3, < 2.0)
36
- cocoapods-core (1.1.1)
34
+ ruby-macho (~> 1.1)
35
+ xcodeproj (>= 1.4.4, < 2.0)
36
+ cocoapods-core (1.2.1)
37
37
  activesupport (>= 4.0.2, < 5)
38
38
  fuzzy_match (~> 2.0.4)
39
39
  nap (~> 1.0)
@@ -43,38 +43,37 @@ GEM
43
43
  nap
44
44
  cocoapods-search (1.0.0)
45
45
  cocoapods-stats (1.0.0)
46
- cocoapods-trunk (1.1.2)
46
+ cocoapods-trunk (1.2.0)
47
47
  nap (>= 0.8, < 2.0)
48
48
  netrc (= 0.7.8)
49
49
  cocoapods-try (1.1.0)
50
- colored (1.2)
50
+ colored2 (3.1.2)
51
51
  escape (0.0.4)
52
52
  fourflusher (2.0.1)
53
53
  fuzzy_match (2.0.4)
54
54
  gh_inspector (1.0.3)
55
- i18n (0.7.0)
56
- json (1.8.6)
55
+ i18n (0.8.4)
57
56
  metaclass (0.0.4)
58
- minitest (5.10.1)
57
+ minitest (5.10.2)
59
58
  mocha (1.2.1)
60
59
  metaclass (~> 0.0.1)
61
60
  mocha-on-bacon (0.2.3)
62
61
  mocha (>= 0.13.0)
63
- molinillo (0.5.5)
62
+ molinillo (0.5.7)
64
63
  nanaimo (0.2.3)
65
64
  nap (1.1.0)
66
65
  netrc (0.7.8)
67
66
  prettybacon (0.0.2)
68
67
  bacon (~> 1.2)
69
68
  rake (12.0.0)
70
- thread_safe (0.3.5)
71
- tzinfo (1.2.2)
69
+ ruby-macho (1.1.0)
70
+ thread_safe (0.3.6)
71
+ tzinfo (1.2.3)
72
72
  thread_safe (~> 0.1)
73
- xcodeproj (1.4.2)
73
+ xcodeproj (1.4.4)
74
74
  CFPropertyList (~> 2.3.3)
75
- activesupport (>= 3)
76
75
  claide (>= 1.0.1, < 2.0)
77
- colored (~> 1.2)
76
+ colored2 (~> 3.1)
78
77
  nanaimo (~> 0.2.3)
79
78
 
80
79
  PLATFORMS
@@ -91,4 +90,4 @@ DEPENDENCIES
91
90
  rake (~> 12.0)
92
91
 
93
92
  BUNDLED WITH
94
- 1.13.6
93
+ 1.14.6
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # cocoapods-whitelist
2
2
 
3
- A description of cocoapods-whitelist.
3
+ Validate Podspec's dependencies against a whitelist of pods.
4
4
 
5
5
  ## Installation
6
6
 
@@ -8,4 +8,18 @@ A description of cocoapods-whitelist.
8
8
 
9
9
  ## Usage
10
10
 
11
- $ pod spec whitelist POD_NAME
11
+ - As a command
12
+ ```
13
+ $ pod whitelist [--podspec=PODSPEC] [--config=WHITELIST_FILE_OR_URL] [--fail-on-error]
14
+ ```
15
+
16
+ - As plugin, add into the Podfile of your tests app
17
+ ```
18
+ plugin 'cocoapods-whitelist'
19
+ ```
20
+
21
+ If not Podspec is passed by parameter, the command search into the current and parent directory.
22
+
23
+ You can specify a custom whitelist. By default use a whitelist hosted in [GitHub](https://github.com/mercadolibre/mobile-dependencies_whitelist/blob/master/ios-whitelist.json)
24
+
25
+ By default exit with status 0, unless you add the parameter `--fail-on-error`
@@ -1,7 +1,6 @@
1
1
  require 'open-uri'
2
2
 
3
3
  DEFAULT_WHITELIST_URL = "https://raw.githubusercontent.com/mercadolibre/mobile-dependencies_whitelist/master/ios-whitelist.json"
4
- ERROR_MESSAGE = "Please check your dependencies"
5
4
 
6
5
  class AllowedDependency
7
6
  attr_accessor :name
@@ -56,15 +55,16 @@ module Pod
56
55
  validate_dependencies(JSON.parse(specification.to_json), whitelist)
57
56
  end
58
57
 
59
- show_error_message
58
+ show_result_message
60
59
  end
61
60
 
62
- def show_error_message
61
+ def show_result_message
63
62
  return unless @failure
63
+ message = "Please check your dependencies.\nYou can see the allowed dependencies at #{@whitelist_url}"
64
64
  if @fail_on_error
65
- raise Informative.new(ERROR_MESSAGE)
65
+ raise Informative.new(message)
66
66
  else
67
- UI.puts ERROR_MESSAGE.red
67
+ UI.puts message.yellow
68
68
  end
69
69
  end
70
70
 
@@ -91,8 +91,9 @@ module Pod
91
91
  end
92
92
 
93
93
  if not_allowed.any?
94
- UI.puts " Error: Found dependencies not allowed:".red
95
- not_allowed.each {|dependency| UI.puts " - #{dependency}".red}
94
+ severity = @fail_on_error ? "Error" : "Warning"
95
+ show_error_message(" #{severity}: Found dependencies not allowed:")
96
+ not_allowed.each {|dependency| show_error_message(" - #{dependency}")}
96
97
  @failure = true
97
98
  else
98
99
  UI.puts " OK".green
@@ -141,6 +142,14 @@ module Pod
141
142
 
142
143
  return podspecs.map { |path| Pod::Specification.from_file(path) }
143
144
  end
145
+
146
+ def show_error_message(message)
147
+ if @fail_on_error
148
+ UI.puts message.red
149
+ else
150
+ UI.puts message.yellow
151
+ end
152
+ end
144
153
  end
145
154
  end
146
155
  end
@@ -1,3 +1,3 @@
1
1
  module CocoapodsWhitelist
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -3,7 +3,6 @@ require 'cocoapods-whitelist/command'
3
3
  module Whitelist
4
4
  Pod::HooksManager.register('cocoapods-whitelist', :pre_install) do |context, options|
5
5
  argv = CLAide::ARGV.new(options)
6
- puts argv
7
6
  Pod::Command::Whitelist.new(argv).run
8
7
  end
9
8
  end
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-whitelist
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
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-01-26 00:00:00.000000000 Z
11
+ date: 2017-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.3'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: '12.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: '12.0'
41
41
  description: A short description of cocoapods-whitelist.
@@ -78,17 +78,17 @@ require_paths:
78
78
  - lib
79
79
  required_ruby_version: !ruby/object:Gem::Requirement
80
80
  requirements:
81
- - - ">="
81
+ - - '>='
82
82
  - !ruby/object:Gem::Version
83
83
  version: '0'
84
84
  required_rubygems_version: !ruby/object:Gem::Requirement
85
85
  requirements:
86
- - - ">="
86
+ - - '>='
87
87
  - !ruby/object:Gem::Version
88
88
  version: '0'
89
89
  requirements: []
90
90
  rubyforge_project:
91
- rubygems_version: 2.4.8
91
+ rubygems_version: 2.6.10
92
92
  signing_key:
93
93
  specification_version: 4
94
94
  summary: A longer description of cocoapods-whitelist.