class Pod::RsyncSource
Subclass of Pod::Source to provide support for RSYNC Specs repositories
Public Class Methods
rsync_repo?(dir)
click to toggle source
# File lib/rsync_source.rb, line 50 def self.rsync_repo?(dir) (dir+".rsync_config").exist? end
rsync_source_by_url(url)
click to toggle source
# File lib/rsync_source.rb, line 66 def self.rsync_source_by_url(url) print "url::: #{url}" rsync_sources.find do |source| source.url == url end end
rsync_sources()
click to toggle source
# File lib/rsync_source.rb, line 54 def self.rsync_sources if Pod::Config.instance.repos_dir.exist? dirs = Pod::Config.instance.repos_dir.children.select(&:directory?) dirs = dirs.select do |dir| RsyncSource.rsync_repo?(dir) end dirs.map { |dir| RsyncSource.new(dir) } else [] end end
Public Instance Methods
argv()
click to toggle source
# File lib/rsync_source.rb, line 41 def argv parse_config unless @argv @argv end
argv=(argv)
click to toggle source
# File lib/rsync_source.rb, line 46 def argv=(argv) @argv = argv end
parse_config()
click to toggle source
# File lib/rsync_source.rb, line 5 def parse_config @url, @argv = File.open(repo + '.rsync_config', "r:UTF-8", &:read).split("\n").map { |c| c.strip } @url + "/" unless @url.end_with?("/") @argv ||= "" unless @argv if File.exist?(repo + '.skip') @skip = "true" else @skip = "false" end end
save_config()
click to toggle source
# File lib/rsync_source.rb, line 17 def save_config File.open(repo+".rsync_config", "w:UTF-8") do |f| f.write "#{@url}\n#{@argv}" end end
skip()
click to toggle source
# File lib/rsync_source.rb, line 32 def skip parse_config unless @skip @skip end
skip=(skip)
click to toggle source
# File lib/rsync_source.rb, line 37 def skip=(skip) @skip = skip end
url()
click to toggle source
# File lib/rsync_source.rb, line 23 def url parse_config unless @url @url end
url=(url)
click to toggle source
# File lib/rsync_source.rb, line 28 def url=(url) @url = url end