cocoapods-podfile_info 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.gitignore +18 -0
- data/Gemfile +12 -0
- data/Gemfile.lock +69 -0
- data/LICENSE +20 -0
- data/README.md +4 -0
- data/Rakefile +14 -0
- data/cocoapods-podfile_info.gemspec +22 -0
- data/lib/cocoapods-podfile_info.rb +5 -0
- data/lib/cocoapods_plugin.rb +1 -0
- data/lib/pod/command/podfile_info.rb +87 -0
- data/lib/podfile_info/version.rb +3 -0
- data/spec/command/podfile_info_spec.rb +0 -0
- data/spec/spec_helper.rb +47 -0
- metadata +89 -0
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
ZDM0ODJmYTBiYjM4YzQyNGNhM2QzMTJlZWFmYjVmNjRhNDU1YjNiOA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
YmMyNDJlN2E3ZDk5NTc1OTY2NzU5YmJlYmEzOTY2ODY2Y2Q1NjBjZQ==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NDE5MTI1MDRmODMyZGNjZjA4ZmZiYzBkYzY0MmFlYjAyOWMzNDU0M2M2OWY5
|
10
|
+
YThmZjFlN2RjNDc4NDkwMWI0OGNmY2E2MWQ5MThkMzc0ZmQzZDNhMGE4ZmFi
|
11
|
+
OTFkYWFmYzUyNGIwZmM2NDk1MzliNTI1OGIxNDM0ZjE3YjQ2OGU=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
YzRiYjdlNWRiZmMwOTIzN2Q4NzI4NjIwYmUyNDViM2U2Y2JhMmJjMGNmYmI0
|
14
|
+
NTQzYmE3YjUxNTlhY2I2OWVjZGUxN2I3MmVlNDY3NzJiNTFkMmI4OTkyMzQ2
|
15
|
+
ZWU1ZDI5YzUyOGYwYjEwOGNjN2VmMGNjMzE0MTI5YmE2MTM3MWQ=
|
data/.gitignore
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
gemspec
|
4
|
+
|
5
|
+
group :development do
|
6
|
+
gem 'cocoapods'
|
7
|
+
gem 'bacon'
|
8
|
+
gem 'mocha-on-bacon'
|
9
|
+
gem 'mocha', '~> 0.11.4'
|
10
|
+
gem 'rake'
|
11
|
+
gem 'prettybacon', :git => 'https://github.com/irrationalfab/PrettyBacon.git', :branch => 'master'
|
12
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
GIT
|
2
|
+
remote: https://github.com/irrationalfab/PrettyBacon.git
|
3
|
+
revision: 926c214ade1ec1cbc9544d603e36f15a780f7e68
|
4
|
+
branch: master
|
5
|
+
specs:
|
6
|
+
prettybacon (0.0.1)
|
7
|
+
bacon (~> 1.2)
|
8
|
+
|
9
|
+
PATH
|
10
|
+
remote: .
|
11
|
+
specs:
|
12
|
+
cocoapods-podfile_info (0.0.1)
|
13
|
+
|
14
|
+
GEM
|
15
|
+
remote: https://rubygems.org/
|
16
|
+
specs:
|
17
|
+
activesupport (3.2.15)
|
18
|
+
i18n (~> 0.6, >= 0.6.4)
|
19
|
+
multi_json (~> 1.0)
|
20
|
+
bacon (1.2.0)
|
21
|
+
claide (0.4.0)
|
22
|
+
cocoapods (0.28.0)
|
23
|
+
activesupport (>= 3.2.15, < 4)
|
24
|
+
claide (~> 0.4.0)
|
25
|
+
cocoapods-core (= 0.28.0)
|
26
|
+
cocoapods-downloader (~> 0.2.0)
|
27
|
+
colored (~> 1.2)
|
28
|
+
escape (~> 0.0.4)
|
29
|
+
json_pure (~> 1.8)
|
30
|
+
open4 (~> 1.3)
|
31
|
+
xcodeproj (~> 0.14.1)
|
32
|
+
cocoapods-core (0.28.0)
|
33
|
+
activesupport (>= 3.2.15, < 4)
|
34
|
+
fuzzy_match (~> 2.0.4)
|
35
|
+
json (~> 1.8)
|
36
|
+
nap (~> 0.5)
|
37
|
+
cocoapods-downloader (0.2.0)
|
38
|
+
colored (1.2)
|
39
|
+
escape (0.0.4)
|
40
|
+
fuzzy_match (2.0.4)
|
41
|
+
i18n (0.6.5)
|
42
|
+
json (1.8.1)
|
43
|
+
json_pure (1.8.1)
|
44
|
+
metaclass (0.0.1)
|
45
|
+
mocha (0.11.4)
|
46
|
+
metaclass (~> 0.0.1)
|
47
|
+
mocha-on-bacon (0.2.1)
|
48
|
+
mocha (>= 0.9.8)
|
49
|
+
multi_json (1.8.2)
|
50
|
+
nap (0.6.0)
|
51
|
+
open4 (1.3.0)
|
52
|
+
rake (10.1.0)
|
53
|
+
xcodeproj (0.14.1)
|
54
|
+
activesupport (~> 3.0)
|
55
|
+
colored (~> 1.2)
|
56
|
+
rake
|
57
|
+
|
58
|
+
PLATFORMS
|
59
|
+
ruby
|
60
|
+
|
61
|
+
DEPENDENCIES
|
62
|
+
bacon
|
63
|
+
bundler (~> 1.3)
|
64
|
+
cocoapods
|
65
|
+
cocoapods-podfile_info!
|
66
|
+
mocha (~> 0.11.4)
|
67
|
+
mocha-on-bacon
|
68
|
+
prettybacon!
|
69
|
+
rake
|
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2013 Taras Kalapun, Joshua Kalpin
|
2
|
+
|
3
|
+
The MIT License (MIT)
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
7
|
+
the Software without restriction, including without limitation the rights to
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
9
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
10
|
+
subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
20
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'bundler/gem_tasks'
|
2
|
+
|
3
|
+
require "bundler/gem_tasks"
|
4
|
+
|
5
|
+
def specs(dir)
|
6
|
+
FileList["spec/#{dir}/*_spec.rb"].shuffle.join(' ')
|
7
|
+
end
|
8
|
+
|
9
|
+
desc "Runs all the specs"
|
10
|
+
task :specs do
|
11
|
+
sh "bundle exec bacon #{specs('**')}"
|
12
|
+
end
|
13
|
+
|
14
|
+
task :default => :specs
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'cocoapods-podfile_info.rb'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'cocoapods-podfile_info'
|
8
|
+
spec.version = PodfileInfo::VERSION
|
9
|
+
spec.authors = ['Taras Kalapun', 'Joshua Kalpin']
|
10
|
+
spec.description = %q{CocoaPods plugin to show information on installed pods in the current project}
|
11
|
+
spec.summary = %q{Show a info on installed pods}
|
12
|
+
spec.homepage = 'https://github.com/cocoapods/cocoapods-podfile_info'
|
13
|
+
spec.license = 'MIT'
|
14
|
+
|
15
|
+
spec.files = `git ls-files`.split($/)
|
16
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
17
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
|
+
spec.require_paths = ['lib']
|
19
|
+
|
20
|
+
spec.add_development_dependency 'bundler', '~> 1.3'
|
21
|
+
spec.add_development_dependency 'rake'
|
22
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'pod/command/podfile_info'
|
@@ -0,0 +1,87 @@
|
|
1
|
+
module Pod
|
2
|
+
class Command
|
3
|
+
class PodfileInfo < Command
|
4
|
+
|
5
|
+
self.summary = 'Shows information on installed Pods.'
|
6
|
+
self.description = <<-DESC
|
7
|
+
Shows information on installed Pods in current Project.
|
8
|
+
If optional `PODFILE_PATH` provided, the info will be shown for
|
9
|
+
that specific Podfile
|
10
|
+
DESC
|
11
|
+
self.arguments = '[PODFILE_PATH]'
|
12
|
+
|
13
|
+
def self.options
|
14
|
+
[
|
15
|
+
["--all", "Show information about all Pods with dependencies that are used in a project"],
|
16
|
+
["--md", "Output information in Markdown format"]
|
17
|
+
].concat(super)
|
18
|
+
end
|
19
|
+
|
20
|
+
def initialize(argv)
|
21
|
+
@info_all = argv.flag?('all')
|
22
|
+
@info_in_md = argv.flag?('md')
|
23
|
+
@info_license = argv.flag?('license')
|
24
|
+
@podfile_path = argv.shift_argument
|
25
|
+
super
|
26
|
+
end
|
27
|
+
|
28
|
+
def run
|
29
|
+
use_podfile = (@podfile_path || !config.lockfile)
|
30
|
+
|
31
|
+
if !use_podfile
|
32
|
+
UI.puts "Using lockfile" if config.verbose?
|
33
|
+
verify_lockfile_exists!
|
34
|
+
lockfile = config.lockfile
|
35
|
+
pods = lockfile.pod_names
|
36
|
+
if @info_all
|
37
|
+
deps = lockfile.dependencies.map{|d| d.name}
|
38
|
+
pods = (deps + pods).uniq
|
39
|
+
end
|
40
|
+
elsif @podfile_path
|
41
|
+
podfile = Pod::Podfile.from_file(@podfile_path)
|
42
|
+
pods = pods_from_podfile(podfile)
|
43
|
+
else
|
44
|
+
verify_podfile_exists!
|
45
|
+
podfile = config.podfile
|
46
|
+
pods = pods_from_podfile(podfile)
|
47
|
+
end
|
48
|
+
|
49
|
+
UI.puts "\nPods used:\n".yellow unless @info_in_md
|
50
|
+
pods_info(pods, @info_in_md)
|
51
|
+
end
|
52
|
+
|
53
|
+
def pods_from_podfile(podfile)
|
54
|
+
pods = []
|
55
|
+
podfile.root_target_definitions.each {|e| h = e.to_hash; pods << h['dependencies'] if h['dependencies']}
|
56
|
+
pods.flatten!
|
57
|
+
pods.collect! {|pod| (pod.is_a?(Hash)) ? pod.keys.first : pod}
|
58
|
+
end
|
59
|
+
|
60
|
+
def pods_info_hash(pods, keys=[:name, :homepage, :summary, :license])
|
61
|
+
pods_info = []
|
62
|
+
pods.each do |pod|
|
63
|
+
spec = (Pod::SourcesManager.search_by_name(pod).first rescue nil)
|
64
|
+
if spec
|
65
|
+
info = {}
|
66
|
+
keys.each { |k| info[k] = spec.specification.send(k) }
|
67
|
+
pods_info << info
|
68
|
+
end
|
69
|
+
end
|
70
|
+
pods_info
|
71
|
+
end
|
72
|
+
|
73
|
+
def pods_info(pods, in_md=false)
|
74
|
+
pods = pods_info_hash(pods, [:name, :homepage, :summary, :license])
|
75
|
+
|
76
|
+
pods.each do |pod|
|
77
|
+
if in_md
|
78
|
+
UI.puts "* [#{pod[:name]}](#{pod[:homepage]}) [#{pod[:license][:type]}] - #{pod[:summary]}"
|
79
|
+
else
|
80
|
+
UI.puts "- #{pod[:name]} [#{pod[:license][:type]}]".green
|
81
|
+
UI.puts " #{pod[:summary]}\n\n"
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
File without changes
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'pathname'
|
2
|
+
ROOT = Pathname.new(File.expand_path('../../', __FILE__))
|
3
|
+
$:.unshift((ROOT + 'lib').to_s)
|
4
|
+
$:.unshift((ROOT + 'spec').to_s)
|
5
|
+
|
6
|
+
require 'bundler/setup'
|
7
|
+
require 'bacon'
|
8
|
+
require 'mocha-on-bacon'
|
9
|
+
require 'pretty_bacon'
|
10
|
+
require 'cocoapods'
|
11
|
+
|
12
|
+
require 'cocoapods_plugin'
|
13
|
+
|
14
|
+
#-----------------------------------------------------------------------------#
|
15
|
+
|
16
|
+
module Pod
|
17
|
+
|
18
|
+
# Disable the wrapping so the output is deterministic in the tests.
|
19
|
+
#
|
20
|
+
UI.disable_wrap = true
|
21
|
+
|
22
|
+
# Redirects the messages to an internal store.
|
23
|
+
#
|
24
|
+
module UI
|
25
|
+
@output = ''
|
26
|
+
@warnings = ''
|
27
|
+
|
28
|
+
class << self
|
29
|
+
attr_accessor :output
|
30
|
+
attr_accessor :warnings
|
31
|
+
|
32
|
+
def puts(message = '')
|
33
|
+
@output << "#{message}\n"
|
34
|
+
end
|
35
|
+
|
36
|
+
def warn(message = '', actions = [])
|
37
|
+
@warnings << "#{message}\n"
|
38
|
+
end
|
39
|
+
|
40
|
+
def print(message)
|
41
|
+
@output << message
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
#-----------------------------------------------------------------------------#
|
metadata
ADDED
@@ -0,0 +1,89 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: cocoapods-podfile_info
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Taras Kalapun
|
8
|
+
- Joshua Kalpin
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-12-05 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: bundler
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ~>
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '1.3'
|
21
|
+
type: :development
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ~>
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '1.3'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: rake
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ! '>='
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0'
|
35
|
+
type: :development
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ! '>='
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
42
|
+
description: CocoaPods plugin to show information on installed pods in the current
|
43
|
+
project
|
44
|
+
email:
|
45
|
+
executables: []
|
46
|
+
extensions: []
|
47
|
+
extra_rdoc_files: []
|
48
|
+
files:
|
49
|
+
- .gitignore
|
50
|
+
- Gemfile
|
51
|
+
- Gemfile.lock
|
52
|
+
- LICENSE
|
53
|
+
- README.md
|
54
|
+
- Rakefile
|
55
|
+
- cocoapods-podfile_info.gemspec
|
56
|
+
- lib/cocoapods-podfile_info.rb
|
57
|
+
- lib/cocoapods_plugin.rb
|
58
|
+
- lib/pod/command/podfile_info.rb
|
59
|
+
- lib/podfile_info/version.rb
|
60
|
+
- spec/command/podfile_info_spec.rb
|
61
|
+
- spec/spec_helper.rb
|
62
|
+
homepage: https://github.com/cocoapods/cocoapods-podfile_info
|
63
|
+
licenses:
|
64
|
+
- MIT
|
65
|
+
metadata: {}
|
66
|
+
post_install_message:
|
67
|
+
rdoc_options: []
|
68
|
+
require_paths:
|
69
|
+
- lib
|
70
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ! '>='
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
75
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
76
|
+
requirements:
|
77
|
+
- - ! '>='
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: '0'
|
80
|
+
requirements: []
|
81
|
+
rubyforge_project:
|
82
|
+
rubygems_version: 2.1.11
|
83
|
+
signing_key:
|
84
|
+
specification_version: 4
|
85
|
+
summary: Show a info on installed pods
|
86
|
+
test_files:
|
87
|
+
- spec/command/podfile_info_spec.rb
|
88
|
+
- spec/spec_helper.rb
|
89
|
+
has_rdoc:
|