Sha256: 922d5664eebec50294a03cf07d97b392aa95ede8dbb92f7e4cfd6d030abf94f5

Contents?: true

Size: 688 Bytes

Versions: 3

Compression:

Stored size: 688 Bytes

Contents

module Jekyll_FTP
	class SubCommand
		def self.send(ftp, path, init_path = nil)
			init_path ||= path
  			Dir.entries(path).each do |file|
    			next if ['.', '..'].include? file
    
    			file_path = path + '/' + file
    			short_file_path = file_path[init_path.length, file_path.length]
    			if File.directory?(file_path)
      				ftp.mkdir(file) unless ftp.nlst.index(file)
      				ftp.chdir(file)
      				send(ftp, file_path, init_path)
      				ftp.chdir('..')
    			else
      				puts "Deploying: ".green + short_file_path
      				puts "       To: ".yellow + ftp.pwd + '/' + file
    			  	ftp.putbinaryfile(path + '/' + file, file)
    			end
			end
		end
	end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
jekyll-ftp-0.2.0 lib/jekyll-ftp/send.rb
jekyll-ftp-0.1.1 lib/jekyll-ftp/send.rb
jekyll-ftp-0.1.0 lib/jekyll-ftp/send.rb