cocoapods-repo-rsync 1.0.0.0 → 1.0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cocoapods-repo-rsync.rb +1 -1
- data/lib/cocoapods_plugin.rb +37 -30
- data/lib/pod/command/repo_rsync/update.rb +5 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab6853d30e34d94b06eb32519df0cd4682cc2c72
|
4
|
+
data.tar.gz: 2a629795edd05f646f866b5271af6de9b1d76a3f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5b672fc3300eb23a5c0cad9fb996fe7d49a9b998a07c536d5211669c2a00b22d87873a103ec99eb6497cbdfd5532fb6f1428a1fc396e73f6f3bac48919bfb36
|
7
|
+
data.tar.gz: fe21b7cfff7604ecd274fb886024efa3aadf8f4120870644e5d4369fce08ac21c19c9dc34149849e6e0c773a98b5ccac5591540deb09b5ccb2d62a8b6fbe7317
|
data/lib/cocoapods-repo-rsync.rb
CHANGED
data/lib/cocoapods_plugin.rb
CHANGED
@@ -1,36 +1,43 @@
|
|
1
|
-
require
|
2
|
-
require 'pod/podfile/dsl'
|
3
|
-
require 'rsync_source'
|
1
|
+
require "cocoapods"
|
4
2
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
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
|
-
|
34
|
-
|
35
|
-
|
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
|
-
|
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.
|
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-
|
11
|
+
date: 2016-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|