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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dd9d62c2e1e3efd549983f97f84d4a31363c56a6
4
- data.tar.gz: a55410493e431904e3b175e2b4527e9be4142234
3
+ metadata.gz: 9fc4fe49fc22093aa7d045638f3af073db82fea9
4
+ data.tar.gz: b7aefbdd73fd2342ed4c1bf8317d5b55aeef044c
5
5
  SHA512:
6
- metadata.gz: d696ffa9677951eb65e51b75c50ea213feff468ce5de9296faccc80f084ab7c5ae7e84a56e113c998b8be7a7a2f8db05789ec2f1280356971ad3f534dc6aa6ca
7
- data.tar.gz: 38647dd89b80dc21ce3965f33d20f91d9ff7890c9551c2013a654e02e6efcdf8631e90b11de9dd49059ab4adaa2209886f48583ba0a8ad70b69d392ab7dcdce4
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
@@ -0,0 +1,3 @@
1
+ inherit_from:
2
+ - rubocop-todo.yml
3
+ - .rubocop-cocoapods.yml
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
- # This is what 10.8.x comes with and we want to support that.
4
- - RVM_RUBY_VERSION=system NOEXEC_DISABLE=1 RUBY_VERSION_SPECIFIC='sudo ln -s /usr/bin/llvm-gcc-4.2 /usr/bin/gcc-4.2' SSL_CERT_FILE=/usr/local/share/cacert.pem GIT_AUTHOR_NAME=dealforest GIT_AUTHOR_EMAIL=dealforest.net@gmail.com PYTHONPATH=/usr/local/lib/python2.7/site-packages
5
- - RVM_RUBY_VERSION=2.0.0-p247 NOEXEC_DISABLE=1 RUBY_VERSION_SPECIFIC='sudo gem install bundler --no-ri --no-rdoc' GIT_AUTHOR_NAME=dealforest GIT_AUTHOR_EMAIL=dealforest@gmail.com PYTHONPATH=/usr/local/lib/python2.7/site-packages
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 && rvm use $RVM_RUBY_VERSION
9
- install: eval $RUBY_VERSION_SPECIFIC && rake bootstrap[use_bundle_dir]
10
- script: bundle exec rake spec:ci
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', '~> 0.11.4'
10
- gem 'rake'
11
- gem 'prettybacon', :git => 'https://github.com/irrationalfab/PrettyBacon.git', :branch => 'master'
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
- [![Build Status](https://secure.travis-ci.org/dealforest/cocoapods-browser.png?branch=master)](http://travis-ci.org/dealforest/cocoapods-browser)
3
+ [![Build Status](http://img.shields.io/travis/dealforest/cocoapods-browser.svg?style=flat)](http://travis-ci.org/dealforestcocoapods-browser)
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)](http://travis-ci.org/dealforest/cocoapods-browser)
6
+ [![Gem](http://img.shields.io/gem/v/cocoapods-browser.svg?style=flat)](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
- require "bundler/gem_tasks"
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 args[:use_bundle_dir?]
9
- sh "bundle install --path ./travis_bundle_dir"
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
- sh "bundle install"
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
- namespace :spec do
16
- desc "Runs all the specs"
17
- task :ci do
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
- task :default => "spec:ci"
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
@@ -1,5 +1,5 @@
1
1
  module Cocoapods
2
2
  module Browser
3
- VERSION = '0.1.1'
3
+ VERSION = '0.1.2'
4
4
  end
5
5
  end
@@ -1,4 +1,4 @@
1
- require "cocoapods/browser/version"
1
+ require 'cocoapods/browser/version'
2
2
 
3
3
  module Cocoapods
4
4
  module Browser
@@ -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
- [ '--spec', 'Open the podspec in the browser.' ],
15
- [ '--release', 'Open the releases in the browser.' ],
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
- # update_specs_repos
35
+ # update_specs_repos
36
36
  @names.each do |name|
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
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
- unless config.skip_repo_update?
50
- UI.section 'Updating spec repositories' do
51
- SourcesManager.update
52
- end
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
- "%-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
- ]
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|^https?://github.com/|
102
- "%s/tree/master/%s.podspec" % [ url, spec.name ]
103
- elsif @release && url =~ %r|^https?://github.com/|
104
- "%s/releases" % [ url ]
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
@@ -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
- describe "CLAide" do
8
- it "registers it self" do
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 "presents the help if no name is provided" do
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 "runs" do
17
+ it 'runs' do
20
18
  Config.instance.skip_repo_update = false
21
- command = Pod::Command.parse(['browse', 'iOS-FakeWeb'])
22
- # command.expects(:update_specs_repos)
23
- command.expects(:spec_with_name)
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
- $:.unshift((ROOT + 'lib').to_s)
3
- $:.unshift((ROOT + 'spec').to_s)
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 = '', actions = [])
36
- @warnings << "#{message}\n" end
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.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-02-01 00:00:00.000000000 Z
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.0
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