cocoapods-browser 0.1.0 → 0.1.1

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: aef3a479e4b52dc398606fd1caca3af49c7c8531
4
- data.tar.gz: ae00c65b663b076baf1cb82a33e5f35f55589839
3
+ metadata.gz: dd9d62c2e1e3efd549983f97f84d4a31363c56a6
4
+ data.tar.gz: a55410493e431904e3b175e2b4527e9be4142234
5
5
  SHA512:
6
- metadata.gz: cccc8d9b6efdb8f9efe349eedcd7c9a28beaf90d3169b21efa4dae86275334d1c4df72ec05d024ae1e09020715e59a6f622d3c621b19b6d6243d5cc655e83c92
7
- data.tar.gz: 651db65039c10575fbeae457c880fcc30bd75d2831209cda269142bdc6a01613fdd3a9e7a9f78c47550b39d8ee01e4c19f809076c6a1eb83d66872d51548f7f7
6
+ metadata.gz: d696ffa9677951eb65e51b75c50ea213feff468ce5de9296faccc80f084ab7c5ae7e84a56e113c998b8be7a7a2f8db05789ec2f1280356971ad3f534dc6aa6ca
7
+ data.tar.gz: 38647dd89b80dc21ce3965f33d20f91d9ff7890c9551c2013a654e02e6efcdf8631e90b11de9dd49059ab4adaa2209886f48583ba0a8ad70b69d392ab7dcdce4
@@ -1,5 +1,5 @@
1
1
  module Cocoapods
2
2
  module Browser
3
- VERSION = '0.1.0'
3
+ VERSION = '0.1.1'
4
4
  end
5
5
  end
@@ -34,11 +34,12 @@ module Pod
34
34
  def run
35
35
  # update_specs_repos
36
36
  @names.each do |name|
37
- if spec = spec_with_name(name)
38
- UI.title "Opening #{spec.name}" do
39
- url = pick_open_url(spec)
40
- UI.puts(">>> #{url}")
41
- open!(url)
37
+ if specs = specs_with_name(name)
38
+ specs.each do |spec|
39
+ UI.title "Opening #{spec.name}" do
40
+ url = pick_open_url(spec)
41
+ open!(url)
42
+ end
42
43
  end
43
44
  end
44
45
  end
@@ -52,35 +53,47 @@ module Pod
52
53
  end
53
54
  end
54
55
 
55
- def spec_with_name(name)
56
+ def specs_with_name(name)
57
+ specs = []
56
58
  if set = SourcesManager.search(Dependency.new(name))
57
- set.specification.root
59
+ specs << set.specification.root
58
60
  elsif sets = Pod::SourcesManager.search_by_name(name)
59
- set = begin
60
- case sets.size
61
- when 1
62
- sets.first
63
- when 2..9
64
- UI.title 'Please select pod:'
65
- text = ''
66
- sets.each_with_index do |s, i|
67
- text << " [#{i + 1}] #{s.name}\n"
68
- end
69
- UI.puts text
70
- print "> (1-#{sets.size}) "
71
- input = $stdin.gets
72
- raise Informative, 'Cancelled' unless input
73
- index = input.chop.to_i
74
- raise Informative, 'invalid input value' unless (1..sets.size).include?(index)
75
- sets[index - 1]
76
- else
77
- raise Informative, "Unable to many find a podspec named `#{name}` (#{sets.size})"
61
+ case sets.size
62
+ when 1
63
+ specs << sets.first.specification.root
64
+ else
65
+ UI.title 'Please select a pod:'
66
+ text = ''
67
+ statistics_provider = Config.instance.spec_statistics_provider
68
+ sets.each_with_index do |s, i|
69
+ pod = Specification::Set::Presenter.new(s, statistics_provider)
70
+ text << " [#{i + 1}]\t#{formated_name(pod)}\n"
71
+ end
72
+ UI.puts text
73
+ print "> (1-#{sets.size}) "
74
+ input = $stdin.gets
75
+ raise Interrupt unless input
76
+
77
+ range = 1..sets.size
78
+ input.split(',').each do |i|
79
+ index = i.try(:strip).to_i
80
+ specs << sets[index - 1].specification.root if range.include?(index)
78
81
  end
82
+ raise Informative, 'invalid input value' if specs.empty?
79
83
  end
80
- set.specification.root
81
84
  else
82
85
  raise Informative, "Unable to find a podspec named `#{name}`"
83
86
  end
87
+ specs
88
+ end
89
+
90
+ def formated_name(pod)
91
+ "%-40s (Watchers: %5s, Forks: %5s, Pushed: %s)" % [
92
+ pod.name.green,
93
+ pod.github_watchers || '-',
94
+ pod.github_forks || '-',
95
+ pod.github_last_activity.try(:yellow) || '-',
96
+ ]
84
97
  end
85
98
 
86
99
  def pick_open_url(spec)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-browser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Toshihiro Morimoto
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-26 00:00:00.000000000 Z
11
+ date: 2014-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler