cocoapods-repo-rsync 1.0.0.0 → 1.0.0.1

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: a5c82fa68b9e0c534bd092d59f36c0e196d3f89a
4
- data.tar.gz: 1d9375268334ddddde04af599b265bcc25b2f54b
3
+ metadata.gz: ab6853d30e34d94b06eb32519df0cd4682cc2c72
4
+ data.tar.gz: 2a629795edd05f646f866b5271af6de9b1d76a3f
5
5
  SHA512:
6
- metadata.gz: 36c4131fb82af6ff8e638fe7ae771b8ee8d103acc53bd0f0faad53df4aec4fdbe7fa4a4497abfc89d48b8a611f1bcbf88a0dd08f290c3da0a06d37b2ddd6dfe7
7
- data.tar.gz: a5a2f40e91b1caddea3e4ecbfc1d6c0f89b8023b90158e7d8a7c55d9bfce638c4805525e5bc23d7f4e03f5f32700cd3a6deb9f55a90288f775897f0cb7653fd1
6
+ metadata.gz: f5b672fc3300eb23a5c0cad9fb996fe7d49a9b998a07c536d5211669c2a00b22d87873a103ec99eb6497cbdfd5532fb6f1428a1fc396e73f6f3bac48919bfb36
7
+ data.tar.gz: fe21b7cfff7604ecd274fb886024efa3aadf8f4120870644e5d4369fce08ac21c19c9dc34149849e6e0c773a98b5ccac5591540deb09b5ccb2d62a8b6fbe7317
@@ -2,5 +2,5 @@
2
2
  # The namespace of the Cocoapods repo rsync plugin.
3
3
  #
4
4
  module CocoapodsRepoRsync
5
- VERSION = '1.0.0.0'
5
+ VERSION = '1.0.0.1'
6
6
  end
@@ -1,36 +1,43 @@
1
- require 'pod/command/repo_rsync'
2
- require 'pod/podfile/dsl'
3
- require 'rsync_source'
1
+ require "cocoapods"
4
2
 
5
- # This pre_install hook requires cocoapods v. 0.38.0.beta.2 or higher
6
- Pod::HooksManager.register('cocoapods-repo-rsync', :source_provider) do |context, options|
7
- Pod::UI.message 'cocoapods-repo-rsync received source_provider hook'
8
- return unless sources = options['sources']
9
- sources.each do |url|
10
- url = url + "/" unless url.end_with?("/")
11
- source = Pod::RsyncSource.rsync_source_by_url(url)
12
- if source
13
- unless Pod::Config.instance.skip_repo_update
14
- argv = CLAide::ARGV.new([source.name])
15
- Pod::Command::RepoRsync::Update.new(argv).run()
16
- end
17
- else
18
- argv = CLAide::ARGV.new([name_for_url(url), url])
19
- Pod::Command::RepoRsync::Add.new(argv).run()
3
+ if Gem::Dependency.new("", '>= 0.39').match?('', Pod::VERSION)
4
+ require 'pod/command/repo_rsync'
5
+ require 'pod/podfile/dsl'
6
+ require 'rsync_source'
7
+
8
+ # This pre_install hook requires cocoapods v. 0.38.0.beta.2 or higher
9
+ Pod::HooksManager.register('cocoapods-repo-rsync', :source_provider) do |context, options|
10
+ Pod::UI.message 'cocoapods-repo-rsync received source_provider hook'
11
+ return unless sources = options['sources']
12
+ sources.each do |url|
13
+ url = url + "/" unless url.end_with?("/")
20
14
  source = Pod::RsyncSource.rsync_source_by_url(url)
15
+ if source
16
+ update = true
17
+ # CP 1.0.0 not support
18
+ update = Pod::Config.instance.skip_repo_update if Gem::Dependency.new("", '~> 0.39').match?('', Pod::VERSION)
19
+ if update
20
+ argv = CLAide::ARGV.new([source.name])
21
+ Pod::Command::RepoRsync::Update.new(argv).run()
22
+ end
23
+ else
24
+ argv = CLAide::ARGV.new([name_for_url(url), url])
25
+ Pod::Command::RepoRsync::Add.new(argv).run()
26
+ source = Pod::RsyncSource.rsync_source_by_url(url)
27
+ end
28
+ context.add_source(source)
21
29
  end
22
- context.add_source(source)
23
30
  end
24
- end
25
31
 
26
- # @param [String] url The URL of the RSYNC repository
27
- #
28
- # @return [String] a name for the repository
29
- #
30
- # For now, this uses the host and the last component of the URL as the name
31
- # So spec@my.server.com:/home/spec will return my-server-com-spec
32
- def name_for_url(url)
33
- host, path = url.split(":")
34
- path = path.split("/").last
35
- return path.gsub(".", "-").downcase
32
+ # @param [String] url The URL of the RSYNC repository
33
+ #
34
+ # @return [String] a name for the repository
35
+ #
36
+ # For now, this uses the host and the last component of the URL as the name
37
+ # So spec@my.server.com:/home/spec will return my-server-com-spec
38
+ def name_for_url(url)
39
+ host, path = url.split(":")
40
+ path = path.split("/").last
41
+ return path.gsub(".", "-").downcase
42
+ end
36
43
  end
@@ -79,7 +79,11 @@ module Pod
79
79
  # The name of the source.
80
80
  #
81
81
  def rsync_source_named(name)
82
- specified_source = SourcesManager.aggregate.sources.find { |s| s.name == name }
82
+ if Gem::Dependency.new("", '>= 1.0').match?('', Pod::VERSION)
83
+ specified_source = Pod::Config.instance.sources_manager.aggregate.sources.find { |s| s.name == name }
84
+ else
85
+ specified_source = SourcesManager.aggregate.sources.find { |s| s.name == name }
86
+ end
83
87
  unless specified_source
84
88
  raise Informative, "Unable to find the `#{name}` repo."
85
89
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-repo-rsync
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.0
4
+ version: 1.0.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Whirlwind
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-06 00:00:00.000000000 Z
11
+ date: 2016-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler