cocoapods-browser 0.1.1 → 0.1.2
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 +4 -4
- data/.rubocop-cocoapods.yml +74 -0
- data/.rubocop.yml +3 -0
- data/.travis.yml +22 -6
- data/Gemfile +12 -4
- data/README.md +4 -1
- data/Rakefile +54 -13
- data/lib/cocoapods/browser/version.rb +1 -1
- data/lib/cocoapods/browser.rb +1 -1
- data/lib/pod/command/browse.rb +25 -25
- data/rubocop-todo.yml +18 -0
- data/spec/command/browse_spec.rb +9 -14
- data/spec/spec_helper.rb +6 -5
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9fc4fe49fc22093aa7d045638f3af073db82fea9
|
4
|
+
data.tar.gz: b7aefbdd73fd2342ed4c1bf8317d5b55aeef044c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95b477fe184fd9d134ed71f52beae3d461b682d5ecfb72b7e48dc4d63c263f3ff1404d658eeec0b1ac2891564b1f7fe4ffb4b6568c2e33b826d48aecf1dc0f1b
|
7
|
+
data.tar.gz: e2e219d1936b782e6401a241ce39b7f66a3e6a4239c5ea86ac357c2f71d5400416b16ecdbffa7ddb5b791254b7dc46688f71a3cd8a719f7195a55816ab6c0eb7
|
@@ -0,0 +1,74 @@
|
|
1
|
+
AllCops:
|
2
|
+
Include:
|
3
|
+
- Rakefile
|
4
|
+
- Gemfile
|
5
|
+
- ./*.gemspec
|
6
|
+
Exclude:
|
7
|
+
- spec/fixtures/**/*
|
8
|
+
|
9
|
+
# At the moment not ready to be used
|
10
|
+
# https://github.com/bbatsov/rubocop/issues/947
|
11
|
+
Documentation:
|
12
|
+
Enabled: false
|
13
|
+
|
14
|
+
#- CocoaPods -----------------------------------------------------------------#
|
15
|
+
|
16
|
+
# We adopted raise instead of fail.
|
17
|
+
SignalException:
|
18
|
+
EnforcedStyle: only_raise
|
19
|
+
|
20
|
+
# They are idiomatic
|
21
|
+
AssignmentInCondition:
|
22
|
+
Enabled: false
|
23
|
+
|
24
|
+
# Allow backticks
|
25
|
+
AsciiComments:
|
26
|
+
Enabled: false
|
27
|
+
|
28
|
+
# Indentation clarifies logic branches in implementations
|
29
|
+
IfUnlessModifier:
|
30
|
+
Enabled: false
|
31
|
+
|
32
|
+
# No enforced convention here.
|
33
|
+
SingleLineBlockParams:
|
34
|
+
Enabled: false
|
35
|
+
|
36
|
+
# We only add the comment when needed.
|
37
|
+
Encoding:
|
38
|
+
Enabled: false
|
39
|
+
|
40
|
+
# Having these make it easier to *not* forget to add one when adding a new
|
41
|
+
# value and you can simply copy the previous line.
|
42
|
+
TrailingComma:
|
43
|
+
EnforcedStyleForMultiline: comma
|
44
|
+
|
45
|
+
#- CocoaPods support for Ruby 1.8.7 ------------------------------------------#
|
46
|
+
|
47
|
+
HashSyntax:
|
48
|
+
EnforcedStyle: hash_rockets
|
49
|
+
|
50
|
+
Lambda:
|
51
|
+
Enabled: false
|
52
|
+
|
53
|
+
DotPosition:
|
54
|
+
EnforcedStyle: trailing
|
55
|
+
|
56
|
+
#- CocoaPods specs -----------------------------------------------------------#
|
57
|
+
|
58
|
+
# Allow for `should.match /regexp/`.
|
59
|
+
AmbiguousRegexpLiteral:
|
60
|
+
Exclude:
|
61
|
+
- spec/**/*
|
62
|
+
|
63
|
+
# Allow `object.should == object` syntax.
|
64
|
+
Void:
|
65
|
+
Exclude:
|
66
|
+
- spec/**/*
|
67
|
+
|
68
|
+
ClassAndModuleChildren:
|
69
|
+
Exclude:
|
70
|
+
- spec/**/*
|
71
|
+
|
72
|
+
UselessComparison:
|
73
|
+
Exclude:
|
74
|
+
- spec/**/*
|
data/.rubocop.yml
ADDED
data/.travis.yml
CHANGED
@@ -1,10 +1,26 @@
|
|
1
|
+
# Sets Travis to run the Ruby specs on OS X machines which are required to
|
2
|
+
# build the native extensions of Xcodeproj.
|
3
|
+
#
|
1
4
|
language: objective-c
|
5
|
+
|
2
6
|
env:
|
3
|
-
|
4
|
-
- RVM_RUBY_VERSION=
|
5
|
-
|
7
|
+
- RVM_RUBY_VERSION=system
|
8
|
+
- RVM_RUBY_VERSION=ruby-2.0.0-p247
|
9
|
+
|
10
|
+
addons:
|
11
|
+
code_climate:
|
12
|
+
repo_token: 6806682857c395155713502a40d890d1d694191bb29e53ac37d435d4fea760eb
|
13
|
+
|
6
14
|
before_install:
|
15
|
+
- export LANG=en_US.UTF-8
|
7
16
|
- curl http://curl.haxx.se/ca/cacert.pem -o /usr/local/share/cacert.pem
|
8
|
-
- source ~/.rvm/scripts/rvm
|
9
|
-
|
10
|
-
|
17
|
+
- source ~/.rvm/scripts/rvm
|
18
|
+
- if [[ $RVM_RUBY_VERSION != 'system' ]]; then rvm install $RVM_RUBY_VERSION; fi
|
19
|
+
- rvm use $RVM_RUBY_VERSION
|
20
|
+
- if [[ $RVM_RUBY_VERSION == 'system' ]]; then export ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future; fi
|
21
|
+
- if [[ $RVM_RUBY_VERSION == 'system' ]]; then sudo gem install bundler --no-ri --no-rdoc; else gem install bundler --no-ri --no-rdoc; fi
|
22
|
+
|
23
|
+
install:
|
24
|
+
- bundle install --without=debugging documentation --path ./travis_bundle_dir
|
25
|
+
|
26
|
+
script: bundle exec rake spec
|
data/Gemfile
CHANGED
@@ -3,10 +3,18 @@ source 'https://rubygems.org'
|
|
3
3
|
gemspec
|
4
4
|
|
5
5
|
group :development do
|
6
|
-
gem 'cocoapods'
|
6
|
+
gem 'cocoapods', :git => "https://github.com/CocoaPods/CocoaPods.git", :branch => 'master'
|
7
|
+
gem 'claide', :git => "https://github.com/CocoaPods/CLAide.git", :branch => 'master'
|
7
8
|
gem 'bacon'
|
8
9
|
gem 'mocha-on-bacon'
|
9
|
-
gem 'mocha'
|
10
|
-
gem '
|
11
|
-
|
10
|
+
gem 'mocha'
|
11
|
+
gem 'prettybacon'
|
12
|
+
|
13
|
+
if RUBY_VERSION >= '1.9.3'
|
14
|
+
gem 'rubocop'
|
15
|
+
|
16
|
+
gem 'codeclimate-test-reporter', :require => nil
|
17
|
+
# Bug: https://github.com/colszowka/simplecov/issues/281
|
18
|
+
gem 'simplecov', '0.7.1'
|
19
|
+
end
|
12
20
|
end
|
data/README.md
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
# Cocoapods::Browser
|
2
2
|
|
3
|
-
[](http://travis-ci.org/dealforestcocoapods-browser)
|
4
|
+
[](https://codeclimate.com/github/dealforest/cocoapods-browser)
|
5
|
+
[](http://travis-ci.org/dealforest/cocoapods-browser)
|
6
|
+
[](http://rubygems.org/gems/cocoapods-browser)
|
4
7
|
|
5
8
|
CocoaPods plugin to open a pods homepage in the browser.
|
6
9
|
|
data/Rakefile
CHANGED
@@ -1,22 +1,63 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
def specs(dir)
|
4
|
-
FileList["spec/#{dir}/*_spec.rb"].shuffle.join(' ')
|
5
|
-
end
|
1
|
+
# Bootstrap
|
2
|
+
#-----------------------------------------------------------------------------#
|
6
3
|
|
7
4
|
task :bootstrap, :use_bundle_dir? do |t, args|
|
8
|
-
if
|
9
|
-
|
5
|
+
if system('which bundle')
|
6
|
+
if args[:use_bundle_dir?]
|
7
|
+
sh 'bundle install --path ./travis_bundle_dir'
|
8
|
+
else
|
9
|
+
sh 'bundle install'
|
10
|
+
end
|
10
11
|
else
|
11
|
-
|
12
|
+
$stderr.puts "\033[0;31m" \
|
13
|
+
"[!] Please install the bundler gem manually:\n" \
|
14
|
+
' $ [sudo] gem install bundler' \
|
15
|
+
"\e[0m"
|
16
|
+
exit 1
|
12
17
|
end
|
13
18
|
end
|
14
19
|
|
15
|
-
|
16
|
-
|
17
|
-
|
20
|
+
begin
|
21
|
+
|
22
|
+
require 'bundler/gem_tasks'
|
23
|
+
|
24
|
+
task :default => 'spec'
|
25
|
+
|
26
|
+
# Spec
|
27
|
+
#-----------------------------------------------------------------------------#
|
28
|
+
|
29
|
+
desc 'Runs all the specs'
|
30
|
+
task :spec do
|
31
|
+
puts "\033[0;32mUsing #{`ruby --version`}\033[0m"
|
32
|
+
start_time = Time.now
|
18
33
|
sh "bundle exec bacon #{specs('**')}"
|
34
|
+
duration = Time.now - start_time
|
35
|
+
puts "Tests completed in #{duration}s"
|
36
|
+
Rake::Task['rubocop'].invoke
|
19
37
|
end
|
20
|
-
end
|
21
38
|
|
22
|
-
|
39
|
+
def specs(dir)
|
40
|
+
FileList["spec/#{dir}/*_spec.rb"].shuffle.join(' ')
|
41
|
+
end
|
42
|
+
|
43
|
+
# Rubocop
|
44
|
+
#-----------------------------------------------------------------------------#
|
45
|
+
|
46
|
+
desc 'Checks code style'
|
47
|
+
task :rubocop do
|
48
|
+
if RUBY_VERSION >= '1.9.3'
|
49
|
+
require 'rubocop'
|
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'
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
rescue LoadError
|
59
|
+
$stderr.puts "\033[0;31m" \
|
60
|
+
'[!] Some Rake tasks haven been disabled because the environment' \
|
61
|
+
' couldn’t be loaded. Be sure to run `rake bootstrap` first.' \
|
62
|
+
"\e[0m"
|
63
|
+
end
|
data/lib/cocoapods/browser.rb
CHANGED
data/lib/pod/command/browse.rb
CHANGED
@@ -7,12 +7,12 @@ module Pod
|
|
7
7
|
Opens the homepage of a pod in the browser.
|
8
8
|
DESC
|
9
9
|
|
10
|
-
self.arguments = '[NAME]'
|
10
|
+
self.arguments = [['[NAME]', :optional]]
|
11
11
|
|
12
12
|
def self.options
|
13
13
|
[
|
14
|
-
[
|
15
|
-
[
|
14
|
+
['--spec', 'Open the podspec in the browser.'],
|
15
|
+
['--release', 'Open the releases in the browser.'],
|
16
16
|
].concat(super)
|
17
17
|
end
|
18
18
|
|
@@ -32,24 +32,25 @@ module Pod
|
|
32
32
|
executable :open
|
33
33
|
|
34
34
|
def run
|
35
|
-
#
|
35
|
+
# update_specs_repos
|
36
36
|
@names.each do |name|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
37
|
+
specs = specs_with_name(name)
|
38
|
+
next unless specs
|
39
|
+
|
40
|
+
specs.each do |spec|
|
41
|
+
UI.title "Opening #{spec.name}" do
|
42
|
+
url = pick_open_url(spec)
|
43
|
+
open!(url)
|
43
44
|
end
|
44
45
|
end
|
45
46
|
end
|
46
47
|
end
|
47
48
|
|
48
49
|
def update_specs_repos
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
50
|
+
return if config.skip_repo_update?
|
51
|
+
|
52
|
+
UI.section 'Updating spec repositories' do
|
53
|
+
SourcesManager.update
|
53
54
|
end
|
54
55
|
end
|
55
56
|
|
@@ -88,25 +89,24 @@ module Pod
|
|
88
89
|
end
|
89
90
|
|
90
91
|
def formated_name(pod)
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
92
|
+
format('%-40s (Watchers: %5s, Forks: %5s, Pushed: %s)',
|
93
|
+
pod.name.green,
|
94
|
+
pod.github_watchers || '-',
|
95
|
+
pod.github_forks || '-',
|
96
|
+
pod.github_last_activity.try(:yellow) || '-',
|
97
|
+
)
|
97
98
|
end
|
98
99
|
|
99
100
|
def pick_open_url(spec)
|
100
101
|
url = spec.homepage
|
101
|
-
if @spec && url =~ %r
|
102
|
-
|
103
|
-
elsif @release && url =~ %r
|
104
|
-
|
102
|
+
if @spec && url =~ %r{^https?://github.com/}
|
103
|
+
format('%s/tree/master/%s.podspec', url, spec.name)
|
104
|
+
elsif @release && url =~ %r{^https?://github.com/}
|
105
|
+
format('%s/releases', url)
|
105
106
|
else
|
106
107
|
url
|
107
108
|
end
|
108
109
|
end
|
109
|
-
|
110
110
|
end
|
111
111
|
end
|
112
112
|
end
|
data/rubocop-todo.yml
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# This configuration was generated by `rubocop --auto-gen-config`
|
2
|
+
# on 2014-05-19 20:21:03 +0200 using RuboCop version 0.21.0.
|
3
|
+
# The point is for the user to remove these configuration records
|
4
|
+
# one by one as the offenses are removed from the code base.
|
5
|
+
# Note that changes in the inspected code, or installation of new
|
6
|
+
# versions of RuboCop, may require this file to be generated again.
|
7
|
+
|
8
|
+
# Offense count: 1
|
9
|
+
LineLength:
|
10
|
+
Max: 82
|
11
|
+
|
12
|
+
# Offense count: 1
|
13
|
+
MethodLength:
|
14
|
+
Max: 30
|
15
|
+
|
16
|
+
# Offense count: 1
|
17
|
+
CyclomaticComplexity:
|
18
|
+
Max: 12
|
data/spec/command/browse_spec.rb
CHANGED
@@ -1,31 +1,26 @@
|
|
1
1
|
require File.expand_path('../../spec_helper', __FILE__)
|
2
2
|
|
3
|
-
module Pod
|
4
|
-
|
3
|
+
module Pod
|
5
4
|
describe Command::Browse do
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
Command.parse(%w{ browse }).should.be.instance_of Command::Browse
|
5
|
+
describe 'CLAide' do
|
6
|
+
it 'registers it self' do
|
7
|
+
Command.parse(%w( browse )).should.be.instance_of Command::Browse
|
10
8
|
end
|
11
9
|
|
12
|
-
it
|
10
|
+
it 'presents the help if no name is provided' do
|
13
11
|
command = Pod::Command.parse(['browse'])
|
14
12
|
should.raise CLAide::Help do
|
15
13
|
command.validate!
|
16
14
|
end.message.should.match /A Pod name is required/
|
17
15
|
end
|
18
16
|
|
19
|
-
it
|
17
|
+
it 'runs' do
|
20
18
|
Config.instance.skip_repo_update = false
|
21
|
-
command = Pod::Command.parse(
|
22
|
-
#
|
23
|
-
command.expects(:
|
19
|
+
command = Pod::Command.parse(%w(browse iOS-FakeWeb))
|
20
|
+
# command.expects(:update_specs_repos)
|
21
|
+
command.expects(:specs_with_name)
|
24
22
|
command.run
|
25
23
|
end
|
26
24
|
end
|
27
|
-
|
28
25
|
end
|
29
|
-
|
30
26
|
end
|
31
|
-
|
data/spec/spec_helper.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
ROOT = Pathname.new(File.expand_path('../../', __FILE__))
|
2
|
-
|
3
|
-
|
2
|
+
$LOAD_PATH.unshift((ROOT + 'lib').to_s)
|
3
|
+
$LOAD_PATH.unshift((ROOT + 'spec').to_s)
|
4
4
|
|
5
5
|
require 'bundler/setup'
|
6
6
|
require 'bacon'
|
@@ -13,7 +13,6 @@ require 'cocoapods_plugin'
|
|
13
13
|
#-----------------------------------------------------------------------------#
|
14
14
|
|
15
15
|
module Pod
|
16
|
-
|
17
16
|
# Disable the wrapping so the output is deterministic in the tests.
|
18
17
|
#
|
19
18
|
UI.disable_wrap = true
|
@@ -32,8 +31,10 @@ module Pod
|
|
32
31
|
@output << "#{message}\n"
|
33
32
|
end
|
34
33
|
|
35
|
-
def warn(message = '',
|
36
|
-
@warnings << "#{message}\n"
|
34
|
+
def warn(message = '', _actions = [])
|
35
|
+
@warnings << "#{message}\n"
|
36
|
+
end
|
37
|
+
|
37
38
|
def print(message)
|
38
39
|
@output << message
|
39
40
|
end
|
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.2
|
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-
|
11
|
+
date: 2014-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -60,6 +60,8 @@ extensions: []
|
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
62
|
- ".gitignore"
|
63
|
+
- ".rubocop-cocoapods.yml"
|
64
|
+
- ".rubocop.yml"
|
63
65
|
- ".travis.yml"
|
64
66
|
- Gemfile
|
65
67
|
- LICENSE.txt
|
@@ -70,6 +72,7 @@ files:
|
|
70
72
|
- lib/cocoapods/browser/version.rb
|
71
73
|
- lib/cocoapods_plugin.rb
|
72
74
|
- lib/pod/command/browse.rb
|
75
|
+
- rubocop-todo.yml
|
73
76
|
- spec/command/browse_spec.rb
|
74
77
|
- spec/spec_helper.rb
|
75
78
|
homepage: https://github.com/dealforest/cocoapods-browser
|
@@ -92,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
92
95
|
version: '0'
|
93
96
|
requirements: []
|
94
97
|
rubyforge_project:
|
95
|
-
rubygems_version: 2.2.
|
98
|
+
rubygems_version: 2.2.2
|
96
99
|
signing_key:
|
97
100
|
specification_version: 4
|
98
101
|
summary: Open a pods homepage in the browser
|