cocoapods-browser 0.0.4 → 0.1.0

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: 9745b0e108aa38280fd465c71ccf39af8bfcbccd
4
- data.tar.gz: ff82d2040bf511284bbd194b22acb9ea1ed71b1f
3
+ metadata.gz: aef3a479e4b52dc398606fd1caca3af49c7c8531
4
+ data.tar.gz: ae00c65b663b076baf1cb82a33e5f35f55589839
5
5
  SHA512:
6
- metadata.gz: 70811835dbf4a7d347e96fb96da5e29b97754f3ec712f93c9db6ac64e78153fa4c7aa44bac996b989810ad19fd28f4cea88f84993dc06da98a1110adb37f11b5
7
- data.tar.gz: 72ffd1877ce2ccb773a1171813c44bee44b281215c6c8c1d743e7f888ad61d7f23909cd1c3577c3ae705cb7fc9ed4782e36dd68ca904f87204a751744d4c00ba
6
+ metadata.gz: cccc8d9b6efdb8f9efe349eedcd7c9a28beaf90d3169b21efa4dae86275334d1c4df72ec05d024ae1e09020715e59a6f622d3c621b19b6d6243d5cc655e83c92
7
+ data.tar.gz: 651db65039c10575fbeae457c880fcc30bd75d2831209cda269142bdc6a01613fdd3a9e7a9f78c47550b39d8ee01e4c19f809076c6a1eb83d66872d51548f7f7
data/README.md CHANGED
@@ -1,5 +1,7 @@
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)
4
+
3
5
  CocoaPods plugin to open a pods homepage in the browser.
4
6
 
5
7
  ## Installation
@@ -20,7 +22,7 @@ Or install it yourself:
20
22
 
21
23
  Open the pod website in a browser like this:
22
24
 
23
- pod browser iOS-FakeWeb
25
+ pod browse iOS-FakeWeb
24
26
 
25
27
  ## Contributing
26
28
 
@@ -1,5 +1,5 @@
1
1
  module Cocoapods
2
2
  module Browser
3
- VERSION = '0.0.4'
3
+ VERSION = '0.1.0'
4
4
  end
5
5
  end
@@ -1 +1 @@
1
- require 'pod/command/browser'
1
+ require 'pod/command/browse'
@@ -1,6 +1,6 @@
1
1
  module Pod
2
2
  class Command
3
- class Browser < Command
3
+ class Browse < Command
4
4
  self.summary = 'Open the homepage'
5
5
 
6
6
  self.description = <<-DESC
@@ -11,13 +11,15 @@ module Pod
11
11
 
12
12
  def self.options
13
13
  [
14
- [ '--spec', 'Open the podspec in the browser. github.com/tree/master/[NAME].podspec' ],
14
+ [ '--spec', 'Open the podspec in the browser.' ],
15
+ [ '--release', 'Open the releases in the browser.' ],
15
16
  ].concat(super)
16
17
  end
17
18
 
18
19
  def initialize(argv)
19
- @spec = argv.flag?('spec')
20
- @names = argv.arguments! unless argv.arguments.empty?
20
+ @spec = argv.flag?('spec')
21
+ @release = argv.flag?('release')
22
+ @names = argv.arguments! unless argv.arguments.empty?
21
23
  super
22
24
  end
23
25
 
@@ -53,6 +55,29 @@ module Pod
53
55
  def spec_with_name(name)
54
56
  if set = SourcesManager.search(Dependency.new(name))
55
57
  set.specification.root
58
+ 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})"
78
+ end
79
+ end
80
+ set.specification.root
56
81
  else
57
82
  raise Informative, "Unable to find a podspec named `#{name}`"
58
83
  end
@@ -62,6 +87,8 @@ module Pod
62
87
  url = spec.homepage
63
88
  if @spec && url =~ %r|^https?://github.com/|
64
89
  "%s/tree/master/%s.podspec" % [ url, spec.name ]
90
+ elsif @release && url =~ %r|^https?://github.com/|
91
+ "%s/releases" % [ url ]
65
92
  else
66
93
  url
67
94
  end
@@ -2,15 +2,15 @@ require File.expand_path('../../spec_helper', __FILE__)
2
2
 
3
3
  module Pod
4
4
 
5
- describe Command::Browser do
5
+ describe Command::Browse do
6
6
 
7
7
  describe "CLAide" do
8
8
  it "registers it self" do
9
- Command.parse(%w{ browser }).should.be.instance_of Command::Browser
9
+ Command.parse(%w{ browse }).should.be.instance_of Command::Browse
10
10
  end
11
11
 
12
12
  it "presents the help if no name is provided" do
13
- command = Pod::Command.parse(['browser'])
13
+ command = Pod::Command.parse(['browse'])
14
14
  should.raise CLAide::Help do
15
15
  command.validate!
16
16
  end.message.should.match /A Pod name is required/
@@ -18,7 +18,7 @@ module Pod
18
18
 
19
19
  it "runs" do
20
20
  Config.instance.skip_repo_update = false
21
- command = Pod::Command.parse(['browser', 'iOS-FakeWeb'])
21
+ command = Pod::Command.parse(['browse', 'iOS-FakeWeb'])
22
22
  # command.expects(:update_specs_repos)
23
23
  command.expects(:spec_with_name)
24
24
  command.run
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.0.4
4
+ version: 0.1.0
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-24 00:00:00.000000000 Z
11
+ date: 2014-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -69,8 +69,8 @@ files:
69
69
  - lib/cocoapods/browser.rb
70
70
  - lib/cocoapods/browser/version.rb
71
71
  - lib/cocoapods_plugin.rb
72
- - lib/pod/command/browser.rb
73
- - spec/command/browser_spec.rb
72
+ - lib/pod/command/browse.rb
73
+ - spec/command/browse_spec.rb
74
74
  - spec/spec_helper.rb
75
75
  homepage: https://github.com/dealforest/cocoapods-browser
76
76
  licenses:
@@ -97,5 +97,5 @@ signing_key:
97
97
  specification_version: 4
98
98
  summary: Open a pods homepage in the browser
99
99
  test_files:
100
- - spec/command/browser_spec.rb
100
+ - spec/command/browse_spec.rb
101
101
  - spec/spec_helper.rb