cocoapods-repo-svn 0.1.1 → 1.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: e737cc20730f3b6e981496b5da75b19bcefe33cf
4
- data.tar.gz: 060584f6fd8baa274d79d5a111ba565f1a9f4c4f
3
+ metadata.gz: a0e85705bfb49fdd94c310abfbcb0ef1eff7656c
4
+ data.tar.gz: 119a76f6e3520135405ccfd6abca17f210788314
5
5
  SHA512:
6
- metadata.gz: 20e02a1bd0e57d7231cd18b8e49867627dba274885d926fd4b64660dc1fa21bc5b5d3a2246dd594db3f6dafd2725ade66078638f797ba1d15a33ffab4f0be249
7
- data.tar.gz: a152e53a25cc59a3d1dc6df8c5c8ff4dabcf4c298d5dd588bb9ad4c076dbc2eaedbc365bf29b40cf41986f2a4ebf29db3c9eaf3cc835913aa0b2de196cb240c1
6
+ metadata.gz: 1b22e0739d38dc173badfb7bddd038012fbfa22c36721a93268203c617d62bab0215ae7648cf2235117dfc18f34d9fe40c9e157c04cf722e7cffa01394ea0ff4
7
+ data.tar.gz: 6e5b77f1b76039e70cf8b3dc3dc64ababbe599d17eb534b2c265f1b678a4cc63ee23e6da4f07072f2b41d8727200eb9a17417359073c53042c2ac60ac117849f
data/Gemfile CHANGED
@@ -6,4 +6,10 @@ group :development do
6
6
  gem 'cocoapods', :git => 'https://github.com/CocoaPods/CocoaPods.git', :branch => 'master'
7
7
  gem 'cocoapods-core', :git => 'https://github.com/CocoaPods/Core.git', :branch => 'master'
8
8
  gem 'claide', :git => 'https://github.com/CocoaPods/CLAide.git', :branch => 'master'
9
+
10
+ gem 'bacon'
11
+ gem 'mocha-on-bacon'
12
+ gem 'prettybacon'
13
+
14
+ gem 'rubocop'
9
15
  end
data/Rakefile CHANGED
@@ -1,58 +1,60 @@
1
+
2
+ #-----------------------------------------------------------------------#
1
3
  # Bootstrap
2
- #-----------------------------------------------------------------------------#
4
+ #-----------------------------------------------------------------------#
3
5
 
6
+ desc 'Initializes your working copy to run the specs'
4
7
  task :bootstrap do
5
8
  if system('which bundle')
9
+ title 'Installing gems'
6
10
  sh 'bundle install'
7
11
  else
8
12
  $stderr.puts "\033[0;31m" \
9
13
  "[!] Please install the bundler gem manually:\n" \
10
- ' $ [sudo] gem install bundler' \
11
- "\e[0m"
14
+ ' $ [sudo] gem install bundler'
15
+ "\e[0m"
12
16
  exit 1
13
17
  end
14
18
  end
15
19
 
16
20
  begin
17
-
18
21
  require 'bundler/gem_tasks'
22
+ task :default => :spec
19
23
 
20
- task :default => 'spec'
21
-
22
- # Spec
23
- #-----------------------------------------------------------------------------#
24
+ #-----------------------------------------------------------------------#
25
+ # Specs
26
+ #-----------------------------------------------------------------------#
24
27
 
25
28
  desc 'Runs all the specs'
26
29
  task :spec do
27
- start_time = Time.now
28
- sh "bundle exec bacon #{specs('**')}"
29
- duration = Time.now - start_time
30
- puts "Tests completed in #{duration}s"
31
- Rake::Task['rubocop'].invoke
32
- end
30
+ title 'Running Unit Tests'
31
+ files = FileList['spec/**/*_spec.rb'].shuffle.join(' ')
32
+ sh "bundle exec bacon #{files}"
33
33
 
34
- def specs(dir)
35
- FileList["spec/#{dir}/*_spec.rb"].shuffle.join(' ')
34
+ #title 'Checking code style...'
35
+ #Rake::Task['rubocop'].invoke if RUBY_VERSION >= '1.9.3'
36
36
  end
37
37
 
38
+ #-----------------------------------------------------------------------#
38
39
  # Rubocop
39
- #-----------------------------------------------------------------------------#
40
-
41
- desc 'Checks code style'
42
- task :rubocop do
43
- if RUBY_VERSION >= '1.9.3'
44
- require 'rubocop'
45
- cli = RuboCop::CLI.new
46
- result = cli.run(FileList['{spec,lib}/**/*.rb'])
47
- abort('RuboCop failed!') unless result == 0
48
- else
49
- puts '[!] Ruby > 1.9 is required to run style checks'
50
- end
40
+ #-----------------------------------------------------------------------#
41
+
42
+ if RUBY_VERSION >= '1.9.3'
43
+ require 'rubocop/rake_task'
44
+ RuboCop::RakeTask.new
51
45
  end
52
46
 
53
- rescue LoadError
54
- $stderr.puts "\033[0;31m" \
55
- '[!] Some Rake tasks haven been disabled because the environment' \
56
- ' couldn’t be loaded. Be sure to run `rake bootstrap` first.' \
57
- "\e[0m"
47
+ end
48
+
49
+ #-----------------------------------------------------------------------#
50
+ # Helpers
51
+ #-----------------------------------------------------------------------#
52
+
53
+ def title(title)
54
+ cyan_title = "\033[0;36m#{title}\033[0m"
55
+ puts
56
+ puts '-' * 80
57
+ puts cyan_title
58
+ puts '-' * 80
59
+ puts
58
60
  end
@@ -16,8 +16,8 @@ module Pod
16
16
  DESC
17
17
 
18
18
  self.arguments = [
19
- CLAide::Argument.new('URL', true),
20
- CLAide::Argument.new('NAME', true)
19
+ CLAide::Argument.new('NAME', true),
20
+ CLAide::Argument.new('URL', true)
21
21
  ]
22
22
 
23
23
  def initialize(argv)
@@ -94,23 +94,54 @@ module Pod
94
94
  #
95
95
  def update(source_name = nil, show_output = false)
96
96
  if source_name
97
- specified_source = SourcesManager.aggregate.all.find { |s| s.name == source_name }
98
- raise Informative, "Unable to find the `#{source_name}` spec-repo." unless specified_source
99
- raise Informative, "The `#{source_name}` repo is not a svn spec-repo." unless svn_repo?(specified_source.data_provider.repo)
100
- sources = [specified_source]
97
+ sources = [svn_source_named(source_name)]
98
+ else
99
+ sources = svn_sources
101
100
  end
102
101
 
103
102
  sources.each do |source|
104
- UI.section "Updating spec-repo `#{source.name}`" do
105
- Dir.chdir(source.data_provider.repo) do
106
- output = svn!('up --non-interactive --trust-server-cert')
107
- UI.puts output if show_output && !config.verbose?
103
+ UI.section "Updating spec repo `#{source.name}`" do
104
+ Dir.chdir(source.repo) do
105
+ begin
106
+ output = svn!('up --non-interactive --trust-server-cert')
107
+ UI.puts output if show_output && !config.verbose?
108
+ rescue Informative => e
109
+ UI.warn 'CocoaPods was not able to update the ' \
110
+ "`#{source.name}` repo. If this is an unexpected issue " \
111
+ 'and persists you can inspect it running ' \
112
+ '`pod repo-svn update --verbose`'
113
+ end
108
114
  end
109
- SourcesManager.check_version_information(source.data_provider.repo) #todo: test me
115
+ SourcesManager.check_version_information(source.repo)
110
116
  end
111
117
  end
112
118
  end
113
119
 
120
+ # @return [Source] The svn source with the given name. If no svn source
121
+ # with given name is found it raises.
122
+ #
123
+ # @param [String] name
124
+ # The name of the source.
125
+ #
126
+ def svn_source_named(name)
127
+ specified_source = SourcesManager.aggregate.sources.find { |s| s.name == name }
128
+ unless specified_source
129
+ raise Informative, "Unable to find the `#{name}` repo."
130
+ end
131
+ unless svn_repo?(specified_source.repo)
132
+ raise Informative, "The `#{name}` repo is not a svn repo."
133
+ end
134
+ specified_source
135
+ end
136
+
137
+ # @return [Source] The list of the svn sources.
138
+ #
139
+ def svn_sources
140
+ SourcesManager.all.select do |source|
141
+ svn_repo?(source.repo)
142
+ end
143
+ end
144
+
114
145
  # Returns whether a source is a SVN repo.
115
146
  #
116
147
  # @param [Pathname] dir
@@ -1,3 +1,3 @@
1
1
  module RepoSvnExt
2
- VERSION = '0.1.1'
2
+ VERSION = '1.1.0'
3
3
  end
@@ -0,0 +1,14 @@
1
+ require File.expand_path('../../../spec_helper', __FILE__)
2
+
3
+ module Pod
4
+ describe Command::RepoSvn::Add do
5
+ it 'returns the proper command class' do
6
+ Command.parse(%w( repo-svn add )).should.be.instance_of Command::RepoSvn::Add
7
+ end
8
+
9
+ it 'fails without a repository url or name' do
10
+ command = Command.parse(%w( repo-svn add ))
11
+ lambda { command.validate! }.should.raise CLAide::InformativeError
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ require File.expand_path('../../../spec_helper', __FILE__)
2
+
3
+ module Pod
4
+ describe Command::RepoSvn::Remove do
5
+ it 'returns the proper command class' do
6
+ Command.parse(%w( repo-svn remove )).should.be.instance_of Command::RepoSvn::Remove
7
+ end
8
+
9
+ it 'fails without a repository name' do
10
+ command = Command.parse(%w( repo-svn remove ))
11
+ lambda { command.validate! }.should.raise CLAide::InformativeError
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,19 @@
1
+ require File.expand_path('../../../spec_helper', __FILE__)
2
+ include CLAide::InformativeError
3
+
4
+ module Pod
5
+ describe Command::RepoSvn::Update do
6
+ it 'returns the proper command class' do
7
+ Command.parse(%w( repo-svn update )).should.be.instance_of Command::RepoSvn::Update
8
+ end
9
+
10
+ it 'fails without a repository name' do
11
+ command = Command.parse(%w( repo-svn update ))
12
+ lambda { command.validate! }.should.raise CLAide::InformativeError
13
+ end
14
+
15
+ it 'updates a repository' do
16
+ #
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,9 @@
1
+ require File.expand_path('../../spec_helper', __FILE__)
2
+
3
+ module Pod
4
+ describe Command::RepoSvn do
5
+ it 'registers itself' do
6
+ Command.parse(%w(repo-svn)).should.be.instance_of Command::RepoSvn
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,21 @@
1
+ Pod::Spec.new do |s|
2
+ s.name = 'BananaLib'
3
+ s.version = '1.0'
4
+ s.authors = 'Banana Corp', { 'Monkey Boy' => 'monkey@banana-corp.local' }
5
+ s.homepage = 'http://banana-corp.local/banana-lib.html'
6
+ s.summary = 'Chunky bananas!'
7
+ s.description = 'Full of chunky bananas.'
8
+ s.platform = :ios
9
+
10
+ s.source = { :git => 'http://banana-corp.local/banana-lib.git', :tag => 'v1.0' }
11
+ s.source_files = 'Classes/*.{h,m}', 'Vendor'
12
+ s.xcconfig = { 'OTHER_LDFLAGS' => '-framework SystemConfiguration' }
13
+ s.prefix_header_file = 'Classes/BananaLib.pch'
14
+ s.resources = "Resources/*.png"
15
+ s.dependency 'monkey', '~> 1.0.1', '< 1.0.9'
16
+ s.license = {
17
+ :type => 'MIT',
18
+ :file => 'LICENSE',
19
+ :text => 'Permission is hereby granted ...'
20
+ }
21
+ end
@@ -0,0 +1,11 @@
1
+ Pod::Spec.new do |s|
2
+ s.name = 'JSONKit'
3
+ s.version = '1.4'
4
+ s.license = 'BSD / Apache License, Version 2.0'
5
+ s.summary = 'A Very High Performance Objective-C JSON Library.'
6
+ s.homepage = 'https://github.com/johnezang/JSONKit'
7
+ s.author = 'John Engelhart'
8
+ s.source = { :git => 'https://github.com/johnezang/JSONKit.git', :tag => 'v1.4' }
9
+
10
+ s.source_files = 'JSONKit.*'
11
+ end
@@ -0,0 +1,12 @@
1
+ Pod::Spec.new do |s|
2
+ s.name = 'JSONKit'
3
+ s.version = '999.999.999'
4
+ s.license = 'BSD / Apache License, Version 2.0'
5
+ s.summary = 'A Very High Performance Objective-C JSON Library.'
6
+ s.homepage = 'https://github.com/johnezang/JSONKit'
7
+ s.author = 'John Engelhart'
8
+ s.source = { :git => 'https://github.com/johnezang/JSONKit.git', :commit => '0aff3deb5e1bb2bbc88a83fd71c8ad5550185cce' }
9
+
10
+ s.source_files = 'JSONKit.*'
11
+ s.compiler_flags = '-Wno-deprecated-objc-isa-usage', '-Wno-format'
12
+ end
@@ -0,0 +1,17 @@
1
+ Pod::Spec.new do |s|
2
+ s.name = 'Pod+With+Plus+Signs'
3
+ s.version = '1.0'
4
+ s.authors = 'Evil Corp'
5
+ s.homepage = 'http://evil-corp.local/pod_with_plus_signs.html'
6
+ s.summary = 'Messing with special chars'
7
+ s.description = 'I love messing up with special chars in my pod name! Mouahahahahaa (evil laugh)'
8
+ s.platform = :ios
9
+
10
+ s.source = { :git => 'http://evil-corp.local/pod_with_plus_signs.git', :tag => '1.0' }
11
+ s.source_files = 'Classes/*.{h,m}'
12
+ s.license = {
13
+ :type => 'MIT',
14
+ :file => 'LICENSE',
15
+ :text => 'Permission is hereby granted ...'
16
+ }
17
+ end
@@ -0,0 +1,53 @@
1
+ ROOT = Pathname.new(File.expand_path('../../', __FILE__))
2
+ $LOAD_PATH.unshift((ROOT + 'lib').to_s)
3
+ $LOAD_PATH.unshift((ROOT + 'spec').to_s)
4
+
5
+ require 'bundler/setup'
6
+ require 'bacon'
7
+ require 'mocha-on-bacon'
8
+ require 'pretty_bacon'
9
+ require 'cocoapods'
10
+
11
+ require 'cocoapods_plugin'
12
+
13
+ #-----------------------------------------------------------------------------#
14
+
15
+ module Pod
16
+ # Disable the wrapping so the output is deterministic in the tests.
17
+ #
18
+ UI.disable_wrap = true
19
+
20
+ # Redirects the messages to an internal store.
21
+ #
22
+ module UI
23
+ @output = ''
24
+ @warnings = ''
25
+
26
+ class << self
27
+ attr_accessor :output
28
+ attr_accessor :warnings
29
+
30
+ def puts(message = '')
31
+ @output << "#{message}\n"
32
+ end
33
+
34
+ def warn(message = '', _actions = [])
35
+ @warnings << "#{message}\n"
36
+ end
37
+
38
+ def print(message)
39
+ @output << message
40
+ end
41
+ end
42
+ end
43
+ end
44
+
45
+ #-----------------------------------------------------------------------------#
46
+
47
+ module SpecHelper
48
+ def self.temporary_directory
49
+ ROOT + 'tmp'
50
+ end
51
+ end
52
+
53
+ #-----------------------------------------------------------------------------#
@@ -0,0 +1,61 @@
1
+
2
+ #
3
+ # https://github.com/CocoaPods/CocoaPods/blob/master/spec/spec_helper/temporary_repos.rb
4
+ #
5
+
6
+ module SpecHelper
7
+ def self.tmp_repos_path
8
+ TempSvnRepo.tmp_repos_path
9
+ end
10
+
11
+ module TempSvnRepo
12
+ extend Pod::Executable
13
+ executable :svn
14
+
15
+ #
16
+ # Copy test-repo to temp location and initialize local svn repository
17
+ #
18
+ def repo_make(name)
19
+ path = repo_path(name)
20
+ path.mkpath
21
+ Dir.chdir(path) do
22
+ `echo stuff`
23
+ end
24
+ path
25
+ end
26
+
27
+ #
28
+ # @return [Pathname] The path for the repo with the given name.
29
+ #
30
+ def repo_path(name)
31
+ tmp_repos_path + name
32
+ end
33
+
34
+ # Sets up a lightweight svn master repo in `tmp/cocoapods/repos/master` with the
35
+ # contents of `spec/fixtures/spec-repos/test_repo`.
36
+ #
37
+ def set_up_test_repo
38
+ # require 'fileutils'
39
+ # test_repo_path.mkpath
40
+ # origin = ROOT + 'spec/fixtures/spec-repos/test_repo/.'
41
+ # destination = tmp_repos_path + 'master'
42
+ # FileUtils.cp_r(origin, destination)
43
+ # repo_make('master')
44
+ end
45
+
46
+ #--------------------------------------#
47
+
48
+ def tmp_repos_path
49
+ SpecHelper.temporary_directory + 'cocoapods/repos'
50
+ end
51
+
52
+ module_function :tmp_repos_path
53
+
54
+ def self.extended(base)
55
+ base.before do
56
+ tmp_repos_path.mkpath
57
+ end
58
+ end
59
+
60
+ end
61
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-repo-svn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dustin Clark
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-07 00:00:00.000000000 Z
11
+ date: 2015-01-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -56,6 +56,16 @@ files:
56
56
  - lib/repo_svn_ext.rb
57
57
  - lib/repo_svn_ext/version.rb
58
58
  - repo_svn_ext.gemspec
59
+ - spec/command/repo-svn/add_spec.rb
60
+ - spec/command/repo-svn/remove_spec.rb
61
+ - spec/command/repo-svn/update_spec.rb
62
+ - spec/command/repo-svn_spec.rb
63
+ - spec/fixtures/spec-repos/test-repo/BananaLib/1.0/BananaLib.podspec
64
+ - spec/fixtures/spec-repos/test-repo/JSONKit/1.4/JSONKit.podspec
65
+ - spec/fixtures/spec-repos/test-repo/JSONKit/999.999.999/JSONKit.podspec
66
+ - spec/fixtures/spec-repos/test-repo/Pod+With+Plus+Signs/1.0/Pod+With+Plus+Signs.podspec
67
+ - spec/spec_helper.rb
68
+ - spec/spec_helper/svn.rb
59
69
  homepage: https://github.com/clarkda/cocoapods-repo-svn
60
70
  licenses:
61
71
  - MIT
@@ -76,8 +86,18 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
86
  version: '0'
77
87
  requirements: []
78
88
  rubyforge_project:
79
- rubygems_version: 2.2.2
89
+ rubygems_version: 2.0.14
80
90
  signing_key:
81
91
  specification_version: 4
82
92
  summary: Subversion support for spec repository
83
- test_files: []
93
+ test_files:
94
+ - spec/command/repo-svn/add_spec.rb
95
+ - spec/command/repo-svn/remove_spec.rb
96
+ - spec/command/repo-svn/update_spec.rb
97
+ - spec/command/repo-svn_spec.rb
98
+ - spec/fixtures/spec-repos/test-repo/BananaLib/1.0/BananaLib.podspec
99
+ - spec/fixtures/spec-repos/test-repo/JSONKit/1.4/JSONKit.podspec
100
+ - spec/fixtures/spec-repos/test-repo/JSONKit/999.999.999/JSONKit.podspec
101
+ - spec/fixtures/spec-repos/test-repo/Pod+With+Plus+Signs/1.0/Pod+With+Plus+Signs.podspec
102
+ - spec/spec_helper.rb
103
+ - spec/spec_helper/svn.rb