Commit 529cce54 authored by Fabio Pelosin's avatar Fabio Pelosin

Merge branch 'cmckni3-licenses'

* cmckni3-licenses:
  Pretty podfile-info && add license note to changelog
  Just add license as a key to get from the specification
  Move license info into podfile-info command
  Add licenses command to pod cli
parents 4c729341 47c4e668
......@@ -2,6 +2,11 @@
To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides/installing_cocoapods.html).
## Master
* Added license information to `podfile-info` subcommand.
[#1219](https://github.com/CocoaPods/CocoaPods/issues/1219)
## 0.22.3
[CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.22.2...0.22.3)
......
......@@ -54,6 +54,7 @@ GIT
coveralls (0.6.7)
multi_json (~> 1.3)
rest-client
simplecov (>= 0.7)
term-ansicolor
thor
......@@ -92,7 +93,7 @@ GEM
rb-inotify (>= 0.9)
rb-kqueue (>= 0.2)
metaclass (0.0.1)
method_source (0.8.1)
method_source (0.8.2)
mime-types (1.23)
mocha (0.14.0)
metaclass (~> 0.0.1)
......@@ -123,13 +124,13 @@ GEM
multi_json (~> 1.0)
simplecov-html (~> 0.7.1)
simplecov-html (0.7.1)
slop (3.4.5)
slop (3.4.6)
term-ansicolor (1.2.2)
tins (~> 0.8)
thor (0.18.1)
tins (0.8.3)
yajl-ruby (1.1.0)
yard (0.8.6.2)
yard (0.8.7)
PLATFORMS
ruby
......
......@@ -5,7 +5,7 @@ module Pod
self.summary = 'Shows information on installed Pods.'
self.description = <<-DESC
Shows information on installed Pods in current Project.
Shows information on installed Pods in current Project.
If optional `PODFILE_PATH` provided, the info will be shown for
that specific Podfile
DESC
......@@ -21,13 +21,14 @@ module Pod
def initialize(argv)
@info_all = argv.flag?('all')
@info_in_md = argv.flag?('md')
@info_license = argv.flag?('license')
@podfile_path = argv.shift_argument
super
end
def run
use_podfile = (@podfile_path || !config.lockfile)
if !use_podfile
UI.puts "Using lockfile" if config.verbose?
verify_lockfile_exists!
......@@ -57,7 +58,7 @@ module Pod
pods.collect! {|pod| (pod.is_a?(Hash)) ? pod.keys.first : pod}
end
def pods_info_hash(pods, keys=[:name, :homepage, :summary])
def pods_info_hash(pods, keys=[:name, :homepage, :summary, :license])
pods_info = []
pods.each do |pod|
spec = (Pod::SourcesManager.search_by_name(pod).first rescue nil)
......@@ -66,26 +67,27 @@ module Pod
keys.each { |k| info[k] = spec.specification.send(k) }
pods_info << info
else
end
end
pods_info
end
def pods_info(pods, in_md=false)
pods = pods_info_hash(pods, [:name, :homepage, :summary])
pods = pods_info_hash(pods, [:name, :homepage, :summary, :license])
pods.each do |pod|
pods.each do |pod|
if in_md
UI.puts "* [#{pod[:name]}](#{pod[:homepage]}) - #{pod[:summary]}"
UI.puts "* [#{pod[:name]}](#{pod[:homepage]}) [#{pod[:license][:type]}] - #{pod[:summary]}"
else
UI.puts "- #{pod[:name]} - #{pod[:summary]}"
UI.puts "- #{pod[:name]} [#{pod[:license][:type]}]".green
UI.puts " #{pod[:summary]}\n\n"
end
end
end
end
end
end
\ No newline at end of file
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment