cocoapods-browser 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cocoapods/browser/version.rb +1 -1
- data/lib/pod/command/browse.rb +40 -27
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd9d62c2e1e3efd549983f97f84d4a31363c56a6
|
4
|
+
data.tar.gz: a55410493e431904e3b175e2b4527e9be4142234
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d696ffa9677951eb65e51b75c50ea213feff468ce5de9296faccc80f084ab7c5ae7e84a56e113c998b8be7a7a2f8db05789ec2f1280356971ad3f534dc6aa6ca
|
7
|
+
data.tar.gz: 38647dd89b80dc21ce3965f33d20f91d9ff7890c9551c2013a654e02e6efcdf8631e90b11de9dd49059ab4adaa2209886f48583ba0a8ad70b69d392ab7dcdce4
|
data/lib/pod/command/browse.rb
CHANGED
@@ -34,11 +34,12 @@ module Pod
|
|
34
34
|
def run
|
35
35
|
# update_specs_repos
|
36
36
|
@names.each do |name|
|
37
|
-
if
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
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
|
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
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
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.
|
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
|
11
|
+
date: 2014-02-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|