cocoapods-repo-rsync 1.0.0.5 → 1.0.6

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: e91d3380dfba16cac84a4e12156cac5ae0dc5fc9
4
- data.tar.gz: ae2d82ab74a9a27f960d005903f8134b54a87689
3
+ metadata.gz: 2c028c24560bf476c1e1c7f319dee0a99c8fdc9f
4
+ data.tar.gz: f790c05928f9ea4e1a6ea4e80fee630c3fc284c9
5
5
  SHA512:
6
- metadata.gz: 7e2edcc01309f01f00fa9ab5e8517cb8ed731df4a3c1c97a11a849e48dcf0df78af441b029fda6f65c07343943a0388235b7049868890195f7422ade98fd252f
7
- data.tar.gz: 531457a64837b073c7380938a2f7875cde9f7c1d523f74fe0f0fb7e5af96b1f13492896d8c971629483810732cb6e657f94f58eb0fc7b03a7d6a88a473e907ff
6
+ metadata.gz: f20a6ebfe60cfa993479729abebe740086f34d020e24b1337090f438901d240d5977efce72eea7c67dd1a358a0f3e792f8058258b59a1ffdbad1d3634f5ef698
7
+ data.tar.gz: 990ac59f5415ab09f7d249639a065ea8920a08cc16a77551836d092c0ac15bffb9718f3eab3f03d9d08a1567968477bd70d82c6220d245365c099c2f22b1a68e
@@ -6,8 +6,8 @@ require 'cocoapods-repo-rsync'
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = 'cocoapods-repo-rsync'
8
8
  spec.version = CocoapodsRepoRsync::VERSION
9
- spec.authors = ['Whirlwind']
10
- spec.email = ['whirlwindjames@foxmail.com']
9
+ spec.authors = ['bisheng.dongbs']
10
+ spec.email = ['charlesdbs@gmail.com']
11
11
  spec.description = %q{CocoaPod plugin to add rsync support for spec repositories}
12
12
  spec.summary = %q{Rsync support for spec repository}
13
13
  spec.homepage = 'https://github.com/clarkda/cocoapods-repo-rsync'
@@ -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.5'
5
+ VERSION = '1.0.6'
6
6
  end
@@ -10,7 +10,7 @@ if Gem::Dependency.new("", '>= 0.39').match?('', Pod::VERSION)
10
10
  Pod::UI.message 'cocoapods-repo-rsync received source_provider hook'
11
11
  return unless sources = options['sources']
12
12
  sources.each do |source|
13
- url, ssh_argv = source
13
+ url, ssh_argv ,skip= source
14
14
  url = url + "/" unless url.end_with?("/")
15
15
  source = Pod::RsyncSource.rsync_source_by_url(url)
16
16
  if source
@@ -19,14 +19,14 @@ if Gem::Dependency.new("", '>= 0.39').match?('', Pod::VERSION)
19
19
  update = !Pod::Config.instance.skip_repo_update if Gem::Dependency.new("", '~> 0.39').match?('', Pod::VERSION)
20
20
  if update
21
21
  if File.writable?(source.repo)
22
- argv = CLAide::ARGV.new([source.name, ssh_argv])
22
+ argv = CLAide::ARGV.new([source.name, ssh_argv,skip])
23
23
  Pod::Command::RepoRsync::Update.new(argv).run()
24
24
  else
25
25
  Pod::UI.puts "#{source.name} is readonly, skip update."
26
26
  end
27
27
  end
28
28
  else
29
- argv = CLAide::ARGV.new([name_for_url(url), url, ssh_argv])
29
+ argv = CLAide::ARGV.new([name_for_url(url), url, ssh_argv,skip])
30
30
  Pod::Command::RepoRsync::Add.new(argv).run()
31
31
  source = Pod::RsyncSource.rsync_source_by_url(url)
32
32
  end
@@ -3,7 +3,44 @@ require 'cocoapods-repo-rsync'
3
3
 
4
4
  module Pod
5
5
  class Command
6
+ module Options
7
+ # Provides support for commands to skip updating the spec repositories.
8
+ #
9
+ module RepoUpdate
10
+ module Options
11
+ def options
12
+ [
13
+ ['--no-repo-update', 'Skip running `pod repo update` before install'],
14
+ ].concat(super)
15
+ end
16
+ end
17
+
18
+ def self.included(base)
19
+ base.extend(Options)
20
+ end
21
+
22
+ def repo_update?(default: false)
23
+ if @repo_update.nil?
24
+ default
25
+ else
26
+ @repo_update
27
+ end
28
+ end
29
+
30
+ def initialize(argv)
31
+ @repo_update = argv.flag?('repo-update')
32
+ print "@repo_update #{@repo_update} \n"
33
+ if !@repo_update.nil?
34
+ ENV["NO_REPO_UPDATE"]="true"
35
+ end
36
+ super
37
+ end
38
+ end
39
+ end
40
+
6
41
  class RepoRsync < Command
42
+
43
+
7
44
  require 'pod/command/repo_rsync/add'
8
45
  require 'pod/command/repo_rsync/update'
9
46
 
@@ -35,14 +35,42 @@ module Pod
35
35
  config.repos_dir.mkpath
36
36
  dir=config.repos_dir+@name
37
37
  Dir.chdir(config.repos_dir) do
38
- cmd = "rsync #{@ssh_argv || ""} -rtlz#{config.verbose? ? "v" : ""} --exclude=.rsync_config --delete \"#{@url}\" \"#{dir}\""
39
- UI.puts cmd if config.verbose?
40
- system(cmd)
38
+ cmd = "rsync #{@ssh_argv || ""} -rtlz#{config.verbose? ? "v" : ""} --exclude=.rsync_config --exclude=.skip --delete \"#{@url}\" \"#{dir}/\" | grep -v /$"
39
+
40
+ source_skip = @name.gsub('-','_') + "_skip"
41
+ print "source_skip:: #{ENV[source_skip]} ....\n"
42
+ env_skip = ENV[source_skip]
43
+ if "false" == env_skip
44
+ UI.puts cmd if config.verbose?
45
+ system(cmd)
46
+ elsif "true" == env_skip
47
+ print " skip update repo \n"
48
+ else
49
+ print " update repo \n"
50
+ UI.puts cmd if config.verbose?
51
+ system(cmd)
52
+ end
53
+
54
+ #system(cmd)
55
+
56
+ =begin
57
+ if "true" == RsyncSource.new(dir).skip
58
+ print "!!! skip update repo \n"
59
+ else
60
+ print "!!! update repo #{skip} \n"
61
+ UI.puts cmd if config.verbose?
62
+
63
+ end
64
+ =end
65
+
66
+
67
+ source = RsyncSource.new(dir)
68
+ source.url = @url
69
+ source.argv = @ssh_argv
70
+ source.save_config
71
+ print "source.url:: #{source.url} \n"
41
72
  if $?.success?
42
- source = RsyncSource.new(dir)
43
- source.url = @url
44
- source.argv = @ssh_argv
45
- source.save_config
73
+
46
74
  end
47
75
  end
48
76
  end
@@ -50,4 +78,4 @@ module Pod
50
78
  end
51
79
  end
52
80
  end
53
- end
81
+ end
@@ -2,6 +2,9 @@ module Pod
2
2
  class Command
3
3
  class RepoRsync
4
4
  class Update < RepoRsync
5
+
6
+
7
+
5
8
  self.summary = 'Update a rsync spec-repo.'
6
9
 
7
10
  self.description = <<-DESC
@@ -26,7 +29,7 @@ module Pod
26
29
  # end
27
30
 
28
31
  def run
29
- update(@name, @ssh_argv) #todo: dusty
32
+ update(@name, @ssh_argv, $skip) #todo: dusty
30
33
  end
31
34
 
32
35
  #@!group Update helpers
@@ -48,7 +51,7 @@ module Pod
48
51
  #
49
52
  # @return [void]
50
53
  #
51
- def update(source_name = nil, argv = nil)
54
+ def update(source_name = nil, argv = nil, skip = nil)
52
55
  if source_name
53
56
  sources = [rsync_source_named(source_name)]
54
57
  else
@@ -59,9 +62,22 @@ module Pod
59
62
  UI.section "Updating spec repo `#{source.name}`" do
60
63
  Dir.chdir(source.repo) do
61
64
  begin
62
- cmd = "rsync #{argv || source.argv || ""} -rtl#{config.verbose? ? "v" : ""} --exclude=.rsync_config --delete \"#{source.url}\" \"#{source.repo}\""
63
- UI.puts cmd if config.verbose?
64
- system(cmd)
65
+ cmd = "rsync #{argv || source.argv || ""} -rtl#{config.verbose? ? "v" : ""} --exclude=.rsync_config --exclude=.skip --delete \"#{source.url}\" \"#{source.repo}/\" | grep -v /$"
66
+
67
+ source_skip = source.name.gsub('-','_') + "_skip"
68
+ env_skip = ENV[source_skip]
69
+ no_repo_update = ENV["NO_REPO_UPDATE"]
70
+ if "false" == env_skip
71
+ UI.puts cmd if config.verbose?
72
+ system(cmd)
73
+ elsif "true" == source.skip || "true" == env_skip || "true" == no_repo_update
74
+ print " skip update repo \n"
75
+ else
76
+ print " update repo \n"
77
+ UI.puts cmd if config.verbose?
78
+ system(cmd)
79
+ end
80
+ # system(cmd)
65
81
  rescue Informative => e
66
82
  UI.warn 'CocoaPods was not able to update the ' \
67
83
  "`#{source.name}` repo. If this is an unexpected issue " \
@@ -6,6 +6,12 @@ module Pod
6
6
  @url, @argv = File.open(repo + '.rsync_config', "r:UTF-8", &:read).split("\n").map { |c| c.strip }
7
7
  @url + "/" unless @url.end_with?("/")
8
8
  @argv ||= "" unless @argv
9
+ if File.exist?(repo + '.skip')
10
+ @skip = "true"
11
+ else
12
+ @skip = "false"
13
+ end
14
+
9
15
  end
10
16
 
11
17
  def save_config
@@ -23,6 +29,15 @@ module Pod
23
29
  @url = url
24
30
  end
25
31
 
32
+ def skip
33
+ parse_config unless @skip
34
+ @skip
35
+ end
36
+
37
+ def skip=(skip)
38
+ @skip = skip
39
+ end
40
+
26
41
  def argv
27
42
  parse_config unless @argv
28
43
  @argv
@@ -49,6 +64,7 @@ module Pod
49
64
  end
50
65
 
51
66
  def self.rsync_source_by_url(url)
67
+ print "url::: #{url}"
52
68
  rsync_sources.find do |source|
53
69
  source.url == url
54
70
  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.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
- - Whirlwind
7
+ - bisheng.dongbs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-22 00:00:00.000000000 Z
11
+ date: 2017-05-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '0'
55
55
  description: CocoaPod plugin to add rsync support for spec repositories
56
56
  email:
57
- - whirlwindjames@foxmail.com
57
+ - charlesdbs@gmail.com
58
58
  executables: []
59
59
  extensions: []
60
60
  extra_rdoc_files: []
@@ -90,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
90
  version: '0'
91
91
  requirements: []
92
92
  rubyforge_project:
93
- rubygems_version: 2.6.4
93
+ rubygems_version: 2.6.11
94
94
  signing_key:
95
95
  specification_version: 4
96
96
  summary: Rsync support for spec repository