cocoapods-blacklist 0.1.1 → 0.1.2

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: b3d4092555d1dd6c64432973ec0bc77206167694
4
- data.tar.gz: 4ccbdab73ef08de63ff4c9bb1c0709a632c5f82d
3
+ metadata.gz: a536f7b97996715a0804fa4a12e9d8b00053d3db
4
+ data.tar.gz: 436cc27ed236ec60e3e7c999eb9c6a37724b9970
5
5
  SHA512:
6
- metadata.gz: e4de412d70290d74e79bcb6d9e2e271eae0b4cc0dde6fdf536efb1410aac0b88b5ea35165c0ff7d58f661b1fc615de25f859eb40a5d85cfc340198fe62727da3
7
- data.tar.gz: c054c4f152acb557b64a9f0765ddc1240c23bb8683d3b7f6499c98accb2d6e237f47990836883f8ef2e2ab2acf3726b5fe9784470189a0c92fd302accfb25295
6
+ metadata.gz: 708bd2d18a49e3874e955b468fdba82c0431e7a362eca8502a4e05ec79e280448254f35d42f0760e01e2885db5e03a46d222b800fec4a242b73edfb06103da56
7
+ data.tar.gz: 70454add6b1f3be2f8f342bc183082d3f5c78a7ff0c9b2263396485eea9112a4957815aa14613f2704c19767f92c059adfce50cb523dc9805056033e0e3ee5b9
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  ## CHANGELOG
2
2
 
3
+ # 0.1.2
4
+ - More idiomatic CLAide usage (@segiddins 11/16/2015)
5
+
6
+ # 0.1.1
7
+ - Updated Pod metadata (@clarkda 8/14/2015)
8
+
3
9
  # 0.1.0
4
10
  - Public release (@dbgrandi 5/18/2015)
5
11
 
data/Gemfile CHANGED
@@ -6,6 +6,6 @@ gemspec
6
6
  group :development do
7
7
  gem 'cocoapods'
8
8
  gem 'bacon'
9
+ gem 'prettybacon'
9
10
  gem 'webmock'
10
11
  end
11
-
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cocoapods-blacklist (0.1.0)
4
+ cocoapods-blacklist (0.1.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -52,6 +52,8 @@ GEM
52
52
  nap (0.8.0)
53
53
  netrc (0.7.8)
54
54
  open4 (1.3.4)
55
+ prettybacon (0.0.2)
56
+ bacon (~> 1.2)
55
57
  rake (10.4.2)
56
58
  safe_yaml (1.0.4)
57
59
  thread_safe (0.3.5)
@@ -72,5 +74,9 @@ DEPENDENCIES
72
74
  bundler (~> 1.3)
73
75
  cocoapods
74
76
  cocoapods-blacklist!
77
+ prettybacon
75
78
  rake
76
79
  webmock
80
+
81
+ BUNDLED WITH
82
+ 1.10.6
data/README.md CHANGED
@@ -44,6 +44,7 @@ The blacklist config file is a JSON file that has an array of pods, each one con
44
44
  ## Contributors
45
45
 
46
46
  - David Grandinetti ([@dbgrandi](https://twitter.com/dbgrandi))
47
+ - Samuel E. Giddins ([@segiddins](https://twitter.com/segiddins))
47
48
 
48
49
  ## License
49
50
 
@@ -13,7 +13,7 @@ module Pod
13
13
  self.description = <<-DESC
14
14
  Validate a project against a list of banned pods. Requires a lockfile
15
15
  and a config file (JSON).
16
-
16
+
17
17
  example:
18
18
  $ pod blacklist --config blacklist.json
19
19
  DESC
@@ -21,7 +21,7 @@ module Pod
21
21
  self.arguments = [
22
22
  CLAide::Argument.new('LOCKFILE', false),
23
23
  ]
24
-
24
+
25
25
  def self.options
26
26
  [
27
27
  ['--config=CONFIG', 'Config file or URL for the blacklist'],
@@ -31,32 +31,32 @@ module Pod
31
31
 
32
32
  def initialize(argv)
33
33
  @blacklist = argv.option('config')
34
- @warn = argv.flag?('warn') || false
35
- @lockfile_name = argv.shift_argument || "./Podfile.lock"
34
+ @warn = argv.flag?('warn')
35
+ @lockfile_path = argv.shift_argument
36
36
  super
37
37
  end
38
38
 
39
39
  def validate!
40
40
  super
41
- unless File.exists?(@lockfile_name)
42
- help! 'A lockfile and blacklist file are needed.'
43
- end
41
+
42
+ @lockfile = @lockfile_path ? Lockfile.from_file(Pathname(@lockfile_path)) : config.lockfile
43
+ help! 'A lockfile is needed.' unless lockfile
44
+ help! 'A blacklist file is needed.' unless @blacklist
44
45
  end
45
46
 
46
47
  def run
47
- lockfile = Pod::Lockfile.from_file(Pathname.new(@lockfile_name))
48
48
  open(@blacklist) do |f|
49
49
  @blacklist_file = JSON.parse(f.read)
50
50
  end
51
51
 
52
52
  warned = false
53
53
  failed_pods = {}
54
-
54
+
55
55
  @blacklist_file['pods'].each do |pod|
56
56
  name = pod['name']
57
57
  if lockfile.pod_names.include? name
58
- version = Pod::Version.new(lockfile.version(name))
59
- if Pod::Requirement.create(pod['versions']).satisfied_by?(version)
58
+ version = Version.new(lockfile.version(name))
59
+ if Requirement.create(pod['versions']).satisfied_by?(version)
60
60
  UI.puts "[!] Validation error: Use of #{name} #{version} for reason: #{pod['reason']}".yellow
61
61
  failed_pods[name] = version
62
62
  warned = true
@@ -64,7 +64,7 @@ module Pod
64
64
  end
65
65
  end
66
66
  if !warned
67
- UI.puts "#{@lockfile_name} passed blacklist validation".green
67
+ UI.puts "#{UI.path lockfile.defined_in_file.expand_path} passed blacklist validation".green
68
68
  else
69
69
  failed_pod_string = failed_pods.map { |name, version| "#{name} (#{version})"}.join(", ")
70
70
  unless @warn
@@ -72,7 +72,10 @@ module Pod
72
72
  end
73
73
  end
74
74
  end
75
-
75
+
76
+ private
77
+
78
+ attr_reader :lockfile
76
79
  end
77
80
  end
78
81
  end
@@ -3,5 +3,5 @@
3
3
  # Licensed under the terms of the MIT License. See LICENSE file in the project root.
4
4
 
5
5
  module CocoapodsBlacklist
6
- VERSION = "0.1.1"
6
+ VERSION = "0.1.2"
7
7
  end
data/spec/spec_helper.rb CHANGED
@@ -9,6 +9,7 @@ $:.unshift((ROOT + 'spec').to_s)
9
9
 
10
10
  require 'bundler/setup'
11
11
  require 'bacon'
12
+ require 'pretty_bacon'
12
13
  require 'cocoapods'
13
14
 
14
15
  require 'webmock'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-blacklist
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Grandinetti
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-15 00:00:00.000000000 Z
11
+ date: 2015-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -97,4 +97,3 @@ test_files:
97
97
  - spec/fixtures/GoodPodfile.lock
98
98
  - spec/fixtures/blacklist.json
99
99
  - spec/spec_helper.rb
100
- has_rdoc: