class Pod::Command::RepoRsync::Add

Public Class Methods

new(argv) click to toggle source
Calls superclass method
# File lib/pod/command/repo_rsync/add.rb, line 18
def initialize(argv)
  @name, @url, @ssh_argv = argv.shift_argument, argv.shift_argument, argv.shift_argument
  if @url && !@url.end_with?("/")
    @url = @url+"/"
  end
  super
end

Public Instance Methods

run() click to toggle source
# File lib/pod/command/repo_rsync/add.rb, line 33
        def run
          UI.section("Checking out spec-repo `#{@name}` from `#{@url}` using rsync") do
            config.repos_dir.mkpath
            dir=config.repos_dir+@name
            Dir.chdir(config.repos_dir) do
              cmd = "rsync #{@ssh_argv || ""} -rtlz#{config.verbose? ? "v" : ""} --exclude=.rsync_config --exclude=.skip --delete \"#{@url}\" \"#{dir}/\" | grep -v /$"

              source_skip = @name.gsub('-','_') + "_skip"
              print "source_skip:: #{ENV[source_skip]} ....\n"
              env_skip =  ENV[source_skip]
              if "false" == env_skip
                UI.puts cmd if config.verbose?
                system(cmd)
              elsif  "true" == env_skip
                print " skip update repo \n"
              else
                print " update repo  \n"
                UI.puts cmd if config.verbose?
                system(cmd)
              end

              #system(cmd)

=begin
              if "true" == RsyncSource.new(dir).skip
                print "!!! skip update repo \n"
              else
                print "!!! update repo #{skip} \n"
                UI.puts cmd if config.verbose?

              end
=end


              source = RsyncSource.new(dir)
              source.url = @url
              source.argv = @ssh_argv
              source.save_config
              print "source.url:: #{source.url} \n"
              if $?.success?

              end
            end
          end
        end
validate!() click to toggle source
Calls superclass method
# File lib/pod/command/repo_rsync/add.rb, line 26
def validate!
  super
  unless @name && @url
    help! "Adding a spec-repo needs a `NAME` and a `URL`."
  end
end