cocoapods-podfile_info 0.0.2 → 1.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 165604354f03e146828611b2d89ca1a5e7470f6a
4
- data.tar.gz: f278b3bb0d32906025ca2a612f5756e98676fb08
3
+ metadata.gz: 4b0be0aeda1d2cf0746cc61d0c17ae6e5198e408
4
+ data.tar.gz: b7e866b54fc6f410842bdb2cf7dd54b04a8138ef
5
5
  SHA512:
6
- metadata.gz: bff9b4f09a9d2151bb25b06f7ab2e66523cbb3d5e56b9b89428850fa557d82c0ae1a5facc8a8e9b47afef8ff1889a5d84307227f5a1bdcf64bf2aa410219a5e2
7
- data.tar.gz: 78606206426527d64913308c72b18b42ac2e879915549acd43ac3c9c83835d314af9a124e376a1de96dd108b686c85a0bdf6d4a56b29b64bc247f677cae6505f
6
+ metadata.gz: 7a8b395ab38944d88b0953090d33b2c0e0e7373463ed24fd1053db27834277a50ddc3057c5bb50dc0ea10bd84f30856622ced0c9ce9d7034931a5f06575176fa
7
+ data.tar.gz: 881fc0ac867ceb0b6ea637eca094216996328af1c755849a783033ff2a5f4ac9ea5b134be55ec984c6a4de5bce1eacdc6962c8d736f4b9d7024ff5c1bdb425be
@@ -15,14 +15,18 @@ module Pod
15
15
  def self.options
16
16
  [
17
17
  ["--all", "Show information about all Pods with dependencies that are used in a project"],
18
- ["--md", "Output information in Markdown format"]
18
+ ["--md", "Output information in Markdown format"],
19
+ ["--csv", "Output information in CSV format"]
19
20
  ].concat(super)
20
21
  end
21
22
 
22
23
  def initialize(argv)
23
24
  @info_all = argv.flag?('all')
24
- @info_in_md = argv.flag?('md')
25
- @info_license = argv.flag?('license')
25
+
26
+ @type = :text
27
+ @type = :md if argv.flag?('md')
28
+ @type = :csv if argv.flag?('csv')
29
+
26
30
  @podfile_path = argv.shift_argument
27
31
  super
28
32
  end
@@ -49,7 +53,7 @@ module Pod
49
53
  end
50
54
 
51
55
  UI.puts "\nPods used:\n".yellow unless @info_in_md
52
- pods_info(pods, @info_in_md)
56
+ pods_info(pods, @type)
53
57
  end
54
58
 
55
59
  def pods_from_podfile(podfile)
@@ -59,7 +63,7 @@ module Pod
59
63
  pods.collect! {|pod| (pod.is_a?(Hash)) ? pod.keys.first : pod}
60
64
  end
61
65
 
62
- def pods_info_hash(pods, keys=[:name, :homepage, :summary, :license])
66
+ def pods_info_hash(pods, keys=[:name, :version, :homepage, :summary, :license])
63
67
  pods_info = []
64
68
  pods.each do |pod|
65
69
  spec = (Pod::SourcesManager.search_by_name(pod).first rescue nil)
@@ -72,14 +76,18 @@ module Pod
72
76
  pods_info
73
77
  end
74
78
 
75
- def pods_info(pods, in_md=false)
76
- pods = pods_info_hash(pods, [:name, :homepage, :summary, :license])
79
+ def pods_info(pods, type)
80
+ pods = pods_info_hash(pods, [:name, :version, :homepage, :summary, :license])
81
+ UI.puts "name,version,homepage,summary,license" if type == :csv
77
82
 
78
83
  pods.each do |pod|
79
- if in_md
80
- UI.puts "* [#{pod[:name]}](#{pod[:homepage]}) [#{pod[:license][:type]}] - #{pod[:summary]}"
84
+ case type
85
+ when :md
86
+ UI.puts "* [#{pod[:name]} - #{pod[:version]}](#{pod[:homepage]}) [#{pod[:license][:type]}] - #{pod[:summary]}"
87
+ when :csv
88
+ UI.puts "#{pod[:name]},#{pod[:version]},#{pod[:homepage]},\"#{pod[:summary]}\",\"#{pod[:license][:type]}\""
81
89
  else
82
- UI.puts "- #{pod[:name]} [#{pod[:license][:type]}]".green
90
+ UI.puts "- #{pod[:name]} (#{pod[:version]}) [#{pod[:license][:type]}]".green
83
91
  UI.puts " #{pod[:summary]}\n\n"
84
92
  end
85
93
  end
@@ -1,3 +1,3 @@
1
1
  module PodfileInfo
2
- VERSION = '0.0.2'
2
+ VERSION = '1.0.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-podfile_info
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taras Kalapun
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-11-22 00:00:00.000000000 Z
12
+ date: 2015-04-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler