Sha256: 5b5df34c3796d1151b2e92fa2b6f04dcffd3d113991d0d33611c028e25ca8b6c

Contents?: true

Size: 915 Bytes

Versions: 2

Compression:

Stored size: 915 Bytes

Contents

require 'fileutils'

module CapistranoExtensions
  module Files
    module Local

      def tail_f(file, n=10)
        unless defined? File::Tail::Logfile
          gem 'file-tail'
          require 'file/tail'
        end
        File::Tail::Logfile.tail(file, :backward=>n) do |line| puts line end
      end

      def upload(from, to)
        cp(from, to)
      end

      def download(from, to)
        cp(from, to)
      end


      include FileUtils::Verbose

      public *FileUtils::Verbose.methods(false)
      private *%w(copy_entry copy_file copy_stream
                  remove_entry remove_entry_secure remove_file
                  compare_file compare_stream
                  uptodate?)

      class_eval(%w(exists? directory? executable?).map do |m|
        "def #{m}(f) File.#{m}(f) end"
      end.join("\n"))

    end
  end
end

Capistrano.plugin :local_files, CapistranoExtensions::Files::Local

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
joekhoobyar-capistrano-extensions-0.0.0 lib/capistrano_extensions/files/local.rb
joekhoobyar-joekhoobyar-capistrano-extensions-0.0.0 lib/capistrano_extensions/files/local.rb