Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

[Command] Remove podfile_info #1602

Closed
wants to merge 2 commits into from

2 participants

Joshua Kalpin Coveralls
Joshua Kalpin
Collaborator

Part of #1589. Should not be merged until the podfile_info plugin is completely finished but it's here as a reminder that it is going away as a core feature.

Joshua Kalpin Kapin [Command] Remove podfile_info
It has now been moved into a plugin and therefore can be removed.
52206c2
Coveralls

Coverage Status

Coverage remained the same when pulling 52206c2 on Kapin:remove_podfile_info into 9e71add on CocoaPods:master.

Coveralls

Coverage Status

Coverage remained the same when pulling ec74775 on Kapin:remove_podfile_info into 9e71add on CocoaPods:master.

Joshua Kalpin
Collaborator

@irrationalfab and @alloy once the plugin is working (i.e. the gemspec and license look right) I think we can merge this in.

Joshua Kalpin Kapin closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 16, 2013
  1. Joshua Kalpin

    [Command] Remove podfile_info

    Kapin authored
    It has now been moved into a plugin and therefore can be removed.
  2. Joshua Kalpin

    [CHANGELOG] Update

    Kapin authored
This page is out of date. Refresh to see the latest.
8 CHANGELOG.md
View
@@ -4,6 +4,14 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
## Master
+###### Refactor
+
+* The command `podfile_info` is now a plugin offered by CocoaPods.
+ As a result, the command has been removed from CocoaPods.
+ [Joshua Kalpin](https://github.com/Kapin)
+ [#1602](https://github.com/CocoaPods/CocoaPods/pull/1602)
+ [#1589](https://github.com/CocoaPods/CocoaPods/issues/1589)
+
###### Bug Fixes
* Fixed a bug which resulted in `pod lib lint` not being able to find the
1  lib/cocoapods/command.rb
View
@@ -13,7 +13,6 @@ class Command < CLAide::Command
require 'cocoapods/command/lib'
require 'cocoapods/command/list'
require 'cocoapods/command/outdated'
- require 'cocoapods/command/podfile_info'
require 'cocoapods/command/project'
require 'cocoapods/command/push'
require 'cocoapods/command/repo'
93 lib/cocoapods/command/podfile_info.rb
View
@@ -1,93 +0,0 @@
-module Pod
- class Command
-
- class PodfileInfo < Command
-
- self.summary = 'Shows information on installed Pods.'
- self.description = <<-DESC
- Shows information on installed Pods in current Project.
- If optional `PODFILE_PATH` provided, the info will be shown for
- that specific Podfile
- DESC
- self.arguments = '[PODFILE_PATH]'
-
- def self.options
- [
- ["--all", "Show information about all Pods with dependencies that are used in a project"],
- ["--md", "Output information in Markdown format"]
- ].concat(super)
- end
-
- 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!
- lockfile = config.lockfile
- pods = lockfile.pod_names
- if @info_all
- deps = lockfile.dependencies.map{|d| d.name}
- pods = (deps + pods).uniq
- end
- elsif @podfile_path
- podfile = Pod::Podfile.from_file(@podfile_path)
- pods = pods_from_podfile(podfile)
- else
- verify_podfile_exists!
- podfile = config.podfile
- pods = pods_from_podfile(podfile)
- end
-
- UI.puts "\nPods used:\n".yellow unless @info_in_md
- pods_info(pods, @info_in_md)
- end
-
- def pods_from_podfile(podfile)
- pods = []
- podfile.root_target_definitions.each {|e| h = e.to_hash; pods << h['dependencies'] if h['dependencies']}
- pods.flatten!
- pods.collect! {|pod| (pod.is_a?(Hash)) ? pod.keys.first : pod}
- end
-
- 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)
- if spec
- info = {}
- 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, :license])
-
- pods.each do |pod|
- if in_md
- UI.puts "* [#{pod[:name]}](#{pod[:homepage]}) [#{pod[:license][:type]}] - #{pod[:summary]}"
- else
- UI.puts "- #{pod[:name]} [#{pod[:license][:type]}]".green
- UI.puts " #{pod[:summary]}\n\n"
- end
- end
- end
-
- end
-
- end
-end
34 spec/functional/command/podfile_info_spec.rb
View
@@ -1,34 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-
-module Pod
- describe Command::PodfileInfo do
- extend SpecHelper::TemporaryRepos
-
- before do
- @test_source = Source.new(fixture('spec-repos/test_repo'))
- Source::Aggregate.any_instance.stubs(:all).returns([@test_source])
- SourcesManager.updated_search_index = nil
- end
-
- it "tells the user pods info from Podfile" do
-
- file = temporary_directory + 'Podfile'
-
- text = <<-PODFILE
- platform :ios
- pod 'BananaLib'
- pod 'JSONKit'
- PODFILE
- File.open(file, 'w') {|f| f.write(text) }
-
- Dir.chdir(temporary_directory) do
- output = run_command('podfile-info')
- output.should.include? '- BananaLib'
- output.should.include? 'Chunky bananas!'
- output.should.include? '- JSONKit'
- output.should.include? 'A Very High Performance Objective-C JSON Library.'
- end
- end
- end
-end
-
Something went wrong with that request. Please try again.