cocoapods-browser 0.1.2 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/Rakefile +6 -10
- data/lib/cocoapods/browser/version.rb +1 -1
- data/lib/pod/command/browse.rb +36 -27
- data/rubocop-todo.yml +0 -8
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dea7562e021ce37162139b2a05d5a23ee9861e7c
|
4
|
+
data.tar.gz: 23e8c8368a9337e186191767e52428ef94e8eee1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c514613179bcca8cfdb8a8314c3838cbaf8a83ba4332fe8cd8cf3e01e7e0368c0d3acca10162753a5df88a9de6643ddc4818a50466457abddb4908dcbf99079a
|
7
|
+
data.tar.gz: 77234d619a2c55a3a109ad1b35b8e640573c2a74edd37941a8a332c97830313bfef98918dc1bd3704460619b7953015f4323ef70be841bfe860e8b7e7eb72265
|
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# Cocoapods::Browser
|
2
2
|
|
3
|
-
[![Build Status](http://img.shields.io/travis/dealforest/cocoapods-browser.svg?style=flat)](http://travis-ci.org/
|
3
|
+
[![Build Status](http://img.shields.io/travis/dealforest/cocoapods-browser.svg?style=flat)](http://travis-ci.org/dealforest/cocoapods-browser)
|
4
4
|
[![Coverage](https://img.shields.io/codeclimate/coverage/github/dealforest/cocoapods-browser.svg?style=flat)](https://codeclimate.com/github/dealforest/cocoapods-browser)
|
5
|
-
[![Code Climate](http://img.shields.io/codeclimate/github/dealforest/cocoapods-browser.svg?style=flat)](
|
5
|
+
[![Code Climate](http://img.shields.io/codeclimate/github/dealforest/cocoapods-browser.svg?style=flat)](https://codeclimate.com/github/dealforest/cocoapods-browser)
|
6
6
|
[![Gem](http://img.shields.io/gem/v/cocoapods-browser.svg?style=flat)](http://rubygems.org/gems/cocoapods-browser)
|
7
7
|
|
8
8
|
CocoaPods plugin to open a pods homepage in the browser.
|
data/Rakefile
CHANGED
@@ -33,7 +33,8 @@ begin
|
|
33
33
|
sh "bundle exec bacon #{specs('**')}"
|
34
34
|
duration = Time.now - start_time
|
35
35
|
puts "Tests completed in #{duration}s"
|
36
|
-
|
36
|
+
|
37
|
+
Rake::Task['rubocop'].invoke if RUBY_VERSION >= '1.9.3'
|
37
38
|
end
|
38
39
|
|
39
40
|
def specs(dir)
|
@@ -43,15 +44,10 @@ begin
|
|
43
44
|
# Rubocop
|
44
45
|
#-----------------------------------------------------------------------------#
|
45
46
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
cli = Rubocop::CLI.new
|
51
|
-
result = cli.run(FileList['{spec,lib}/**/*.rb'])
|
52
|
-
abort('RuboCop failed!') unless result == 0
|
53
|
-
else
|
54
|
-
puts '[!] Ruby > 1.9 is required to run style checks'
|
47
|
+
if RUBY_VERSION >= '1.9.3'
|
48
|
+
require 'rubocop/rake_task'
|
49
|
+
RuboCop::RakeTask.new(:rubocop) do |task|
|
50
|
+
task.patterns = %w(lib/**/*.rb spec/**/*.rb)
|
55
51
|
end
|
56
52
|
end
|
57
53
|
|
data/lib/pod/command/browse.rb
CHANGED
@@ -13,13 +13,15 @@ module Pod
|
|
13
13
|
[
|
14
14
|
['--spec', 'Open the podspec in the browser.'],
|
15
15
|
['--release', 'Open the releases in the browser.'],
|
16
|
+
['--info', 'Show more pods information of github (very slowly)'],
|
16
17
|
].concat(super)
|
17
18
|
end
|
18
19
|
|
19
20
|
def initialize(argv)
|
20
|
-
@spec
|
21
|
+
@spec = argv.flag?('spec')
|
21
22
|
@release = argv.flag?('release')
|
22
|
-
@
|
23
|
+
@info = argv.flag?('info')
|
24
|
+
@names = argv.arguments! unless argv.arguments.empty?
|
23
25
|
super
|
24
26
|
end
|
25
27
|
|
@@ -38,7 +40,7 @@ module Pod
|
|
38
40
|
next unless specs
|
39
41
|
|
40
42
|
specs.each do |spec|
|
41
|
-
UI.
|
43
|
+
UI.message "Opening #{spec.name}" do
|
42
44
|
url = pick_open_url(spec)
|
43
45
|
open!(url)
|
44
46
|
end
|
@@ -63,24 +65,7 @@ module Pod
|
|
63
65
|
when 1
|
64
66
|
specs << sets.first.specification.root
|
65
67
|
else
|
66
|
-
|
67
|
-
text = ''
|
68
|
-
statistics_provider = Config.instance.spec_statistics_provider
|
69
|
-
sets.each_with_index do |s, i|
|
70
|
-
pod = Specification::Set::Presenter.new(s, statistics_provider)
|
71
|
-
text << " [#{i + 1}]\t#{formated_name(pod)}\n"
|
72
|
-
end
|
73
|
-
UI.puts text
|
74
|
-
print "> (1-#{sets.size}) "
|
75
|
-
input = $stdin.gets
|
76
|
-
raise Interrupt unless input
|
77
|
-
|
78
|
-
range = 1..sets.size
|
79
|
-
input.split(',').each do |i|
|
80
|
-
index = i.try(:strip).to_i
|
81
|
-
specs << sets[index - 1].specification.root if range.include?(index)
|
82
|
-
end
|
83
|
-
raise Informative, 'invalid input value' if specs.empty?
|
68
|
+
specs = interactive_select_sets(sets)
|
84
69
|
end
|
85
70
|
else
|
86
71
|
raise Informative, "Unable to find a podspec named `#{name}`"
|
@@ -88,13 +73,37 @@ module Pod
|
|
88
73
|
specs
|
89
74
|
end
|
90
75
|
|
76
|
+
def interactive_select_sets(sets)
|
77
|
+
UI.puts "found #{sets.size} pods"
|
78
|
+
UI.title 'Please select a pod:'
|
79
|
+
|
80
|
+
statistics_provider = Config.instance.spec_statistics_provider
|
81
|
+
sets.each_with_index do |s, i|
|
82
|
+
pod = Specification::Set::Presenter.new(s, statistics_provider)
|
83
|
+
UI.puts " [#{i + 1}]\t#{formated_name(pod)}\n"
|
84
|
+
end
|
85
|
+
print "> (1-#{sets.size}) "
|
86
|
+
input = $stdin.gets
|
87
|
+
raise Interrupt unless input
|
88
|
+
|
89
|
+
specs = []
|
90
|
+
range = 1..sets.size
|
91
|
+
input.split(',').each do |i|
|
92
|
+
index = i.try(:strip).to_i
|
93
|
+
specs << sets[index - 1].specification.root if range.include?(index)
|
94
|
+
end
|
95
|
+
raise Informative, 'invalid input value' if specs.empty?
|
96
|
+
specs
|
97
|
+
end
|
98
|
+
|
91
99
|
def formated_name(pod)
|
92
|
-
format('
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
100
|
+
text = format('%s (%s)', pod.name.green, pod.license)
|
101
|
+
text << format("\n\tWatchers: %5s, Forks: %5s, Last Pushed: %s",
|
102
|
+
pod.github_watchers || '-',
|
103
|
+
pod.github_forks || '-',
|
104
|
+
pod.github_last_activity.try(:yellow) || '-',
|
105
|
+
) if @info
|
106
|
+
text << "\n\t#{pod.summary}\n"
|
98
107
|
end
|
99
108
|
|
100
109
|
def pick_open_url(spec)
|
data/rubocop-todo.yml
CHANGED
@@ -5,14 +5,6 @@
|
|
5
5
|
# Note that changes in the inspected code, or installation of new
|
6
6
|
# versions of RuboCop, may require this file to be generated again.
|
7
7
|
|
8
|
-
# Offense count: 1
|
9
|
-
LineLength:
|
10
|
-
Max: 82
|
11
|
-
|
12
8
|
# Offense count: 1
|
13
9
|
MethodLength:
|
14
10
|
Max: 30
|
15
|
-
|
16
|
-
# Offense count: 1
|
17
|
-
CyclomaticComplexity:
|
18
|
-
Max: 12
|
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.4
|
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-06-
|
11
|
+
date: 2014-06-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -95,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
95
95
|
version: '0'
|
96
96
|
requirements: []
|
97
97
|
rubyforge_project:
|
98
|
-
rubygems_version: 2.
|
98
|
+
rubygems_version: 2.3.0
|
99
99
|
signing_key:
|
100
100
|
specification_version: 4
|
101
101
|
summary: Open a pods homepage in the browser
|