cocoapods-check_latest 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/.rubocop.yml +67 -0
- data/Gemfile +4 -0
- data/Guardfile +16 -0
- data/LICENSE.txt +22 -0
- data/README.md +29 -0
- data/Rakefile +1 -0
- data/cocoapods-head.gemspec +29 -0
- data/lib/cocoapods_plugin.rb +1 -0
- data/lib/pod/command/check_latest.rb +74 -0
- data/spec/.rubocop.yml +23 -0
- data/spec/fixtures/podspec_repos/master/GHUnitIOS/0.4.33/GHUnitIOS.podspec +15 -0
- data/spec/fixtures/podspec_repos/master/GHUnitIOS/0.5.5/GHUnitIOS.podspec +16 -0
- data/spec/fixtures/podspec_repos/master/GHUnitIOS/0.5.6/GHUnitIOS.podspec +14 -0
- data/spec/fixtures/podspec_repos/master/GHUnitIOS/0.5.7/GHUnitIOS.podspec +14 -0
- data/spec/fixtures/podspec_repos/master/GHUnitIOS/0.5.8/GHUnitIOS.podspec +19 -0
- data/spec/pod/command/check_latest_spec.rb +142 -0
- data/spec/spec_helper.rb +29 -0
- data/spec_helper.rb +47 -0
- metadata +213 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 1facf20c8e3342f34a837600b886287d06f7beb0
|
4
|
+
data.tar.gz: 830cb07e0e599b4e8324d7b73c4dc5c6fe919294
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6d03e567708cdd0e071cf4dd25bcad8fcdf99f54bde518b97f144f720900bf503643c2545b2e2a97b43881308428eb84514e8f1ea8acd9f170f9577683cdbddf
|
7
|
+
data.tar.gz: b2550b5227606489e3566a5984c3337a7f75d86da1ee27baebbb3542e4d313969e80d62573e2fbf20925dce0811df86aa3b96409d5350ee89db3db0b77f2dda7
|
data/.gitignore
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
|
2
|
+
AllCops:
|
3
|
+
Includes:
|
4
|
+
- '*.gemspec'
|
5
|
+
- Rakefile
|
6
|
+
- Gemfile
|
7
|
+
- Guardfile
|
8
|
+
Excludes:
|
9
|
+
- tmp/*
|
10
|
+
- vendor/*
|
11
|
+
|
12
|
+
LineLength:
|
13
|
+
Max: 100
|
14
|
+
|
15
|
+
MethodLength:
|
16
|
+
Max: 17
|
17
|
+
|
18
|
+
CyclomaticComplexity:
|
19
|
+
Max: 8
|
20
|
+
|
21
|
+
WordArray:
|
22
|
+
Enabled: false
|
23
|
+
|
24
|
+
RegexpLiteral:
|
25
|
+
Enabled: false
|
26
|
+
|
27
|
+
AlignHash:
|
28
|
+
# Alignment of entries using hash rocket as separator. Valid values are:
|
29
|
+
#
|
30
|
+
# key - left alignment of keys
|
31
|
+
# 'a' => 2
|
32
|
+
# 'bb' => 3
|
33
|
+
# separator - alignment of hash rockets, keys are right aligned
|
34
|
+
# 'a' => 2
|
35
|
+
# 'bb' => 3
|
36
|
+
# table - left alignment of keys, hash rockets, and values
|
37
|
+
# 'a' => 2
|
38
|
+
# 'bb' => 3
|
39
|
+
EnforcedHashRocketStyle: table
|
40
|
+
# Alignment of entries using colon as separator. Valid values are:
|
41
|
+
#
|
42
|
+
# key - left alignment of keys
|
43
|
+
# a: 0
|
44
|
+
# bb: 1
|
45
|
+
# separator - alignment of colons, keys are right aligned
|
46
|
+
# a: 0
|
47
|
+
# bb: 1
|
48
|
+
# table - left alignment of keys and values
|
49
|
+
# a: 0
|
50
|
+
# bb: 1
|
51
|
+
EnforcedColonStyle: separator
|
52
|
+
|
53
|
+
# TODO
|
54
|
+
Documentation:
|
55
|
+
Enabled: false
|
56
|
+
|
57
|
+
# Currently IndentationWidth reports false positive offence around here document.
|
58
|
+
IndentationWidth:
|
59
|
+
Enabled: false
|
60
|
+
|
61
|
+
# TODO: This should not register offences for non keyword hashes.
|
62
|
+
BracesAroundHashParameters:
|
63
|
+
Enabled: false
|
64
|
+
|
65
|
+
# TODO: Shorten to 100.
|
66
|
+
ClassLength:
|
67
|
+
Max: 154
|
data/Gemfile
ADDED
data/Guardfile
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# A sample Guardfile
|
2
|
+
# More info at https://github.com/guard/guard#readme
|
3
|
+
|
4
|
+
guard :rspec, all_after_pass: true, all_on_start: true, cmd: 'bundle exec rspec' do
|
5
|
+
watch(%r{^spec/.+_spec\.rb$})
|
6
|
+
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
|
7
|
+
watch('spec/spec_helper.rb') { 'spec' }
|
8
|
+
watch(%r{^spec/support/.+\.rb$}) { 'spec' }
|
9
|
+
end
|
10
|
+
|
11
|
+
guard :rubocop do
|
12
|
+
watch(%r{.+\.rb$})
|
13
|
+
watch(%r{/?(?:Rake|Gem|Guard)file$})
|
14
|
+
watch(%r{\.gemspec$})
|
15
|
+
watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
|
16
|
+
end
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Yuji Nakayama
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# Cocoapods::Head
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'cocoapods-head'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install cocoapods-head
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
TODO: Write usage instructions here
|
22
|
+
|
23
|
+
## Contributing
|
24
|
+
|
25
|
+
1. Fork it
|
26
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'bundler/gem_tasks'
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
Gem::Specification.new do |spec|
|
4
|
+
spec.name = 'cocoapods-check_latest'
|
5
|
+
spec.version = '0.0.1' # http://semver.org/
|
6
|
+
spec.authors = ['Yuji Nakayama']
|
7
|
+
spec.email = ['nkymyj@gmail.com']
|
8
|
+
spec.description = 'A CocoaPods plugin that checks if the latest version of a pod is up to date'
|
9
|
+
spec.summary = 'A CocoaPods plugin that checks if the latest version of a pod is up to date'
|
10
|
+
spec.homepage = 'https://github.com/yujinakayama/cocoapods-check_latest'
|
11
|
+
spec.license = 'MIT'
|
12
|
+
|
13
|
+
spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
14
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
15
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
16
|
+
spec.require_paths = ['lib']
|
17
|
+
|
18
|
+
spec.add_runtime_dependency 'cocoapods', '~> 0.28'
|
19
|
+
|
20
|
+
spec.add_development_dependency 'bundler', '~> 1.3'
|
21
|
+
spec.add_development_dependency 'rspec', '~> 2.14'
|
22
|
+
spec.add_development_dependency 'rake', '~> 10.1'
|
23
|
+
spec.add_development_dependency 'simplecov', '~> 0.8'
|
24
|
+
spec.add_development_dependency 'rubocop', '~> 0.15'
|
25
|
+
spec.add_development_dependency 'guard-rspec', '~> 4.2'
|
26
|
+
spec.add_development_dependency 'guard-rubocop', '~> 1.0'
|
27
|
+
spec.add_development_dependency 'guard-shell', '~> 0.5'
|
28
|
+
spec.add_development_dependency 'ruby_gntp', '~> 0.3'
|
29
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'pod/command/check_latest'
|
@@ -0,0 +1,74 @@
|
|
1
|
+
|
2
|
+
module Pod
|
3
|
+
class Command
|
4
|
+
class CheckLatest < Command
|
5
|
+
self.summary = 'Check if the latest version of a pod is up to date'
|
6
|
+
self.arguments = '[NAME]'
|
7
|
+
|
8
|
+
def initialize(argv)
|
9
|
+
@name = argv.shift_argument
|
10
|
+
super
|
11
|
+
end
|
12
|
+
|
13
|
+
def validate!
|
14
|
+
super
|
15
|
+
help!('A pod name is required.') unless @name
|
16
|
+
end
|
17
|
+
|
18
|
+
def run
|
19
|
+
sets = SourcesManager.search_by_name(@name.strip)
|
20
|
+
sets.each do |set|
|
21
|
+
show_pod(set)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def show_pod(set)
|
26
|
+
UI.title("\n-> #{set.name}".green, '', 1) do
|
27
|
+
UI.labeled 'Homepage', set.specification.homepage
|
28
|
+
|
29
|
+
latest_pod_version = set.highest_version.to_s
|
30
|
+
UI.labeled 'Latest pod version', latest_pod_version
|
31
|
+
|
32
|
+
github_url = github_url(set)
|
33
|
+
|
34
|
+
if github_url
|
35
|
+
latest_version_in_original_repo = latest_version_in_repo(github_url)
|
36
|
+
UI.labeled 'Latest version in original repo', latest_version_in_original_repo
|
37
|
+
unless latest_pod_version == latest_version_in_original_repo
|
38
|
+
UI.puts_indented 'Outdated!'.yellow
|
39
|
+
end
|
40
|
+
else
|
41
|
+
UI.warn 'Only GitHub source repository is supported.'
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def github_url(set)
|
47
|
+
git_url = set.specification.source[:git]
|
48
|
+
return nil unless git_url
|
49
|
+
return nil unless git_url.include?('github.com/')
|
50
|
+
git_url
|
51
|
+
end
|
52
|
+
|
53
|
+
def latest_version_in_repo(git_url)
|
54
|
+
tags = github_tags(git_url)
|
55
|
+
versions_from_tags(tags).sort.last
|
56
|
+
end
|
57
|
+
|
58
|
+
def github_tags(git_url)
|
59
|
+
GitHub.tags(git_url).map { |hash| hash['name'] }
|
60
|
+
end
|
61
|
+
|
62
|
+
def versions_from_tags(tags)
|
63
|
+
tags.map do |tag|
|
64
|
+
normalized_tag = tag.strip.sub(/\Av\D*/i, '')
|
65
|
+
if Version.correct?(normalized_tag)
|
66
|
+
normalized_tag
|
67
|
+
else
|
68
|
+
nil
|
69
|
+
end
|
70
|
+
end.compact
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
data/spec/.rubocop.yml
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
|
2
|
+
inherit_from: ../.rubocop.yml
|
3
|
+
|
4
|
+
# Avoid warning "Possibly useless use of == in void context"
|
5
|
+
# for `should ==`
|
6
|
+
Void:
|
7
|
+
Enabled: false
|
8
|
+
|
9
|
+
# Lengthen for long descriptions.
|
10
|
+
LineLength:
|
11
|
+
Max: 120
|
12
|
+
|
13
|
+
# raise_error matcher always requires {} form block.
|
14
|
+
Blocks:
|
15
|
+
Enabled: false
|
16
|
+
|
17
|
+
# Sometimes block alignment does not suit RSpec syntax.
|
18
|
+
BlockAlignment:
|
19
|
+
Enabled: false
|
20
|
+
|
21
|
+
# Suppress offences for namespace classes only with #describe.
|
22
|
+
ClassLength:
|
23
|
+
Enabled: false
|
@@ -0,0 +1,15 @@
|
|
1
|
+
Pod::Spec.new do |s|
|
2
|
+
s.name = 'GHUnitIOS'
|
3
|
+
s.version = '0.4.33'
|
4
|
+
s.license = 'MIT'
|
5
|
+
s.summary = 'Test Framework for Objective-C.'
|
6
|
+
s.homepage = 'https://github.com/gabriel/gh-unit'
|
7
|
+
s.author = { 'Gabriel Handford' => 'gabrielh@gmail.com' }
|
8
|
+
s.source = { :git => 'https://github.com/gabriel/gh-unit.git', :tag => '0.4.33'}
|
9
|
+
s.description = 'GHUnit is a test framework for Objective-C, Mac OS X 10.5 and above and iPhone 3.x and above. It can be used standalone or with other testing frameworks like SenTestingKit or GTM.'
|
10
|
+
s.source_files = 'Classes/**/*.{h,m}', 'Classes-iOS/**/*.{h,m}', 'Libraries/YelpKit/*.{h,m}', 'Libraries/GTM/**/*.{h,m}', 'Libraries/GHKit/**/*.{h,m}'
|
11
|
+
s.platform = :ios
|
12
|
+
s.framework = 'CoreLocation'
|
13
|
+
|
14
|
+
end
|
15
|
+
|
@@ -0,0 +1,16 @@
|
|
1
|
+
Pod::Spec.new do |s|
|
2
|
+
s.name = 'GHUnitIOS'
|
3
|
+
s.version = '0.5.5'
|
4
|
+
s.license = 'MIT'
|
5
|
+
s.summary = 'Test Framework for Objective-C.'
|
6
|
+
s.homepage = 'https://github.com/gabriel/gh-unit'
|
7
|
+
s.author = { 'Gabriel Handford' => 'gabrielh@gmail.com' }
|
8
|
+
s.source = { :git => 'https://github.com/gabriel/gh-unit.git', :tag => '0.5.5'}
|
9
|
+
s.description = 'GHUnit is a test framework for Objective-C, Mac OS X 10.5 and above and iPhone 3.x and above. It can be used standalone or with other testing frameworks like SenTestingKit or GTM.'
|
10
|
+
s.source_files = 'Classes/**/*.{h,m}', 'Classes-iOS/**/*.{h,m}', 'Libraries/YelpKit/*.{h,m}', 'Libraries/GTM/**/*.{h,m}', 'Libraries/GHKit/**/*.{h,m}'
|
11
|
+
s.platform = :ios
|
12
|
+
s.framework = 'CoreLocation'
|
13
|
+
s.requires_arc = true
|
14
|
+
|
15
|
+
end
|
16
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
Pod::Spec.new do |s|
|
2
|
+
s.name = 'GHUnitIOS'
|
3
|
+
s.version = '0.5.6'
|
4
|
+
s.license = 'MIT'
|
5
|
+
s.summary = 'Test Framework for Objective-C.'
|
6
|
+
s.homepage = 'https://github.com/gabriel/gh-unit'
|
7
|
+
s.author = { 'Gabriel Handford' => 'gabrielh@gmail.com' }
|
8
|
+
s.source = { :git => 'https://github.com/gabriel/gh-unit.git', :tag => '0.5.6'}
|
9
|
+
s.description = 'GHUnit is a test framework for Objective-C, Mac OS X 10.5 and above and iPhone 3.x and above. It can be used standalone or with other testing frameworks like SenTestingKit or GTM.'
|
10
|
+
s.source_files = 'Classes/**/*.{h,m}', 'Classes-iOS/**/*.{h,m}', 'Libraries/GTM/**/*.{h,m}'
|
11
|
+
s.platform = :ios
|
12
|
+
s.requires_arc = true
|
13
|
+
end
|
14
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
Pod::Spec.new do |s|
|
2
|
+
s.name = 'GHUnitIOS'
|
3
|
+
s.version = '0.5.7'
|
4
|
+
s.license = 'MIT'
|
5
|
+
s.summary = 'Test Framework for Objective-C.'
|
6
|
+
s.homepage = 'https://github.com/gh-unit/gh-unit'
|
7
|
+
s.author = { 'Gabriel Handford' => 'gabrielh@gmail.com' }
|
8
|
+
s.source = { :git => 'https://github.com/gh-unit/gh-unit.git', :tag => '0.5.7'}
|
9
|
+
s.description = 'GHUnit is a test framework for Objective-C, Mac OS X 10.5 and above and iPhone 3.x and above. It can be used standalone or with other testing frameworks like SenTestingKit or GTM.'
|
10
|
+
s.source_files = 'Classes/**/*.{h,m}', 'Classes-iOS/**/*.{h,m}', 'Libraries/GTM/**/*.{h,m}'
|
11
|
+
s.platform = :ios
|
12
|
+
s.requires_arc = true
|
13
|
+
end
|
14
|
+
|
@@ -0,0 +1,19 @@
|
|
1
|
+
Pod::Spec.new do |s|
|
2
|
+
s.name = 'GHUnitIOS'
|
3
|
+
s.version = '0.5.8'
|
4
|
+
s.license = 'MIT'
|
5
|
+
s.summary = 'Test Framework for Objective-C.'
|
6
|
+
s.homepage = 'https://github.com/gh-unit/gh-unit'
|
7
|
+
s.authors = { 'Gabriel Handford' => 'gabrielh@gmail.com', 'Felix Schulze' => 'code@felixschulze.de' }
|
8
|
+
s.source = { :git => 'https://github.com/gh-unit/gh-unit.git', :tag => s.version.to_s}
|
9
|
+
s.description = 'GHUnit is a test framework for Objective-C, Mac OS X 10.6 and above and iPhone 4.3 and above. It can be used standalone or with other testing frameworks like SenTestingKit or GTM.'
|
10
|
+
s.source_files = 'Classes/**/*.{h,m}', 'Classes-iOS/**/*.{h,m}', 'Libraries/GTM/**/*.{h,m}'
|
11
|
+
s.platform = :ios
|
12
|
+
s.ios.deployment_target = '4.3'
|
13
|
+
s.ios.frameworks = 'QuartzCore'
|
14
|
+
s.requires_arc = true
|
15
|
+
|
16
|
+
s.prepare_command = "echo 'GHUnitIOS is deprecated - Please switch to GHUnit to stay up to date.'"
|
17
|
+
|
18
|
+
end
|
19
|
+
|
@@ -0,0 +1,142 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
require 'cocoapods'
|
5
|
+
require 'pod/command/check_latest'
|
6
|
+
|
7
|
+
module Pod
|
8
|
+
class Command
|
9
|
+
describe CheckLatest do
|
10
|
+
subject(:command) { Pod::Command.parse(argv) }
|
11
|
+
let(:argv) { CLAide::ARGV.new(['--no-color', 'check-latest']) }
|
12
|
+
|
13
|
+
before do
|
14
|
+
spec_dir = File.expand_path('../../..', __FILE__)
|
15
|
+
repos_dir = File.join(spec_dir, 'fixtures/podspec_repos')
|
16
|
+
repos_pathname = Pathname.new(repos_dir)
|
17
|
+
allow(SourcesManager.config).to receive(:repos_dir).and_return(repos_pathname)
|
18
|
+
end
|
19
|
+
|
20
|
+
let(:set) { SourcesManager.search_by_name('GHUnitIOS').first }
|
21
|
+
|
22
|
+
describe '#show_pod' do
|
23
|
+
before do
|
24
|
+
allow(UI).to receive(:puts)
|
25
|
+
end
|
26
|
+
|
27
|
+
context "when the pod's source is not a GitHub repository" do
|
28
|
+
before do
|
29
|
+
allow(command).to receive(:github_url).and_return(nil)
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'does not fetch GitHub tags' do
|
33
|
+
expect(command).not_to receive(:latest_version_in_repo)
|
34
|
+
command.show_pod(set)
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'warns to the user' do
|
38
|
+
expect(UI).to receive(:warn).with('Only GitHub source repository is supported.')
|
39
|
+
command.show_pod(set)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
describe '#github_url' do
|
45
|
+
subject { command.github_url(set) }
|
46
|
+
|
47
|
+
context "when the pod's source is a GitHub repository" do
|
48
|
+
it 'returns the URL' do
|
49
|
+
should == 'https://github.com/gh-unit/gh-unit.git'
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
context "when the pod's source is a Git repository but not GitHub one" do
|
54
|
+
before do
|
55
|
+
allow_any_instance_of(Specification).to receive(:source).and_return(git: 'foo')
|
56
|
+
end
|
57
|
+
|
58
|
+
it { should be_nil }
|
59
|
+
end
|
60
|
+
|
61
|
+
context "when the pod's source is a Subversion repository" do
|
62
|
+
before do
|
63
|
+
allow_any_instance_of(Specification).to receive(:source).and_return(svn: 'foo')
|
64
|
+
end
|
65
|
+
|
66
|
+
it { should be_nil }
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
describe '#versions_from_tags' do
|
71
|
+
subject { command.versions_from_tags(tags) }
|
72
|
+
|
73
|
+
context 'when the passed tags include a non-version tag' do
|
74
|
+
let(:tags) { ['0.5.8', 'foo'] }
|
75
|
+
|
76
|
+
it 'excludes the tag' do
|
77
|
+
should == ['0.5.8']
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
context 'when the passed tags include a tag prefixed with "v"' do
|
82
|
+
let(:tags) { ['0.5.8', 'v0.5.7'] }
|
83
|
+
|
84
|
+
it 'removes the prefix' do
|
85
|
+
should == ['0.5.8', '0.5.7']
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
context 'when the passed tags include a tag prefixed with "ver"' do
|
90
|
+
let(:tags) { ['0.5.8', 'ver0.5.7'] }
|
91
|
+
|
92
|
+
it 'removes the prefix' do
|
93
|
+
should == ['0.5.8', '0.5.7']
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
context 'when the passed tags include a tag with unknown prefix' do
|
98
|
+
let(:tags) { ['0.5.8', 'release-0.5.7'] }
|
99
|
+
|
100
|
+
it 'excludes the tag' do
|
101
|
+
should == ['0.5.8']
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
describe '#latest_version_in_repo' do
|
107
|
+
let(:git_url) { 'https://github.com/gh-unit/gh-unit.git' }
|
108
|
+
|
109
|
+
before do
|
110
|
+
allow(command).to receive(:github_tags)
|
111
|
+
.with(git_url).and_return(['release-0.3.6', '0.5.8', '0.5.7'])
|
112
|
+
end
|
113
|
+
|
114
|
+
it 'returns the latest version in the repository' do
|
115
|
+
latest_version = command.latest_version_in_repo(git_url)
|
116
|
+
expect(latest_version).to eq('0.5.8')
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
describe '#github_tags' do
|
121
|
+
let(:git_url) { 'https://github.com/gh-unit/gh-unit.git' }
|
122
|
+
|
123
|
+
let(:data) do
|
124
|
+
[
|
125
|
+
{ 'name' => 'release-0.3.6' },
|
126
|
+
{ 'name' => '0.5.8' },
|
127
|
+
{ 'name' => '0.5.7' }
|
128
|
+
]
|
129
|
+
end
|
130
|
+
|
131
|
+
before do
|
132
|
+
allow(GitHub).to receive(:tags).with(git_url).and_return(data)
|
133
|
+
end
|
134
|
+
|
135
|
+
it 'returns an array of tag names' do
|
136
|
+
tags = command.github_tags(git_url)
|
137
|
+
expect(tags).to eq(['release-0.3.6', '0.5.8', '0.5.7'])
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
141
|
+
end
|
142
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
RSpec.configure do |config|
|
4
|
+
config.expect_with :rspec do |c|
|
5
|
+
c.syntax = :expect
|
6
|
+
end
|
7
|
+
|
8
|
+
config.mock_with :rspec do |c|
|
9
|
+
c.syntax = :expect
|
10
|
+
end
|
11
|
+
|
12
|
+
config.color_enabled = true
|
13
|
+
config.treat_symbols_as_metadata_keys_with_true_values = true
|
14
|
+
end
|
15
|
+
|
16
|
+
require 'simplecov'
|
17
|
+
|
18
|
+
if ENV['TRAVIS']
|
19
|
+
require 'coveralls'
|
20
|
+
SimpleCov.formatter = Coveralls::SimpleCov::Formatter
|
21
|
+
elsif ENV['CI']
|
22
|
+
require 'simplecov-rcov'
|
23
|
+
SimpleCov.formatter = SimpleCov::Formatter::RcovFormatter
|
24
|
+
end
|
25
|
+
|
26
|
+
SimpleCov.start do
|
27
|
+
add_filter '/spec/'
|
28
|
+
add_filter '/vendor/bundle/'
|
29
|
+
end
|
data/spec_helper.rb
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
RSpec.configure do |config|
|
4
|
+
unless ENV['TRANSPEC_TEST']
|
5
|
+
# Yes, I'm writing specs in should syntax intentionally!
|
6
|
+
config.expect_with :rspec do |c|
|
7
|
+
c.syntax = :should
|
8
|
+
end
|
9
|
+
|
10
|
+
config.mock_with :rspec do |c|
|
11
|
+
c.syntax = :should
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
config.color_enabled = true
|
16
|
+
config.treat_symbols_as_metadata_keys_with_true_values = true
|
17
|
+
|
18
|
+
config.before(:suite) do
|
19
|
+
require 'rainbow'
|
20
|
+
Sickill::Rainbow.enabled = false
|
21
|
+
|
22
|
+
if ENV['TRAVIS']
|
23
|
+
system('git config --global user.email "you@example.com"')
|
24
|
+
system('git config --global user.name "Your Name"')
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
require 'simplecov'
|
30
|
+
SimpleCov.coverage_dir(File.join('spec', 'coverage'))
|
31
|
+
|
32
|
+
if ENV['TRAVIS']
|
33
|
+
require 'coveralls'
|
34
|
+
SimpleCov.formatter = Coveralls::SimpleCov::Formatter
|
35
|
+
elsif ENV['CI']
|
36
|
+
require 'simplecov-rcov'
|
37
|
+
SimpleCov.formatter = SimpleCov::Formatter::RcovFormatter
|
38
|
+
end
|
39
|
+
|
40
|
+
SimpleCov.start do
|
41
|
+
add_filter '/spec/'
|
42
|
+
add_filter '/vendor/bundle/'
|
43
|
+
end
|
44
|
+
|
45
|
+
Dir[File.join(File.dirname(__FILE__), 'support', '*')].each do |path|
|
46
|
+
require path
|
47
|
+
end
|
metadata
ADDED
@@ -0,0 +1,213 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: cocoapods-check_latest
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Yuji Nakayama
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-12-14 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: cocoapods
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.28'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.28'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.3'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.3'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '2.14'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '2.14'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '10.1'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '10.1'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: simplecov
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0.8'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0.8'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rubocop
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0.15'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0.15'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: guard-rspec
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '4.2'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '4.2'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: guard-rubocop
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '1.0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '1.0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: guard-shell
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0.5'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0.5'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: ruby_gntp
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0.3'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0.3'
|
153
|
+
description: A CocoaPods plugin that checks if the latest version of a pod is up to
|
154
|
+
date
|
155
|
+
email:
|
156
|
+
- nkymyj@gmail.com
|
157
|
+
executables: []
|
158
|
+
extensions: []
|
159
|
+
extra_rdoc_files: []
|
160
|
+
files:
|
161
|
+
- ".gitignore"
|
162
|
+
- ".rubocop.yml"
|
163
|
+
- Gemfile
|
164
|
+
- Guardfile
|
165
|
+
- LICENSE.txt
|
166
|
+
- README.md
|
167
|
+
- Rakefile
|
168
|
+
- cocoapods-head.gemspec
|
169
|
+
- lib/cocoapods_plugin.rb
|
170
|
+
- lib/pod/command/check_latest.rb
|
171
|
+
- spec/.rubocop.yml
|
172
|
+
- spec/fixtures/podspec_repos/master/GHUnitIOS/0.4.33/GHUnitIOS.podspec
|
173
|
+
- spec/fixtures/podspec_repos/master/GHUnitIOS/0.5.5/GHUnitIOS.podspec
|
174
|
+
- spec/fixtures/podspec_repos/master/GHUnitIOS/0.5.6/GHUnitIOS.podspec
|
175
|
+
- spec/fixtures/podspec_repos/master/GHUnitIOS/0.5.7/GHUnitIOS.podspec
|
176
|
+
- spec/fixtures/podspec_repos/master/GHUnitIOS/0.5.8/GHUnitIOS.podspec
|
177
|
+
- spec/pod/command/check_latest_spec.rb
|
178
|
+
- spec/spec_helper.rb
|
179
|
+
- spec_helper.rb
|
180
|
+
homepage: https://github.com/yujinakayama/cocoapods-check_latest
|
181
|
+
licenses:
|
182
|
+
- MIT
|
183
|
+
metadata: {}
|
184
|
+
post_install_message:
|
185
|
+
rdoc_options: []
|
186
|
+
require_paths:
|
187
|
+
- lib
|
188
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
189
|
+
requirements:
|
190
|
+
- - ">="
|
191
|
+
- !ruby/object:Gem::Version
|
192
|
+
version: '0'
|
193
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
194
|
+
requirements:
|
195
|
+
- - ">="
|
196
|
+
- !ruby/object:Gem::Version
|
197
|
+
version: '0'
|
198
|
+
requirements: []
|
199
|
+
rubyforge_project:
|
200
|
+
rubygems_version: 2.0.14
|
201
|
+
signing_key:
|
202
|
+
specification_version: 4
|
203
|
+
summary: A CocoaPods plugin that checks if the latest version of a pod is up to date
|
204
|
+
test_files:
|
205
|
+
- spec/.rubocop.yml
|
206
|
+
- spec/fixtures/podspec_repos/master/GHUnitIOS/0.4.33/GHUnitIOS.podspec
|
207
|
+
- spec/fixtures/podspec_repos/master/GHUnitIOS/0.5.5/GHUnitIOS.podspec
|
208
|
+
- spec/fixtures/podspec_repos/master/GHUnitIOS/0.5.6/GHUnitIOS.podspec
|
209
|
+
- spec/fixtures/podspec_repos/master/GHUnitIOS/0.5.7/GHUnitIOS.podspec
|
210
|
+
- spec/fixtures/podspec_repos/master/GHUnitIOS/0.5.8/GHUnitIOS.podspec
|
211
|
+
- spec/pod/command/check_latest_spec.rb
|
212
|
+
- spec/spec_helper.rb
|
213
|
+
has_rdoc:
|