cocoapods-blacklist 0.1.0
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 +7 -0
- data/.gitignore +7 -0
- data/.travis.yml +21 -0
- data/CHANGELOG.md +11 -0
- data/Gemfile +11 -0
- data/Gemfile.lock +76 -0
- data/LICENSE +22 -0
- data/README.md +50 -0
- data/Rakefile +13 -0
- data/cocoapods-blacklist.gemspec +23 -0
- data/lib/cocoapods-blacklist.rb +5 -0
- data/lib/cocoapods-blacklist/command/blacklist.rb +78 -0
- data/lib/cocoapods-blacklist/gem_version.rb +7 -0
- data/lib/cocoapods_plugin.rb +5 -0
- data/spec/command/blacklist_spec.rb +95 -0
- data/spec/fixtures/BadPodfile.lock +10 -0
- data/spec/fixtures/DoubleBadPodfile.lock +13 -0
- data/spec/fixtures/GoodPodfile.lock +10 -0
- data/spec/fixtures/blacklist.json +14 -0
- data/spec/spec_helper.rb +94 -0
- metadata +97 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 9cca51d9dd36eede866eab703e1db970e52025d1
|
4
|
+
data.tar.gz: 3c4e7fa8aa095c09495c1302fe095eeda24ee494
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 64efab4771af409d8b4f8e4a8786662908fe883a78192bd7c7f6b0c873dcc1d57c315398c286ff3a7d6667df5d39d2c9510583017b3b2de864638f9657ec5495
|
7
|
+
data.tar.gz: 5d3ccae9c71785d81f53a6ba23572917c38546a69d9e058231c70c93cfce655ee87e53448f6c81c413f4f614454d0b814e785bf4545960bdbc33b7d3570e765b
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# Sets Travis to run the Ruby specs on OS X machines to be as close as possible
|
2
|
+
# to the user environment.
|
3
|
+
#
|
4
|
+
language: objective-c
|
5
|
+
|
6
|
+
env:
|
7
|
+
- RVM_RUBY_VERSION=system
|
8
|
+
# - RVM_RUBY_VERSION=1.8.7-p358
|
9
|
+
|
10
|
+
before_install:
|
11
|
+
- export LANG=en_US.UTF-8
|
12
|
+
- curl http://curl.haxx.se/ca/cacert.pem -o /usr/local/share/cacert.pem
|
13
|
+
- source ~/.rvm/scripts/rvm
|
14
|
+
- if [[ $RVM_RUBY_VERSION != 'system' ]]; then rvm install $RVM_RUBY_VERSION; fi
|
15
|
+
- rvm use $RVM_RUBY_VERSION
|
16
|
+
- if [[ $RVM_RUBY_VERSION == 'system' ]]; then sudo gem install bundler --no-ri --no-rdoc; else gem install bundler --no-ri --no-rdoc; fi
|
17
|
+
|
18
|
+
install:
|
19
|
+
- sudo bundle install --without=documentation
|
20
|
+
|
21
|
+
script: bundle exec rake specs
|
data/CHANGELOG.md
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
cocoapods-blacklist (0.1.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
activesupport (4.2.1)
|
10
|
+
i18n (~> 0.7)
|
11
|
+
json (~> 1.7, >= 1.7.7)
|
12
|
+
minitest (~> 5.1)
|
13
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
14
|
+
tzinfo (~> 1.1)
|
15
|
+
addressable (2.3.8)
|
16
|
+
bacon (1.2.0)
|
17
|
+
claide (0.8.1)
|
18
|
+
cocoapods (0.36.4)
|
19
|
+
activesupport (>= 3.2.15)
|
20
|
+
claide (~> 0.8.1)
|
21
|
+
cocoapods-core (= 0.36.4)
|
22
|
+
cocoapods-downloader (~> 0.9.0)
|
23
|
+
cocoapods-plugins (~> 0.4.1)
|
24
|
+
cocoapods-trunk (~> 0.6.0)
|
25
|
+
cocoapods-try (~> 0.4.3)
|
26
|
+
colored (~> 1.2)
|
27
|
+
escape (~> 0.0.4)
|
28
|
+
molinillo (~> 0.2.1)
|
29
|
+
nap (~> 0.8)
|
30
|
+
open4 (~> 1.3)
|
31
|
+
xcodeproj (~> 0.23.1)
|
32
|
+
cocoapods-core (0.36.4)
|
33
|
+
activesupport (>= 3.2.15)
|
34
|
+
fuzzy_match (~> 2.0.4)
|
35
|
+
nap (~> 0.8.0)
|
36
|
+
cocoapods-downloader (0.9.0)
|
37
|
+
cocoapods-plugins (0.4.2)
|
38
|
+
nap
|
39
|
+
cocoapods-trunk (0.6.0)
|
40
|
+
nap (>= 0.8)
|
41
|
+
netrc (= 0.7.8)
|
42
|
+
cocoapods-try (0.4.3)
|
43
|
+
colored (1.2)
|
44
|
+
crack (0.4.2)
|
45
|
+
safe_yaml (~> 1.0.0)
|
46
|
+
escape (0.0.4)
|
47
|
+
fuzzy_match (2.0.4)
|
48
|
+
i18n (0.7.0)
|
49
|
+
json (1.8.2)
|
50
|
+
minitest (5.6.0)
|
51
|
+
molinillo (0.2.3)
|
52
|
+
nap (0.8.0)
|
53
|
+
netrc (0.7.8)
|
54
|
+
open4 (1.3.4)
|
55
|
+
rake (10.4.2)
|
56
|
+
safe_yaml (1.0.4)
|
57
|
+
thread_safe (0.3.5)
|
58
|
+
tzinfo (1.2.2)
|
59
|
+
thread_safe (~> 0.1)
|
60
|
+
webmock (1.21.0)
|
61
|
+
addressable (>= 2.3.6)
|
62
|
+
crack (>= 0.3.2)
|
63
|
+
xcodeproj (0.23.1)
|
64
|
+
activesupport (>= 3)
|
65
|
+
colored (~> 1.2)
|
66
|
+
|
67
|
+
PLATFORMS
|
68
|
+
ruby
|
69
|
+
|
70
|
+
DEPENDENCIES
|
71
|
+
bacon
|
72
|
+
bundler (~> 1.3)
|
73
|
+
cocoapods
|
74
|
+
cocoapods-blacklist!
|
75
|
+
rake
|
76
|
+
webmock
|
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2015 Yahoo, Inc. All rights reserved.
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
# cocoapods-blacklist
|
2
|
+
|
3
|
+
[](https://travis-ci.org/yahoo/cocoapods-blacklist)
|
4
|
+
|
5
|
+
A CocoaPods plugin used to check a project against a list of pods that you do not want included in your build. Security is the primary use, but keeping specific pods that have conflicting licenses is another possible use.
|
6
|
+
|
7
|
+
We use this in our continuous integration builds. If a security issue is found with a pod, we can update our `blacklist.json` file and builds will start to fail immediately. Developers don't always read the email about a new vulnerability. They definitely notice when the build fails. :smile:
|
8
|
+
|
9
|
+
## Installation
|
10
|
+
|
11
|
+
$ gem install cocoapods-blacklist
|
12
|
+
|
13
|
+
## Usage
|
14
|
+
|
15
|
+
$ pod blacklist [LOCKFILE] --config=BLACKLIST_CONFIG
|
16
|
+
|
17
|
+
The `LOCKFILE` is optional, and `./Podfile.lock` is assumed if one is not explicitly passed in.
|
18
|
+
|
19
|
+
## Blacklist config file
|
20
|
+
|
21
|
+
The blacklist config file is a JSON file that has an array of pods, each one containing a hash with:
|
22
|
+
|
23
|
+
- name: the same string you would use to include a pod in a `Podfile`
|
24
|
+
- versions: a version string (or array of version strings) used to match the version
|
25
|
+
- reason: a string used to explain why a pod is blacklisted, will be printed out when a check fails
|
26
|
+
|
27
|
+
```
|
28
|
+
{
|
29
|
+
"pods":[
|
30
|
+
{
|
31
|
+
"name":"FooKit",
|
32
|
+
"reason":"FooKit 1.2.2 did not check passwords on Thursdays",
|
33
|
+
"versions":"1.2.2"
|
34
|
+
},
|
35
|
+
{
|
36
|
+
"name":"BananaKit",
|
37
|
+
"reason":"Vulnerable to code injection with malformed BQL queries",
|
38
|
+
"versions":[">=3.4.2", "<3.6.0"]
|
39
|
+
}
|
40
|
+
]
|
41
|
+
}
|
42
|
+
```
|
43
|
+
|
44
|
+
## Contributors
|
45
|
+
|
46
|
+
- David Grandinetti ([@dbgrandi](https://twitter.com/dbgrandi))
|
47
|
+
|
48
|
+
## License
|
49
|
+
|
50
|
+
Code licensed under the MIT license. See [LICENSE](https://github.com/yahoo/cocoapods-blacklist/blob/master/LICENSE) file for terms.
|
data/Rakefile
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'cocoapods-blacklist/gem_version.rb'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'cocoapods-blacklist'
|
8
|
+
spec.version = CocoapodsBlacklist::VERSION
|
9
|
+
spec.authors = ['David Grandinetti']
|
10
|
+
spec.email = ['dbgrandi@yahoo-inc.com']
|
11
|
+
spec.description = %q{A short description of cocoapods-blacklist.}
|
12
|
+
spec.summary = %q{A longer description of cocoapods-blacklist.}
|
13
|
+
spec.homepage = 'https://github.com/EXAMPLE/cocoapods-blacklist'
|
14
|
+
spec.license = 'MIT'
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ['lib']
|
20
|
+
|
21
|
+
spec.add_development_dependency 'bundler', '~> 1.3'
|
22
|
+
spec.add_development_dependency 'rake'
|
23
|
+
end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
# Created by David Grandinetti 4/27/2015
|
2
|
+
# Copyright (c) 2015 Yahoo, Inc.
|
3
|
+
# Licensed under the terms of the MIT License. See LICENSE file in the project root.
|
4
|
+
|
5
|
+
require 'json'
|
6
|
+
require 'open-uri'
|
7
|
+
|
8
|
+
module Pod
|
9
|
+
class Command
|
10
|
+
class Blacklist < Command
|
11
|
+
self.summary = 'Validate a project against a list of banned pods.'
|
12
|
+
|
13
|
+
self.description = <<-DESC
|
14
|
+
Validate a project against a list of banned pods. Requires a lockfile
|
15
|
+
and a config file (JSON).
|
16
|
+
|
17
|
+
example:
|
18
|
+
$ pod blacklist --config blacklist.json
|
19
|
+
DESC
|
20
|
+
|
21
|
+
self.arguments = [
|
22
|
+
CLAide::Argument.new('LOCKFILE', false),
|
23
|
+
]
|
24
|
+
|
25
|
+
def self.options
|
26
|
+
[
|
27
|
+
['--config=CONFIG', 'Config file or URL for the blacklist'],
|
28
|
+
['--warn', 'Only warn about use of banned pods'],
|
29
|
+
].concat(super)
|
30
|
+
end
|
31
|
+
|
32
|
+
def initialize(argv)
|
33
|
+
@blacklist = argv.option('config')
|
34
|
+
@warn = argv.flag?('warn') || false
|
35
|
+
@lockfile_name = argv.shift_argument || "./Podfile.lock"
|
36
|
+
super
|
37
|
+
end
|
38
|
+
|
39
|
+
def validate!
|
40
|
+
super
|
41
|
+
unless File.exists?(@lockfile_name)
|
42
|
+
help! 'A lockfile and blacklist file are needed.'
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def run
|
47
|
+
lockfile = Pod::Lockfile.from_file(Pathname.new(@lockfile_name))
|
48
|
+
open(@blacklist) do |f|
|
49
|
+
@blacklist_file = JSON.parse(f.read)
|
50
|
+
end
|
51
|
+
|
52
|
+
warned = false
|
53
|
+
failed_pods = {}
|
54
|
+
|
55
|
+
@blacklist_file['pods'].each do |pod|
|
56
|
+
name = pod['name']
|
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)
|
60
|
+
UI.puts "[!] Validation error: Use of #{name} #{version} for reason: #{pod['reason']}".yellow
|
61
|
+
failed_pods[name] = version
|
62
|
+
warned = true
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
if !warned
|
67
|
+
UI.puts "#{@lockfile_name} passed blacklist validation".green
|
68
|
+
else
|
69
|
+
failed_pod_string = failed_pods.map { |name, version| "#{name} (#{version})"}.join(", ")
|
70
|
+
unless @warn
|
71
|
+
raise Informative.new("Failed blacklist validation due to use of #{failed_pod_string}")
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
@@ -0,0 +1,95 @@
|
|
1
|
+
# Created by David Grandinetti 4/27/2015
|
2
|
+
# Copyright (c) 2015 Yahoo, Inc.
|
3
|
+
# Licensed under the terms of the MIT License. See LICENSE file in the project root.
|
4
|
+
|
5
|
+
require File.expand_path('../../spec_helper', __FILE__)
|
6
|
+
|
7
|
+
GOOD_LOCKFILE = './spec/fixtures/GoodPodfile.lock'
|
8
|
+
BAD_LOCKFILE = './spec/fixtures/BadPodfile.lock'
|
9
|
+
DOUBLE_BAD_LOCKFILE = './spec/fixtures/DoubleBadPodfile.lock'
|
10
|
+
BLACKLIST_FILE = './spec/fixtures/blacklist.json'
|
11
|
+
BLACKLIST_URL = 'http://example.com/blacklist.json'
|
12
|
+
|
13
|
+
NON_EXIST_FILE = './spec/fixtures/doesnotexist'
|
14
|
+
|
15
|
+
module Pod
|
16
|
+
describe Command::Blacklist do
|
17
|
+
describe 'In general' do
|
18
|
+
it 'registers itself' do
|
19
|
+
Command.parse(%w{ blacklist }).should.be.instance_of Command::Blacklist
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'defaults to show help' do
|
23
|
+
lambda { run_command('blacklist') }.should.raise CLAide::Help
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'validates Podfile.lock exists if not passed in' do
|
28
|
+
command = Command.parse(['blacklist', "--config=#{BLACKLIST_FILE}"])
|
29
|
+
lambda { command.validate! }.should.raise CLAide::Help
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'validates the lockfile exists if passed in' do
|
33
|
+
command = Command.parse(['blacklist', NON_EXIST_FILE, "--config=#{BLACKLIST_FILE}"])
|
34
|
+
lambda { command.validate! }.should.raise CLAide::Help
|
35
|
+
end
|
36
|
+
|
37
|
+
describe 'running with required args' do
|
38
|
+
it 'allows valid pods with a local blacklist file' do
|
39
|
+
command = Command.parse(['blacklist', GOOD_LOCKFILE, "--config=#{BLACKLIST_FILE}"])
|
40
|
+
lambda {
|
41
|
+
command.validate!
|
42
|
+
command.run
|
43
|
+
}.should.not.raise
|
44
|
+
end
|
45
|
+
|
46
|
+
it 'allows valid pods with a remote blacklist file' do
|
47
|
+
WebMock::API.stub_request(:get, "http://example.com/blacklist.json").
|
48
|
+
with(:headers => {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'User-Agent'=>'Ruby'}).
|
49
|
+
to_return(:status => 200, :body => File.read(BLACKLIST_FILE), :headers => {})
|
50
|
+
|
51
|
+
command = Command.parse(['blacklist', GOOD_LOCKFILE, "--config=#{BLACKLIST_URL}"])
|
52
|
+
lambda {
|
53
|
+
command.validate!
|
54
|
+
command.run
|
55
|
+
}.should.not.raise
|
56
|
+
UI.output.should.include "passed blacklist validation"
|
57
|
+
end
|
58
|
+
|
59
|
+
describe 'having blacklisted pods' do
|
60
|
+
it 'disallows a banned pod' do
|
61
|
+
command = Command.parse(['blacklist', BAD_LOCKFILE, "--config=#{BLACKLIST_FILE}"])
|
62
|
+
exception = lambda {
|
63
|
+
command.validate!
|
64
|
+
command.run
|
65
|
+
}.should.raise Informative
|
66
|
+
exception.message.should.include "Failed blacklist validation due to use of BananaKit"
|
67
|
+
UI.output.should.include "Vulnerable to code injection with malformed BQL queries"
|
68
|
+
end
|
69
|
+
|
70
|
+
it 'prints all banned pods' do
|
71
|
+
command = Command.parse(['blacklist', DOUBLE_BAD_LOCKFILE, "--config=#{BLACKLIST_FILE}"])
|
72
|
+
exception = lambda {
|
73
|
+
command.validate!
|
74
|
+
command.run
|
75
|
+
}.should.raise Informative
|
76
|
+
exception.message.should.include "Failed blacklist validation due to use of"
|
77
|
+
exception.message.should.include "BananaKit (3.4.7)"
|
78
|
+
exception.message.should.include "FooKit (1.2.2)"
|
79
|
+
UI.output.should.include "FooKit 1.2.2 did not check passwords on Thursdays"
|
80
|
+
UI.output.should.include "Vulnerable to code injection with malformed BQL queries"
|
81
|
+
end
|
82
|
+
|
83
|
+
it 'warns about banned pods when --warn is used' do
|
84
|
+
command = Command.parse(['blacklist', DOUBLE_BAD_LOCKFILE, "--config=#{BLACKLIST_FILE}", "--warn"])
|
85
|
+
exception = lambda {
|
86
|
+
command.validate!
|
87
|
+
command.run
|
88
|
+
}.should.not.raise
|
89
|
+
UI.output.should.include "FooKit 1.2.2 did not check passwords on Thursdays"
|
90
|
+
UI.output.should.include "Vulnerable to code injection with malformed BQL queries"
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
PODS:
|
2
|
+
- BananaKit (3.4.7)
|
3
|
+
- FooKit (1.2.2)
|
4
|
+
|
5
|
+
DEPENDENCIES:
|
6
|
+
- BananaKit (~>3.4.0)
|
7
|
+
- FooKit (~>1.2.0)
|
8
|
+
|
9
|
+
SPEC CHECKSUMS:
|
10
|
+
BananaKit: 12148377a117d52b3ab1c61d164b65011d0c3eae
|
11
|
+
FooKit: 21239286b026e43a49c2b70e255a74102cfd2f9f
|
12
|
+
|
13
|
+
COCOAPODS: 0.35.0
|
@@ -0,0 +1,14 @@
|
|
1
|
+
{
|
2
|
+
"pods":[
|
3
|
+
{
|
4
|
+
"name":"FooKit",
|
5
|
+
"reason":"FooKit 1.2.2 did not check passwords on Thursdays",
|
6
|
+
"versions":"1.2.2"
|
7
|
+
},
|
8
|
+
{
|
9
|
+
"name":"BananaKit",
|
10
|
+
"reason":"Vulnerable to code injection with malformed BQL queries",
|
11
|
+
"versions": [">=3.4.2", "<3.6.0"]
|
12
|
+
}
|
13
|
+
]
|
14
|
+
}
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,94 @@
|
|
1
|
+
# Created by David Grandinetti 4/27/2015
|
2
|
+
# Copyright (c) 2015 Yahoo, Inc.
|
3
|
+
# Licensed under the terms of the MIT License. See LICENSE file in the project root.
|
4
|
+
|
5
|
+
require 'pathname'
|
6
|
+
ROOT = Pathname.new(File.expand_path('../../', __FILE__))
|
7
|
+
$:.unshift((ROOT + 'lib').to_s)
|
8
|
+
$:.unshift((ROOT + 'spec').to_s)
|
9
|
+
|
10
|
+
require 'bundler/setup'
|
11
|
+
require 'bacon'
|
12
|
+
require 'cocoapods'
|
13
|
+
|
14
|
+
require 'webmock'
|
15
|
+
WebMock.disable_net_connect!
|
16
|
+
|
17
|
+
require 'cocoapods_plugin'
|
18
|
+
|
19
|
+
#-----------------------------------------------------------------------------#
|
20
|
+
|
21
|
+
module Pod
|
22
|
+
|
23
|
+
# Disable the wrapping so the output is deterministic in the tests.
|
24
|
+
#
|
25
|
+
UI.disable_wrap = true
|
26
|
+
|
27
|
+
# Redirects the messages to an internal store.
|
28
|
+
#
|
29
|
+
module UI
|
30
|
+
@output = ''
|
31
|
+
@warnings = ''
|
32
|
+
|
33
|
+
class << self
|
34
|
+
attr_accessor :output
|
35
|
+
attr_accessor :warnings
|
36
|
+
|
37
|
+
def puts(message = '')
|
38
|
+
@output << "#{message}\n"
|
39
|
+
end
|
40
|
+
|
41
|
+
def warn(message = '', actions = [])
|
42
|
+
@warnings << "#{message}\n"
|
43
|
+
end
|
44
|
+
|
45
|
+
def print(message)
|
46
|
+
@output << message
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
module SpecHelper
|
53
|
+
module Command
|
54
|
+
def argv(*argv)
|
55
|
+
CLAide::ARGV.new(argv)
|
56
|
+
end
|
57
|
+
|
58
|
+
def command(*argv)
|
59
|
+
argv << '--no-ansi'
|
60
|
+
Pod::Command.parse(argv)
|
61
|
+
end
|
62
|
+
|
63
|
+
def run_command(*args)
|
64
|
+
Pod::UI.output = ''
|
65
|
+
# @todo Remove this once all cocoapods has
|
66
|
+
# been converted to use the UI.puts
|
67
|
+
config_silent = config.silent?
|
68
|
+
config.silent = false
|
69
|
+
cmd = command(*args)
|
70
|
+
cmd.validate!
|
71
|
+
cmd.run
|
72
|
+
config.silent = config_silent
|
73
|
+
Pod::UI.output
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
Bacon.summary_at_exit
|
79
|
+
|
80
|
+
module Bacon
|
81
|
+
class Context
|
82
|
+
include Pod::Config::Mixin
|
83
|
+
# include SpecHelper::Fixture
|
84
|
+
include SpecHelper::Command
|
85
|
+
|
86
|
+
# def skip_xcodebuild?
|
87
|
+
# ENV['SKIP_XCODEBUILD']
|
88
|
+
# end
|
89
|
+
|
90
|
+
def temporary_directory
|
91
|
+
SpecHelper.temporary_directory
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
metadata
ADDED
@@ -0,0 +1,97 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: cocoapods-blacklist
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- David Grandinetti
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-05-21 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.3'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: A short description of cocoapods-blacklist.
|
42
|
+
email:
|
43
|
+
- dbgrandi@yahoo-inc.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- .gitignore
|
49
|
+
- .travis.yml
|
50
|
+
- CHANGELOG.md
|
51
|
+
- Gemfile
|
52
|
+
- Gemfile.lock
|
53
|
+
- LICENSE
|
54
|
+
- README.md
|
55
|
+
- Rakefile
|
56
|
+
- cocoapods-blacklist.gemspec
|
57
|
+
- lib/cocoapods-blacklist.rb
|
58
|
+
- lib/cocoapods-blacklist/command/blacklist.rb
|
59
|
+
- lib/cocoapods-blacklist/gem_version.rb
|
60
|
+
- lib/cocoapods_plugin.rb
|
61
|
+
- spec/command/blacklist_spec.rb
|
62
|
+
- spec/fixtures/BadPodfile.lock
|
63
|
+
- spec/fixtures/DoubleBadPodfile.lock
|
64
|
+
- spec/fixtures/GoodPodfile.lock
|
65
|
+
- spec/fixtures/blacklist.json
|
66
|
+
- spec/spec_helper.rb
|
67
|
+
homepage: https://github.com/EXAMPLE/cocoapods-blacklist
|
68
|
+
licenses:
|
69
|
+
- MIT
|
70
|
+
metadata: {}
|
71
|
+
post_install_message:
|
72
|
+
rdoc_options: []
|
73
|
+
require_paths:
|
74
|
+
- lib
|
75
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
76
|
+
requirements:
|
77
|
+
- - '>='
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: '0'
|
80
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
81
|
+
requirements:
|
82
|
+
- - '>='
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: '0'
|
85
|
+
requirements: []
|
86
|
+
rubyforge_project:
|
87
|
+
rubygems_version: 2.4.5
|
88
|
+
signing_key:
|
89
|
+
specification_version: 4
|
90
|
+
summary: A longer description of cocoapods-blacklist.
|
91
|
+
test_files:
|
92
|
+
- spec/command/blacklist_spec.rb
|
93
|
+
- spec/fixtures/BadPodfile.lock
|
94
|
+
- spec/fixtures/DoubleBadPodfile.lock
|
95
|
+
- spec/fixtures/GoodPodfile.lock
|
96
|
+
- spec/fixtures/blacklist.json
|
97
|
+
- spec/spec_helper.rb
|