Class: Rake::FtpFile

Inherits:
Object
  • Object
show all
Defined in:
lib/rake/contrib/ftptools.rb

Overview

Note: Not released for general use.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, entry) ⇒ FtpFile

Returns a new instance of FtpFile.



26
27
28
29
30
31
# File 'lib/rake/contrib/ftptools.rb', line 26

def initialize(path, entry)
  @path = path
  @mode, line, @owner, @group, size, d1, d2, d3, @name = entry.split(' ')
  @size = size.to_i
  @time = determine_time(d1, d2, d3)
end

Instance Attribute Details

#groupObject (readonly)

Returns the value of attribute group.



16
17
18
# File 'lib/rake/contrib/ftptools.rb', line 16

def group
  @group
end

#nameObject (readonly)

Returns the value of attribute name.



16
17
18
# File 'lib/rake/contrib/ftptools.rb', line 16

def name
  @name
end

#ownerObject (readonly)

Returns the value of attribute owner.



16
17
18
# File 'lib/rake/contrib/ftptools.rb', line 16

def owner
  @owner
end

#sizeObject (readonly)

Returns the value of attribute size.



16
17
18
# File 'lib/rake/contrib/ftptools.rb', line 16

def size
  @size
end

#timeObject (readonly)

Returns the value of attribute time.



16
17
18
# File 'lib/rake/contrib/ftptools.rb', line 16

def time
  @time
end

Class Method Details

.dateObject



18
19
20
# File 'lib/rake/contrib/ftptools.rb', line 18

def self.date
  @date_class ||= Date
end

.timeObject



22
23
24
# File 'lib/rake/contrib/ftptools.rb', line 22

def self.time
  @time_class ||= Time
end

Instance Method Details

#directory?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/rake/contrib/ftptools.rb', line 37

def directory?
  @mode[0] == ?d
end

#modeObject



41
42
43
# File 'lib/rake/contrib/ftptools.rb', line 41

def mode
  parse_mode(@mode)
end

#pathObject



33
34
35
# File 'lib/rake/contrib/ftptools.rb', line 33

def path
  File.join(@path, @name)
end

#symlink?Boolean

Returns:

  • (Boolean)


45
46
47
# File 'lib/rake/contrib/ftptools.rb', line 45

def symlink?
  @mode[0] == ?l
end