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


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

def initialize(path, entry)
  @path = path
  @mode, _, @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


14
15
16
# File 'lib/rake/contrib/ftptools.rb', line 14

def group
  @group
end

#nameObject (readonly)

Returns the value of attribute name


14
15
16
# File 'lib/rake/contrib/ftptools.rb', line 14

def name
  @name
end

#ownerObject (readonly)

Returns the value of attribute owner


14
15
16
# File 'lib/rake/contrib/ftptools.rb', line 14

def owner
  @owner
end

#sizeObject (readonly)

Returns the value of attribute size


14
15
16
# File 'lib/rake/contrib/ftptools.rb', line 14

def size
  @size
end

#timeObject (readonly)

Returns the value of attribute time


14
15
16
# File 'lib/rake/contrib/ftptools.rb', line 14

def time
  @time
end

Class Method Details

.dateObject


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

def self.date
  @date_class ||= Date
end

.timeObject


20
21
22
# File 'lib/rake/contrib/ftptools.rb', line 20

def self.time
  @time_class ||= Time
end

Instance Method Details

#directory?Boolean


35
36
37
# File 'lib/rake/contrib/ftptools.rb', line 35

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

#modeObject


39
40
41
# File 'lib/rake/contrib/ftptools.rb', line 39

def mode
  parse_mode(@mode)
end

#pathObject


31
32
33
# File 'lib/rake/contrib/ftptools.rb', line 31

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

#symlink?Boolean


43
44
45
# File 'lib/rake/contrib/ftptools.rb', line 43

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